Thank you for the feedback, Erich!
Your reply inspired me to look into it a little further, and learned I can use the built-in URL filter since I'm deploying to a sub-directory.
Using this, one of my links looks like this: <a href="{{ '/myFirstPost' | url }}">First Post</a>, where the | is the filter operator, and url indicates to use the url filter.
All I had to change was the formatting of those links to other posts, and add the trailing slash to the pathPrefix in .eleventy.js.
This also means I can delete _data/site.json, since there's no need to declare the pathPrefix there too.
I am going to update this mini-tutorial, thank you again!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you for the feedback, Erich!
Your reply inspired me to look into it a little further, and learned I can use the built-in URL filter since I'm deploying to a sub-directory.
Using this, one of my links looks like this:
<a href="{{ '/myFirstPost' | url }}">First Post</a>
, where the|
is the filter operator, andurl
indicates to use theurl
filter.All I had to change was the formatting of those links to other posts, and add the trailing slash to the
pathPrefix
in.eleventy.js
.This also means I can delete
_data/site.json
, since there's no need to declare the pathPrefix there too.I am going to update this mini-tutorial, thank you again!