From 33032c489526d4f0143e1f00f16c6c8300821084 Mon Sep 17 00:00:00 2001
From: Dean Attali
Date: Thu, 7 Jul 2022 18:00:37 +0000
Subject: [PATCH] add 'edit this page' button; closes #1004
---
CHANGELOG.md | 1 +
_config.yml | 3 +++
_includes/footer.html | 6 ++++++
3 files changed, 10 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6dedd61..92af841 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
## Unreleased version
- Added `post_search` config setting that creates a Search button in the navbar (older websites need to set `post_search: true` to enable this feature) (#770)
+- Added `edit_page_button` config setting that adds a "Edit page" button to the footer (to edit the current page on GitHub) (#1004)
- BREAKING CHANGE: More control over RSS feed sharing: previously, an RSS feed was *always* generated, and if the config setting `rss-description` was set then there was an RSS icon in the footer. Now, an RSS feed is only generated when the config setting `rss-description` exists, and an RSS footer icon is only shown if `rss: true` is set in the `social-network-links` config settings
- Fixed page titles, subtitles, and excerpts rendering correctly when there are special characeters in them (#856)
- Slightly reworked margins and position for avatar image to resolve an alignment issue on Safari.
diff --git a/_config.yml b/_config.yml
index 9ea0b4a..6fb8433 100644
--- a/_config.yml
+++ b/_config.yml
@@ -96,6 +96,9 @@ feed_show_tags: true
# Add a search button to the navbar
post_search: true
+# Add a button in the footer to edit the current page. Only works if your website is hosted on GitHub
+edit_page_button: true
+
# The keywords to associate with your website, for SEO purposes
#keywords: "my,list,of,keywords"
diff --git a/_includes/footer.html b/_includes/footer.html
index 8fb0e7e..66d8555 100644
--- a/_includes/footer.html
+++ b/_includes/footer.html
@@ -30,6 +30,12 @@
Do-not-Track
{% endif %}
{% endif%}
+
+ {% if site.edit_page_button and site.github.repository_url %}
+ •
+ Edit page
+ {% endif%}
+
{% unless site.remove-ads %}
Powered by