I deployed a static Jekyll site on DO App Platform. The site has a number of pages and subpages like /product, /product/product1, /product/product2 etc.
The problem: while the /product page and other top-level pages render great, /product/product1 returns 404 on DigitalOcean app platform, while it works great in local testing.
The permalink is specified like this in
product/product1.md YAML front matter:
I should also note that I didn’t use the DO example project to set up the Jekyll project. DO autogenerated everything when I just pointed it to my Jekyll project branch on Github. Everything else seems to work great, just having a problem with some specific subpages.
Is there anything I need to change in my project to get the subpages to render correctly and not return 404?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $200 of credit to try our products over 60 days!
bundle exec jekyll build, is
If that is the case, what’s happening is that when App Platform gets a request for
/product/product1, it looks for either a file named exactly
product/product1/index.html—none of which exist.
/product/product1.htmlis something that we’re considering however it is not supported yet.
One solution could be to rename the subpages from
product/product1/index.md. This will generate files like
/product/product1/index.htmlwhich will work with App Platform. Or, you could run a bash script after
jekyll buildthat goes around and relocates subpages to
index.htmlfiles under subdirectories.
The other option is to deploy the site as a Service instead of a Static Site. I realize this isn’t very ideal but the built-in Jekyll webserver should be able to handle the permalinks properly without making any changes to the source.
Thank you. Your answer put me on the right track, and I got it fixed. You are right, that
/product/product1was generated as
/product/product1.htmlin the site output. The fix for me was to update the permalinks in the metadata of each page so that instead of
permalink: "/product/product1", I would have
permalink: "/product/product1/"(one slash added). This made them generated as /product/product1/index.html, so that /product/product1 link (with or without the slash) also works now.