How do pages get to _site, and get a url

I am a new user of Jekyll, and I’m transferring a traditional website to Jekyll. I’m familiar with Ruby, HTML, css, sass, js etc etc.

I have read the docs, and questions many times…but

I have a _pages directory, with a set of files which are either .html or .md.

I also have an index.html in the root directory. (my preference would be for it to be with all its friends in _pages. Is there a routing plugin?).

I am using the jekyll-menus plugin to generate a top-nav element, and a side nav element from a pages collection. This works for the home page. However, none of the other pages are copied to the _site, and so links to the pages fail.

This is an extract from _config.yml. If there are things here that don’t make sense, or conflict with each other, it is because I’ve copied it from somewhere that seemed to answer one of my needs.

plugins:
  - jekyll-menus

collections:
  - icons
  - links
  - packs
  - pages

defaults:
  -
    scope:
      path: '_pages' # an empty string here means all files in the project
      type: "pages"
    values:
      permalink: /:basename/
      hero: false

Thanks for clues… Anita Graham

I also have an index.html in the root directory. (my preference would be for it to be with all its friends in _pages. Is there a routing plugin?).

You can create the main page in `_pages/` and set its permalink to `/`. This is how we done in a template site:

Regarding jekyll-menus, its docs states:

The easiest way to use Jekyll Menus is to start building menus using your existing posts and pages. This can be done by adding a menus variable to your front matter:

So, you should do it that way, meaning the changes you need to do must be in the pages frontmatter themselves.