Open paul-hammant opened 3 years ago
@paul-hammant the navbar component pulls in the actual URL for the file when generating. Although leaving off the .html works on GitHub Pages, it isn't guaranteed to work on other servers, just depends on the configuration. I think what you are looking for is a "pretty url" style permalink--that way the pages will actually be generated with pretty URL rather than just leaving off the file extension--this avoids issues with different servers, etc.
The permalink is a Jekyll option, set in _config.yml . If you look at the bottom of your _config.yml you will find that in the template it looks like:
#######
# Defaults
# to simplify front matter
# all files in the "pages" folder will be output at root of site
defaults:
- scope:
path: "pages"
values:
layout: page
permalink: /:basename:output_ext
To get pretty urls you will need to do two things:
permalink: /:basename:output_ext
to permalink: /:basename/
.permalink: /
(if you don't your home page will end up at /index/ which won't work as expected)Thanks for link to your timeline site--looking good!
Just to clarify what that does technically:
the file "pages/example.md" with permalink: /:basename:output_ext
will be output as the file /example.html
; with permalink: /:basename/
it will be output as /example/index.html
.
The second option is a "pretty url" pattern. This allows users to access the page at example.com/example , example.com/example/ , or example.com/example/index.html on any server.
I will look at maybe changing the default template to pretty urls.
See https://its-airborne.org/
Click "Early Masking Countries"
Note the URL is https://its-airborne.org/early-masking-countries.html
The URL still works as https://its-airborne.org/early-masking-countries
The URL is better the second way. Could we have a _config option to allow the choice, please?