Malanow
November 6, 2018, 12:25pm
1
Hi everyone!
I create menu (in config.toml) according to the following scheme:
[menu]
[[menu.main]]
identifier = "about"
name = "about hugo"
pre = "<i class='fa fa-heart'></i>"
url = "/about/"
weight = -110
How to create files to which the menu links, for example ‘about’. I would not want it to appear in the posts section. Hugo version 0.49
zwbetz
November 6, 2018, 2:43pm
2
Going by the URL you have listed for the menu item:
hugo new about.md
Which will create an About page at:
content/about.md
1 Like
Malanow
November 7, 2018, 11:07am
3
Yes, I understand, but I would not like this entry to be created in the list of posts. I do not know how to explain it. If you can, take a look at my test page -> http://null.malanow.net .
Two entries, “Something Old” and “Something New” are linked to the menu, at the same time, they are visible in the list of all posts. How to make them not visible in the list of all posts. I suspect that depends on the theme that was used?
zwbetz
November 7, 2018, 12:18pm
4
This theme shows the first 10 pages in index.html
– that means any page, not just posts. See the theme’s index.html
.
To change this behavior, you’d need to override the theme, i.e. make a copy of:
themes/layouts/index.html
And paste it at:
layouts/index.html
Then tweak it like:
{{ range first 10 .Data.Pages }}
{{ if eq .Type "post" }}
<div class="li-article">
{{ .Render "summary"}}
</div>
{{ end }}
{{ end }}
Depending on how the section is named in your site, "post"
may need to be "posts"
.
1 Like
That’s exactly what I wanted to achieve:0 Thank you very much!
I updated the hugo and this way it stopped working. I use the same theme all the time. Please, help good man