Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 2.01 KB

HowURLsAreCreated.md

File metadata and controls

30 lines (22 loc) · 2.01 KB

How Are URLs Created?

Understanding how content URLs are generated by Jekyll is critical to preventing build errors. Here's how it works.

  • Everything but the experience blog is powered by a Jekyll collection
  • Jekyll collections are directories/folders that begin with an underscore: for example _vre, _education, and _playbook. IMPORTANT: Not every folder in the repo that begins with an underscore is a collection.
  • Collection URLs are configured by _config.yml
  • Collection paths are based on the Markdown file paths.
  • Each Markdown file generates a corresponding directory and index.html file. For example:
    • _education/tools-programs.md/education/tools-programs/index.html
    • _education/tools-programs.md/education/tools-programs/index.html
    • _education/work-learn/non-traditional.md_education/work-learn/non-traditional/index.html
  • Each output directory is also used to create a breadcrumb on that page. For example, _vre/family/family-members.md will create a breadcrumb with the following markup:
<ul class="breadcrumbs" role="menubar" aria-label="Primary">
  <li class="parent">&lt;a href="/vre/">VR&amp;E&lt;/a></li>
  <li class="parent">&lt;a href="/vre/family/">Family&lt;/a>&lt;/li>
  <li class="active">Family Members&lt;/li>
</ul>

And read VR&E > Family > Family Members.

IMPORTANT

Make sure that every collection sub-directory also has a Markdown file that shares its name. Take the the _employment/job-seekers/ directory as an example. It also has an _employment/job-seekers.md file. Each Markdown file in _employment/job-seekers/ compiles to employment/jobs-seekers/name_of_markdown_file/index.html, while _employment/job-seekers.md itself compiles to employment/job-seekers/index.html.

Failing to take the above step means that you could generate breadcrumbs to pages that do not exist. This can cause your tests to fail.