Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] _index.md worked fine with other theme/hugo version, not now #847

Open
mfioretti opened this issue Aug 26, 2023 · 2 comments
Open
Labels
bug Something isn't working

Comments

@mfioretti
Copy link

Describe the bug

I have an _index.md file in a subfolder that worked just fine with an older hugo version, and the the academic theme. It dows not work anymore with the LoveIt theme and newer Hugo, and I cannot figure out whether the problem it's the theme or the version, so thanks a lot for your help:

Expected behavior

I have a file _index.md in a folder called writings:

/writings/_index.md

That file (see screenshot) contains a paragraph of constant, custom text ("My most important writings include..."), to display before listing all the other posts in the writings subfolder. This is exactly what happens with the old theme (see screenshots). But now, using LoveIt, it does not happen anymore. I have checked documentation like this, but honestly cannot recognize where the problem is, or why something like this, that works perfectly with one theme does not work with the other.

Thanks in advance for any help!

Screenshots

Before

This is how the page /writings/index.html looks like when using v0.56.1-0AD218AF linux/amd64 and the academic theme (i.e. it does show "My most important writings etc..." before listing the single posts in that subfolder):

Selection_002

Now

And this is same _index.md as rendered with LoveIt and current hugo, see version below. As you can see, there is no more the initial text, just the list of writings, sorted by year:

Selection_001

Build Environment

hugo v0.92.2+extended linux/amd64 BuildDate=2023-01-31T11:11:57Z VendorInfo=ubuntu:0.92.2-1ubuntu0.1

Browser: Firefox (but it's irrelevant, the text isn't in the HTML file at all)

@mfioretti mfioretti added the bug Something isn't working label Aug 26, 2023
@liaobinbin
Copy link

liaobinbin commented Aug 29, 2023

</h2>
{{- /* Categories Page */ -}}
{{- if eq $taxonomies "categories" -}}

You should add {{ .Content }} on line 15. This file is for the categories page.

<h2 class="single-title animate__animated animate__pulse animate__faster">
{{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" -}}
</h2>
{{- /* Paginate */ -}}
{{- if .Pages -}}
{{- $pages := .Pages.GroupByDate "2006" -}}
{{- with .Site.Params.section.paginate | default .Site.Params.paginate -}}

And this file is for the post page. You can code it up to line 11.

_index.md file will be work.

I'm just giving you some examples. You should find all the locations you want and modify them.

Reference: https://bwaycer.github.io/hugo_tutorial.hugo/content/using-index-md/

@mfioretti
Copy link
Author

Thanks @liaobinbin , that was very useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants