add multi-section support
This commit is contained in:
parent
c078c22ea3
commit
5b7390b5c2
|
@ -51,9 +51,15 @@ pre = "Theme <a href=\"https://cgit.leafee98.com/hugo-theme-flat.git\">hugo-them
|
||||||
|
|
||||||
|
|
||||||
[[menus.main]]
|
[[menus.main]]
|
||||||
name = "Archives"
|
name = "Posts"
|
||||||
url = "/posts/"
|
url = "/posts/"
|
||||||
weight = 30
|
weight = 30
|
||||||
|
|
||||||
|
[[menus.main]]
|
||||||
|
name = "Essays"
|
||||||
|
url = "/essays/"
|
||||||
|
weight = 40
|
||||||
|
|
||||||
[[menus.main]]
|
[[menus.main]]
|
||||||
pageref = "about"
|
pageref = "about"
|
||||||
name = "About"
|
name = "About"
|
||||||
|
|
17
exampleSite/content/essays/What-Is-Hugo.md
Normal file
17
exampleSite/content/essays/What-Is-Hugo.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
title: "What Is Hugo"
|
||||||
|
date: 2022-05-16T21:57:50+08:00
|
||||||
|
tags: []
|
||||||
|
categories: []
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
Hugo is a static site generator written in Go. Originally created by Steve Francia in 2013, Hugo has seen a great increase in both features and performance thanks to current lead developer Bjørn Erik Pedersen (since v0.14 in 2015[4]) and other contributors. Hugo is an open source project licensed under the Apache License 2.0.[5]
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
Being able to generate most websites within seconds (at < 1 ms per page), Hugo's official website states it is "the world’s fastest framework for building websites". In July 2015, Netlify began providing Hugo hosting,[6] and in 2017, Smashing Magazine completed its redesign of their website, migrating from WordPress to a JAMstack solution with Hugo.[7]
|
||||||
|
|
||||||
|
> Source: https://en.wikipedia.org/wiki/Hugo_(software)
|
||||||
|
>
|
||||||
|
> License: [CC-BY-SA 3.0](https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License)
|
10
exampleSite/content/essays/_index.md
Normal file
10
exampleSite/content/essays/_index.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
title: "Essays"
|
||||||
|
date: 2022-05-18T11:19:08+08:00
|
||||||
|
tags: []
|
||||||
|
categories: []
|
||||||
|
weight: 70
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--more-->
|
10
exampleSite/content/posts/_index.md
Normal file
10
exampleSite/content/posts/_index.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
title: "Posts"
|
||||||
|
date: 2022-05-18T11:22:44+08:00
|
||||||
|
tags: []
|
||||||
|
categories: []
|
||||||
|
weight: 30
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--more-->
|
|
@ -12,7 +12,9 @@
|
||||||
{{ block "main" . }}{{ end }}
|
{{ block "main" . }}{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="side">
|
<div class="side">
|
||||||
{{ partial "side-recent.html" . }}
|
{{ range .Site.Sections }}
|
||||||
|
{{ partial "side-recent.html" . }}
|
||||||
|
{{ end }}
|
||||||
{{ partial "side-categories.html" . }}
|
{{ partial "side-categories.html" . }}
|
||||||
{{ partial "side-tags.html" . }}
|
{{ partial "side-tags.html" . }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<div class="side-recent">
|
<div class="side-recent">
|
||||||
<h2 class="side-title">Recent Posts</h2>
|
<h2 class="side-title">Recent {{ .Section | humanize }}</h2>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{{ range first 5 (where .Site.RegularPages ".Type" "in" .Site.Params.MainSections).ByDate.Reverse }}
|
{{ range first 5 .RegularPages.ByDate.Reverse }}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in a new issue