I’m listing my blog entries on my home page. I’d like to have article.md appear on my site as ryanwwest.com/article/, not ryanwwest.com/posts/article/ ( I want to essentially replace the homepage with /posts then eliminate /posts). I’ve been able to list my content on the homepage with some changes in layouts/partials and by placing all my blog markdown directly into content/.
While the blog entries render and are served, they don’t show tag, date information anymore (and I assume Giscus will also not work when I add it). Does anyone know how I can fix this?
Thanks, I tried adding this to my config.toml by adding
[permalinks]
posts = '/'
I didn’t notice an effect but I’m guessing that’s because I already modified the partials to display list.html instead of home.html, so I my list of articles there to begin with.
I think we would need to the project repository.
Not sure if I understood you; are you saying this (serving taxonomy information on blog posts from the root folder) isn’t currently supported by Hugo?
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
1) The content directory does not contain a posts directory. So I’m not sure what you want.
2) You should consider creating a .gitignore file for:
public/
node_modules/
3) In your site configuration:
The baseURL should be that of your live site (e.g., https://example.org/). Note the trailing slash.
There is rarely a good reason to set relativeurls = true
Replace the pygments settings with the relevant settings from the documentation, though the defaults are fine in most cases. We haven’t used pygments in many years.
The content directory does not contain a posts directory
Thanks, this was my problem. I removed it in an earlier effort to get posts to be displayed, but without the permalink it wasn’t the right way to go. Now it is working.
And thanks for the other helpful advice, I’ll work on implementing it. With regards to baseURL, the reason I use it is to develop locally and on a remote private server I own via Tailscale (and also host the site on my public hosting box), and have the site work on all three - when I’ve put my full site name there, it begins loading remote content from the public version of my site on my local instance.