diff --git a/_includes/footer.html b/_includes/footer.html
index e799f91..a029c35 100755
--- a/_includes/footer.html
+++ b/_includes/footer.html
@@ -3,8 +3,9 @@
{%- assign first_page = site.pages | where_exp: 'p','p.paginated == true' | sort: 'path' | first -%}
{%- assign edit_link = edit_link | replace: page.path, first_page.path -%}
{%- endif -%}
-{%- if page.source_path -%}
- {%- assign edit_link = edit_link | replace: page.path, page.source_path -%}
+{%- if page.source_path or layout.source_path -%}
+ {%- assign source_path = page.source_path | default: layout.source_path %}
+ {%- assign edit_link = edit_link | replace: page.path, source_path -%}
{%- endif -%}