From 6823f0580764000be963b3e79b07f6c2c9b08d09 Mon Sep 17 00:00:00 2001 From: Shivampal157 Date: Wed, 18 Mar 2026 00:15:48 +0530 Subject: [PATCH] dx: add edit links for docs and blog pages #265 Made-with: Cursor --- mkdocs.yml | 4 ++++ theme/base.html | 10 ++++++++++ theme/css/content.css | 11 +++++++++++ 3 files changed, 25 insertions(+) diff --git a/mkdocs.yml b/mkdocs.yml index 82fb95a0..40683396 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,6 +1,10 @@ site_name: Open Science Labs site_url: https://opensciencelabs.org +# Repository / edit links (used to build "Edit this page on GitHub" URLs) +repo_url: https://github.com/OpenScienceLabs/opensciencelabs.github.io +edit_uri: edit/main/ + docs_dir: pages site_dir: build diff --git a/theme/base.html b/theme/base.html index 22ee2ba2..67e4174d 100644 --- a/theme/base.html +++ b/theme/base.html @@ -373,6 +373,16 @@

{% block content_inner %} {{ page.content }} {% endblock content_inner %} + + {# Inline "Edit this page on GitHub" helper. Uses MkDocs page.edit_url. #} + {% if page.edit_url %} + + {% endif %} diff --git a/theme/css/content.css b/theme/css/content.css index e2202885..8eedf6b3 100644 --- a/theme/css/content.css +++ b/theme/css/content.css @@ -42,3 +42,14 @@ blockquote{ display: grid; place-items: center; } .to_top .icon { width: 24px; height: 24px; } + +/* "Edit this page on GitHub" helper */ +.edit-on-github { + margin-top: 1.25rem; +} +.edit-on-github .edit-link { + text-decoration: none; +} +.edit-on-github .edit-link:hover { + text-decoration: underline; +}