Add GitHub "edit" button (#157)

This commit is contained in:
rphla 2022-07-06 06:39:29 +08:00 committed by GitHub
parent 1d5530e22f
commit d279c1c805
3 changed files with 7 additions and 1 deletions

View File

@ -9,6 +9,8 @@ enableSPA: true
enableFooter: true enableFooter: true
enableContextualBacklinks: true enableContextualBacklinks: true
enableRecentNotes: false enableRecentNotes: false
enableGitHubEdit: false
GHlink: https://github.com/jackyzha0/quartz/tree/hugo/content
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.

View File

@ -15,7 +15,8 @@
<article> <article>
{{if .Title}}<h1>{{ .Title }}</h1>{{end}} {{if .Title}}<h1>{{ .Title }}</h1>{{end}}
<p class="meta"> <p class="meta">
Last updated {{if ne .Date .Lastmod}}{{ .Lastmod.Format "January 2, 2006" }}{{else}}Unknown{{end}} Last updated {{if ne .Date .Lastmod}}{{ .Lastmod.Format "January 2, 2006" }}{{else}}Unknown{{end}}.
{{ partial "github.html" . }}
</p> </p>
<ul class="tags"> <ul class="tags">
{{ range (.GetTerms "tags") }} {{ range (.GetTerms "tags") }}

View File

@ -0,0 +1,3 @@
{{if $.Site.Data.config.enableGitHubEdit}
<a href="{{$.Site.Data.config.GHlink}}/{{ .Path}}" rel="noopener">Edit Source</a>
{{end}}