Giter VIP home page Giter VIP logo

Comments (2)

GorvGoyl avatar GorvGoyl commented on August 22, 2024

this site is using GH pages, and it looks like GH doesn't provide a way to redirect pages.
improvements that can be done:

  • remove .html pages from all internal links
  • remove .html from canonical tag URL
    screenshot 2022-08-10 at 23 27 47@2x

https://stackoverflow.com/questions/21244910/remove-html-extension-from-github-pages

from monadical.com.

GorvGoyl avatar GorvGoyl commented on August 22, 2024

tried 2 ways I could think of:

  1. remove .html from 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.

  1. replace .html from links using jinja2 replace filter
--- 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.
screenshot 2022-08-23 at 01 17 07@2x

from monadical.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.