From f16f2b6d8ab9b50a7389f41b1b606cd448f10149 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sun, 7 Nov 2021 16:39:17 -0600 Subject: [PATCH] Customizable View source icon --- exampleSite/config.yaml | 5 +++-- layouts/partials/post-metadata.html | 11 ++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 398a473..cd0d4d0 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -27,8 +27,9 @@ params: wordcount: true readingtime: true - # used for "View history" - historyURL: https://github.com/BBaoVanC/bobatheme/commits/master + # used for "View source" + gitFileURL: https://github.com/BBaoVanC/bobatheme/blob/master + gitFileIcon: github-circle privacy: googleAnalytics: diff --git a/layouts/partials/post-metadata.html b/layouts/partials/post-metadata.html index b539638..994f0df 100644 --- a/layouts/partials/post-metadata.html +++ b/layouts/partials/post-metadata.html @@ -60,11 +60,16 @@ {{ end }} - {{ with .Site.Params.historyURL }} + {{ with .Site.Params.gitFileURL }} - {{ partial "icon.html" "history" }} + {{ with $.Site.Params.gitFileIcon }} + {{ partial "icon.html" . }} + {{ else }} + {{ partial "icon.html" "file" }} + {{ end }} + - View history + View source {{ end }}