{{ if and .IsPage (eq .Type .Site.Params.mainSection) -}} {{- with .OutputFormats.Get "amp" -}} {{- end -}} {{- end }} {{/* 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 }}