]> zackmdavis.net Git - An_Algorithmic_Lucidity.git/commitdiff
Markdown source link on article pages
authorZack M. Davis <code@zackmdavis.net>
Wed, 22 Jul 2026 02:29:06 +0000 (19:29 -0700)
committerZack M. Davis <code@zackmdavis.net>
Wed, 22 Jul 2026 02:29:06 +0000 (19:29 -0700)
theme/static/css/style.css
theme/templates/article.html
theme/templates/includes/post_card.html

index f19f49b52437f59a9b7d2721421746eb8f5bf1a5..5d1a5d4f763fd47c7cc7a7d033f28ed74a300c78 100644 (file)
@@ -255,6 +255,19 @@ header h1 a:hover {
     font-size: 13px;
 }
 
+.post-source-link {
+    margin-top: 10px;
+    font-size: 11px;
+}
+
+.post-source-link a {
+    color: #999;
+}
+
+.post-source-link a:hover {
+    color: #906ccf;
+}
+
 /* Sidebar */
 .sidebar {
     width: 220px;
index 017a343cbeb4c0799589755e6e3267726f7cf4c8..a6b8e021a16556fa7702e785b7e747bd1b8e64b3 100644 (file)
@@ -8,5 +8,5 @@
 {% endblock %}
 
 {% block content %}
-    {{ post_card.render_post(article) }}
+    {{ post_card.render_post(article, show_source_link=True) }}
 {% endblock %}
index b2a391a7156fdf9a330af29964d5c97b6775aa68..1338d2d1aa42bd9c3c0ae9eb5b7fe2a710b316bd 100644 (file)
@@ -1,4 +1,4 @@
-{% macro render_post(article, full=True) %}
+{% macro render_post(article, full=True, show_source_link=False) %}
 <article class="post">
     <h2 class="post-title">
         <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
@@ -18,5 +18,8 @@
     <div class="post-content">
         {{ article.content if full else article.summary }}
     </div>
+    {% if show_source_link and article.markdown_url %}
+        <p class="post-source-link"><a href="{{ SITEURL }}/{{ article.markdown_url }}">(Markdown source)</a></p>
+    {% endif %}
 </article>
 {% endmacro %}