Acerca de las Páginas de GitHub y Jekyll
Jekyll es un generador de sitios estáticos con soporte integrado para Páginas de GitHub.
Páginas de GitHub se encuentra disponible en repositorios públicos con GitHub gratis y en repositorios privados y públicos con GitHub Pro, Equipo de GitHub, Nube de GitHub Enterprise y Servidor de GitHub Enterprise.
En este artículo
- Acerca de Jekyll
- Configurando Jekyll en tu sitio Páginas de GitHub
- Front matter
- Temas
- Plugins
- Sintaxis enfatizada
- Construyendo su sitio localmente
Acerca de Jekyll
Jekyll is a static site generator with built-in support for Páginas de GitHub and a simplified build process. Jekyll takes Markdown and HTML files and creates a complete static website based on your choice of layouts. Jekyll supports Markdown and Liquid, a templating language that loads dynamic content on your site. For more information, see Jekyll.
Jekyll no está oficialmente admitido por Windows. For more information, see "Jekyll on Windows" in the Jekyll documenation.
We recommend using Jekyll with Páginas de GitHub. If you prefer, you can use other static site generators or customize your own build process locally or on another server. Para obtener más información, consulta "Acerca de Páginas de GitHub".
Configurando Jekyll en tu sitio Páginas de GitHub
You can configure most Jekyll settings, such as your site's theme and plugins, by editing your _config.yml file. For more information, see "Configuration" in the Jekyll documentation.
Some configuration settings cannot be changed for Páginas de GitHub sites.
lsi: false
safe: true
source: [your repo's top level directory]
incremental: false
highlighter: rouge
gist:
noscript: false
kramdown:
math_engine: mathjax
syntax_highlighter: rouge
By default, Jekyll doesn't build files or folders that:
- are located in a folder called
/node_modules
or/vendor
- start with
_
,.
, or#
- end with
~
- are excluded by the
exclude
setting in your configuration file
If you want Jekyll to process any of these files, you can use the includes
setting in your configuration file.
Front matter
To set variables and metadata, such as a title and layout, for a page or post on your site, you can add YAML front matter to the top of any Markdown or HTML file. For more information, see "Front Matter" in the Jekyll documentation.
You can add site.github
to a post or page to add any repository references metadata to your site. For more information, see "Using site.github
" in the Jekyll Metadata documentation.
Temas
You can add a Jekyll theme to your Páginas de GitHub site to customize the look and feel of your site. For more information, see "Themes" in the Jekyll documentation.
You can add a supported theme to your site manually. For more information, see "Supported themes" on the Páginas de GitHub site and "Adding a theme to your Páginas de GitHub site using Jekyll."
You can override any of your theme's defaults by editing the theme's files. For more information, see your theme's documentation and "Overriding your theme's defaults" in the Jekyll documentation.
Plugins
You can download or create Jekyll plugins to extend the functionality of Jekyll for your site. For example, the jemoji plugin lets you use GitHub-flavored emoji in any page on your site the same way you would on GitHub. For more information, see "Plugins" in the Jekyll documentation.
Páginas de GitHub uses plugins that are enabled by default and cannot be disabled:
jekyll-coffeescript
jekyll-default-layout
jekyll-gist
jekyll-github-metadata
jekyll-optional-front-matter
jekyll-paginate
jekyll-readme-index
jekyll-titles-from-headings
jekyll-relative-links
You can enable additional plugins by adding the plugin's gem to the plugins
setting in your _config.yml file. For more information, see "Configuration" in the Jekyll documentation. For a list of supported plugins, see "Dependency versions" on the Páginas de GitHub site.
For usage information for a specific plugin, see the plugin's documentation.
Tip: You can make sure you're using the latest version of all plugins by keeping the Páginas de GitHub gem updated. For more information, see "Testing your GitHub Pages site locally with Jekyll" and "Dependency versions" on the Páginas de GitHub site.
Páginas de GitHub cannot build sites using unsupported plugins. If you want to use unsupported plugins, generate your site locally and then push your site's static files to GitHub Enterprise.
Sintaxis enfatizada
Para facilitar la lectura de tu sitio, los fragmentos de código se resaltan en los sitios de Páginas de GitHub de la misma manera que se resaltan en GitHub Enterprise. Para más información sobre como enfatizar sintaxis en GitHub Enterprise, vea "Creando y resaltando bloques de código."
Por defecto, los bloques de código en su sitio serán resaltados por Jekyll. Jekyll utiliza el resaltador de Rouge, compatible con Pygments. Si especificas Pygments en tu archivo _config.yml, el Rouge se utilizará en su lugar. Jekyll no puede usar ningún otro resaltador de sintaxis, y obtendrás una advertencia de compilación de página si especificas otro en tu archivo _config.yml. Para más información, vea "Acerca de los errores de construcción de sitios Jekyll Páginas de GitHub ."
Si quieres usar otro resaltador, como highlight.js
, debes desactivar el resaltador de sintaxis de Jekyll actualizando el archivo de tu proyecto _config.yml.
kramdown:
syntax_highlighter_opts:
disable : true
If your theme doesn't include CSS for syntax highlighting, you can generate GitHub's syntax highlighting CSS and add it to your project's style.css
file.
$ rougify style github > style.css
Construyendo tu sitio localmente
Changes to your site are published automatically when the changes are merged into your site's publishing source. If you want to preview your changes first, you can make the changes locally instead of on GitHub Enterprise. Then, test your site locally. For more information, see "Testing your Páginas de GitHub site locally with Jekyll."