Open GorvGoyl opened 1 year ago
this site is using GH pages, and it looks like GH doesn't provide a way to redirect pages. improvements that can be done:
https://stackoverflow.com/questions/21244910/remove-html-extension-from-github-pages
tried 2 ways I could think of:
content.json
, which is responsible for mapping URL to html pages:--- a/content.json
+++ b/content.json
@@ -9,7 +9,7 @@
},
"about": {
"title": "About",
- "url": "/about.html",
+ "url": "/about",
"template": "about.html"
},
"blog": {
issue: works in dev server but doesn't work in local prod server after building output. about
page is getting generated without the .html extension. it most likely won't work after deploying to github server as pages extensions are removed.
--- a/templates/base.html
+++ b/templates/base.html
@@ -157,7 +157,7 @@
<li>
<b>Monadical</b>
</li>
- <a href="{{PAGES.blog.url}}">Blog</a>
+ <a href="{{PAGES.blog.url|replace('.html','')}}">Blog</a>
<li><a href="{{PAGES.services.url}}">Services</a></li>
issues: links won't work in dev server and local prod server after building output, but it'll work after deployment as github server maps links w/o .html at end to .html files with same name.
Currently, there are two pages generated for the same content, one with .html at the end and one without. Ideally, .html page should redirect (301) to the other one to improve SEO and content deduplication
Also need to remove .html from all internal links