Comments (5)
To remove the list from the homepage, in hugo-xmin/layouts/_default/list.html , try :
<ul>
{{ $pages := .Pages }}
{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
{{ if not .IsHome}} <!-- add this line -->
{{ range (where $pages "Section" "!=" "") }}
<li>
<span class="date">{{ .Date.Format "2006/01/02" }}</span>
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
{{ end }} <!-- add this line -->
</ul>
from hugo-xmin.
Sorry, I don't have time to answer your specific questions, but this theme has been explained line-by-line in the blogdown book: https://bookdown.org/yihui/blogdown/templates.html
from hugo-xmin.
Here's small hack to get rid of it completely (option 3 in @zayuim original list)
- create a file layouts/_default/list.html that comments out the loop, if you're on the home page:
{{ partial "header.html" . }}
{{if not .IsHome }}
<h1>{{ .Title | markdownify }}</h1>
{{ end }}
{{ .Content }}
{{if not .IsHome }}
<ul>
{{ range (where .Data.Pages "Section" "!=" "") }}
<li>
<span class="date">{{ .Date.Format "2006/01/02" }}</span>
<a href="{{ .URL }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ partial "footer.html" . }}
One thing I don't understand: How does Hugo decide which template to use, for each page? For example, how did Hugo decide that the first page would use the list.html template?
from hugo-xmin.
I am also looking to figure this out!
from hugo-xmin.
@hongtaoh Thanks, I'll close the thread now.
from hugo-xmin.
Related Issues (20)
- stop drafts from showing up under sections
- Jump to next post HOT 2
- Unable to get syntax highlighting to work
- search box HOT 1
- Images on landing page no longer rendering? HOT 8
- where is the config.toml file HOT 3
- 能加个markdown toc的导航菜单实现吗 HOT 6
- 好喜欢这个主题! HOT 2
- Where to put a favicon? HOT 3
- Feature request: Last modified date HOT 2
- Broken Link to A.Hill Tutorial HOT 1
- Feature request: description tags on individual pages HOT 1
- 能改一下代码高亮格式吗? HOT 2
- 静态托管问题
- inline footnotes no longer working HOT 2
- What is the difference between a "note" and a "post"? HOT 1
- The generated sitemap.xml has errors HOT 1
- Support dark mode HOT 1
- Add direct link to demosite on themes.gohugo.io HOT 1
- Please change the default baseURL HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-xmin.