Search code examples
yamljekyll

How to get "_pages" referenced at the site root in Jekyll?


I have Jekyll site hosted on GitHub Pages. The file _config.yml has this content (excerpt):

# Defaults
defaults:
  # _pages
  - scope:
      path: "_pages"
      type: "pages"
    values:
      layout: "single"
      read_time: true

So when the site is built, I can open a page by its URL like this: https://repo.github.io/_pages/some-page/

I read all the docs for Jekyll but it is not clear to me how to turn this URL to be https://repo.github.io/some-page/ or maybe https://repo.github.io/pages/some-page/.


Solution

  • For eg. https://repo.github.io/some-page, you can put in _pages and config as such:

    collections:
      pages:
        output: true
        permalink: /:name