feat: recent posts section/partial

hugo
Jacky Zhao 3 years ago
parent 0439c163a0
commit 0293c12217

@ -171,7 +171,30 @@ article {
opacity: 0.7;
}
& > .tags {
& a {
font-family: Source Sans Pro;
font-weight: 600;
&.internal-link {
text-decoration: none;
background-color: transparentize(#8f9fa9, 0.85);
padding: 0 0.1em;
margin: auto -0.1em;
border-radius: 3px;
&.broken {
opacity: 0.5;
background-color: transparent;
}
}
}
& p {
overflow-wrap: anywhere;
}
}
.tags {
list-style: none;
padding-left: 0;
@ -188,6 +211,7 @@ article {
display: inline-block;
margin: 0.4em 0;
}
& > li > a {
border-radius: 8px;
border: var(--outlinegray) 1px solid;
@ -198,29 +222,6 @@ article {
color: var(--outlinegray);
}
}
}
& a {
font-family: Source Sans Pro;
font-weight: 600;
&.internal-link {
text-decoration: none;
background-color: transparentize(#8f9fa9, 0.85);
padding: 0 0.1em;
margin: auto -0.1em;
border-radius: 3px;
&.broken {
opacity: 0.5;
background-color: transparent;
}
}
}
& p {
overflow-wrap: anywhere;
}
}
.backlinks a {
@ -590,3 +591,5 @@ header {
padding: 0 1em;
}
}

@ -5,6 +5,7 @@ enableLinkPreview: true
enableLatex: true
enableSPA: true
enableContextualBacklinks: true
enableRecentNotes: false
description:
Host your second brain and digital garden for free. Quartz features extremely fast full-text search,
Wikilink support, backlinks, local graph, tags, and link previews.

@ -15,6 +15,9 @@
<article>
{{partial "toc.html" .}}
{{partial "textprocessing.html" . }}
{{if $.Site.Data.config.enableRecentNotes}}
{{partial "recent.html" . }}
{{end}}
</article>
{{partial "footer.html" .}}
</div>

@ -4,11 +4,17 @@
<div class="section">
<div class="desc">
<h3><a href="{{ .Permalink }}">{{- .Title -}}</a></h3>
<ul class="tags">
{{ range (.GetTerms "tags") }}
<li><a href="{{ .Permalink }}">{{ .LinkTitle | title}}</a></li>
{{ end }}
</ul>
<p>{{- .Summary -}}{{if .Truncated}}...{{end}}</p>
</div>
<p class="meta">
{{ .ReadingTime }} minute read. Last updated {{if ne .Date .Lastmod}}{{ .Lastmod.Format "January 2, 2006" }}{{else}}Unknown{{end}}
</p>
</div>
</li>
{{- end -}}

@ -0,0 +1,12 @@
<div class="content-list">
<h2>Recent Notes</h2>
<!--
You can also configure this to find related pages!
All you need to pass into the "page-list.html" partial
is a collection of pages.
https://gohugo.io/content-management/related/
-->
{{$notes := .Site.RegularPages}}
{{partial "page-list.html" (first 3 $notes)}}
</div>
Loading…
Cancel
Save