Skip to content

Commit 8fc0c51

Browse files
committed
fix: Don’t offer Markdown equivalents of HTML pages
1 parent b552a26 commit 8fc0c51

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

_layouts/page.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212

1313
<h1 elementtiming="page-title">{{ page.title }}</h1>
1414

15-
{% assign markdown_source = site.markdown_source_base | append: page.path %}
16-
<p class=hide><a href="{{ markdown_source }}">View this page as Markdown.</a></p>
15+
{% if page.path contains ".md" %}
16+
<p class=hide><a href="{{ site.markdown_source_base }}{{ page.path }}">View this page as Markdown.</a></p>
17+
{% endif %}
18+
1719

1820
{{ content }}
1921

_layouts/post.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ <h1 itemprop="name headline" elementtiming=page-title style="view-transition-na
3838

3939
<p class=hide>Written by <b itemprop=author>Harry Roberts</b> on <b itemprop=publisher>CSS Wizardry</b>.</p>
4040

41-
{% assign markdown_source = site.markdown_source_base | append: page.path %}
42-
<p class=hide><a href="{{ markdown_source }}">View this page as Markdown.</a></p>
41+
{% if page.path contains ".md" %}
42+
<p class=hide><a href="{{ site.markdown_source_base }}{{ page.path }}">View this page as Markdown.</a></p>
43+
{% endif %}
4344

4445
{% if page.case-study != true %}
4546

0 commit comments

Comments
 (0)