lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
172 stars 94 forks source link

Site default to /posts/ #176

Open t3kg33k opened 3 months ago

t3kg33k commented 3 months ago

Is it possible change the default so that visitors are presented/sent to the /posts/ first for view of the table of contents of posts?

Nice job on the theme, by the way.

ctmbl commented 3 months ago

hey to my understanding because HUGO is a static website builder the main page actually is (and will always be) index.html (located in layouts/) as described in the doc.

However I guess that you could change the code of this layoust/index.html to automatically redirect to /posts I don't know how to do such thing in HUGO but maybe that would be your way to go 👍 Hope I could help 🙁

t3kg33k commented 3 months ago

Thanks for the response. I'm not a web developer so I am a bit clueless on such things. Maybe if I can eventually figure it out from trial and error.

ctmbl commented 3 months ago

I've dig a bit because it's a subject that might interest me in the future so here is what I've found:

  1. you could use HUGO's aliases mechanism, though I don't know if assigning / (the homepage) as an alias for /posts will work, you could try
  2. I discovered that HTML meta tags could be use to perform redirects: https://discourse.gohugo.io/t/url-redirect-forwarding/4689/4 https://www.w3schools.com/tags/att_meta_http_equiv.asp

Let me know if you try and one of these work 🙂

t3kg33k commented 3 months ago

Thanks for the heads up. The more I think about it, is my idea even a good idea if I want more SEO? Or, would an alias fix that problem?

ctmbl commented 3 months ago

The more I think about it, is my idea even a good idea if I want more SEO? Or, would an alias fix that problem?

I'm not sure honestly, an alias may be best yes (if it works) but depending on the size and popularity of your website is SEO relevant? I honestly don't know