feat: recent posts section/partial

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

@ -171,7 +171,30 @@ article {
opacity: 0.7; 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; list-style: none;
padding-left: 0; padding-left: 0;
@ -188,6 +211,7 @@ article {
display: inline-block; display: inline-block;
margin: 0.4em 0; margin: 0.4em 0;
} }
& > li > a { & > li > a {
border-radius: 8px; border-radius: 8px;
border: var(--outlinegray) 1px solid; border: var(--outlinegray) 1px solid;
@ -200,29 +224,6 @@ article {
} }
} }
& 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 { .backlinks a {
font-weight: 600; font-weight: 600;
font-size: 0.9rem; font-size: 0.9rem;
@ -590,3 +591,5 @@ header {
padding: 0 1em; padding: 0 1em;
} }
} }

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

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

@ -4,11 +4,17 @@
<div class="section"> <div class="section">
<div class="desc"> <div class="desc">
<h3><a href="{{ .Permalink }}">{{- .Title -}}</a></h3> <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> <p>{{- .Summary -}}{{if .Truncated}}...{{end}}</p>
</div> </div>
<p class="meta"> <p class="meta">
{{ .ReadingTime }} minute read. Last updated {{if ne .Date .Lastmod}}{{ .Lastmod.Format "January 2, 2006" }}{{else}}Unknown{{end}} {{ .ReadingTime }} minute read. Last updated {{if ne .Date .Lastmod}}{{ .Lastmod.Format "January 2, 2006" }}{{else}}Unknown{{end}}
</p> </p>
</div> </div>
</li> </li>
{{- end -}} {{- 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