mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 04:35:31 -04:00
link View Source in page/post footers to specific file on GitHub
This commit is contained in:
@@ -1,7 +1,19 @@
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{ if and .IsPage (eq .Type .Site.Params.mainSection) }}
|
||||
|
||||
{{ if and .IsPage (eq .Type .Site.Params.mainSection) -}}
|
||||
{{- with .OutputFormats.Get "amp" -}}
|
||||
<link rel="amphtml" href="{{ .Permalink }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
<link rel="author" href="{{ "humans.txt" | absURL }}">
|
||||
|
||||
{{/* if this is a page/post, link View Source to specific file on GitHub. otherwise, just link to repo homepage. */}}
|
||||
{{- with .Site.Params.githubRepo }}
|
||||
{{- $githubURL := printf "https://github.com/%s" . }}
|
||||
{{- if not $.IsPage }}
|
||||
{{- $.Scratch.Set "sourceURL" $githubURL }}
|
||||
{{- else }}
|
||||
{{- $.Scratch.Set "sourceURL" (printf "%s/blob/main/content/%s" $githubURL $.File.Path) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
Reference in New Issue
Block a user