From 8d81f5e37cc190792faaa8140717f15d096dfe26 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sun, 8 May 2022 16:13:46 -0500 Subject: [PATCH] Replace "View source" with "Edit history" --- assets/css/bobastyle.css | 2 +- exampleSite/config.yaml | 1 + i18n/en.yaml | 7 +++++-- i18n/es.yaml | 7 +++++-- layouts/partials/post-meta-item/edithistory.html | 8 ++++++++ layouts/partials/post-meta-item/viewsource.html | 13 ------------- layouts/partials/post-metadata/full.html | 2 +- layouts/partials/post-metadata/series.html | 3 --- 8 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 layouts/partials/post-meta-item/edithistory.html delete mode 100644 layouts/partials/post-meta-item/viewsource.html diff --git a/assets/css/bobastyle.css b/assets/css/bobastyle.css index f9362fe..7b9420f 100644 --- a/assets/css/bobastyle.css +++ b/assets/css/bobastyle.css @@ -766,7 +766,7 @@ li.disabled > .page-link:hover { @media print { .top, .section-header-link, - .post-meta-view-source, + .post-meta-edit-history, .prevnext, .share-buttons, .related-posts, diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index dc7e2bf..b72a831 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -30,6 +30,7 @@ params: # used for "View source" (unset by default) # gitFileURL: https://github.com/BBaoVanC/bobatheme/blob/master # gitFileIcon: github-circle + # gitHistoryURL: https://github.com/BBaoVanC/bobatheme/commits/master # display a "Latest Posts" section on the homepage below its content homepageLatestPosts: true diff --git a/i18n/en.yaml b/i18n/en.yaml index b5c808c..7a80aa0 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -27,6 +27,9 @@ readingtime: one: "{{ . }} min" other: "{{ . }} mins" +edit_history: + other: "Edit history" + # Post count no_posts: @@ -61,8 +64,8 @@ aria_back_to_top_button: aria_rss_link: other: "RSS feed link" -aria_post_meta_view_source: - other: "link to page source" +aria_post_meta_edit_history: + other: "link to page edit history" aria_post_meta_translations: other: "translations" diff --git a/i18n/es.yaml b/i18n/es.yaml index 1d64dcf..84cf142 100644 --- a/i18n/es.yaml +++ b/i18n/es.yaml @@ -27,6 +27,9 @@ readingtime: one: "{{ . }} min" other: "{{ . }} mins" +edit_history: + other: "Historial de cambios" + # Post count no_posts: @@ -61,8 +64,8 @@ newer_post: # aria_rss_link: # other: "RSS feed link" -# aria_post_meta_view_source: -# other: "link to page source" +# aria_post_meta_edit_history: +# other: "link to page edit history" # aria_post_meta_translations: # other: "translations" diff --git a/layouts/partials/post-meta-item/edithistory.html b/layouts/partials/post-meta-item/edithistory.html new file mode 100644 index 0000000..e24b973 --- /dev/null +++ b/layouts/partials/post-meta-item/edithistory.html @@ -0,0 +1,8 @@ +{{ if and .Site.Params.gitHistoryURL .File.Path }} + + {{ partial "icon.html" "history" }} + + {{- i18n "edit_history" -}} + + +{{ end }} diff --git a/layouts/partials/post-meta-item/viewsource.html b/layouts/partials/post-meta-item/viewsource.html deleted file mode 100644 index 667a041..0000000 --- a/layouts/partials/post-meta-item/viewsource.html +++ /dev/null @@ -1,13 +0,0 @@ -{{ if and .Site.Params.gitFileURL .File.Path }} - - {{ with .Site.Params.gitFileIcon }} - {{ partial "icon.html" . }} - {{ else }} - {{ partial "icon.html" "file" }} - {{ end }} - - - View source - - -{{ end }} diff --git a/layouts/partials/post-metadata/full.html b/layouts/partials/post-metadata/full.html index a6ce14c..d452490 100644 --- a/layouts/partials/post-metadata/full.html +++ b/layouts/partials/post-metadata/full.html @@ -24,7 +24,7 @@ {{ partial "post-meta-item/authors.html" . }} {{ partial "post-meta-item/translations.html" . }} {{ partial "post-meta-item/readingtime.html" . }} - {{ partial "post-meta-item/viewsource.html" . }} + {{ partial "post-meta-item/edithistory.html" . }} {{ partial "post-meta-item/categories.html" . }} {{ partial "post-meta-item/tags.html" . }} diff --git a/layouts/partials/post-metadata/series.html b/layouts/partials/post-metadata/series.html index 5779e7d..c722dfa 100644 --- a/layouts/partials/post-metadata/series.html +++ b/layouts/partials/post-metadata/series.html @@ -16,7 +16,4 @@ {{ end }} {{ partial "post-meta-item/translations.html" . }} - {{ if .File }} - {{ partial "post-meta-item/viewsource.html" . }} - {{ end }}