DEV Community

dss99911
dss99911

Posted on • Originally published at dss99911.github.io

Jekyll Variables Usage - Site, Page, and Custom Variables

Jekyll provides powerful variable access through Liquid templating. Understanding these variables is essential for customizing your Jekyll site.

Site Variables

It's from _config.yml

  • title: {{ site.title }}
  • pages.size: {{ site.pages.size }}
  • posts.size: {{ site.posts.size }}
  • site.categories.Obsidian.size: {{ pages }}
  • site.categories.Jekyll.size: {{ site.categories.Jekyll.size }}

    • titles, excerpt `{% for j in site.categories.Jekyll %}
      • {{ j.title }}
        • {{ j.excerpt }} {% endfor %}`
  • site.data.navigation: {{ site.data.navigation }}
    `{% for item in site.data.navigation %}

Page Variables

  • Title: {{ page.title }}
  • path: {{ page.path }}
  • url: {{ page.url }}
  • variable: {{ page.page_variable }}
  • categories: {{ page.categories }}

Originally published at https://dss99911.github.io

Top comments (0)