Search code examples
variablesjekyllgithub-pages

Variables available when building static sites using jekyll and github pages


When building a website using github pages and jekyll, we can use variable like site.github.repository_name etc. Where these variables values are furnished by github pages when building the site. But I cannot find a comprehensive list of these variables in either documentation for github pages nor in pages about github pages in jekyll documentation.

I have already checked in


Solution

  • GitHub Pages use some plugins that are enabled by default and cannot be disabled. One of them is jekyll-github-metadata.

    Which, as stated in the description:

    • Propagates the site.github namespace with repository metadata
    • Sets site.title as the repository name, if none is set
    • Sets site.description as the repository tagline if none is set
    • Sets site.url as the GitHub Pages domain (cname or user domain), if none is set
    • Sets site.baseurl as the project name for project pages if none is set

    site.github.repository_name comes from the repository metadata mentioned above, along with site.github.wiki_url and lots of other stuff.