Closed mluce194 closed 3 years ago
You can add url
filter to all urls in the template files, then use the pathPrefix
configuration.
I'm working on making this easier right now, so hold on a second.
Do you use Github Pages or something simillar?
Ok done!
All you need to do is uncomment this line inside eleventy.config.js
and change subfolder
with your subfolder name.
return {
dir: {
input: "src",
output: "dist"
},
// pathPrefix: "/subfolder/",
templateFormats: ["md", "njk", "html"],
dataTemplateEngine: "njk",
markdownTemplateEngine: "njk"
}
Also, don't forget to include the subfolder name after domain in site.url
data here. For example: https://your-website.com/subfolder
.
Thank you very much!
It is much better with the fixes you applied. My only issue is for images inside posts. The image url is the same whether on the posts list on on the post page itself, which means that the image does not load inside the post. You can see the result here: http://styles-bijoux.com/blog/ On the list of posts, the images are fine but when I click on one of them and get inside the post, the image is not visible because the path is wrong. I think I am missing something regarding the url filter but I do not know what... Thank you very much for your help!
Please create a new issue so others facing the same problem can be helped 😃
Hello, This template works fine locally but when I try to upload the content of the dist folder to a server, it does not look good because all the paths are wrong. I realized it is because I uploaded the files to a subfolder (not the root server). Is there a way to put relative paths in the built site instead of root paths?