Skip to content

Commit a20dc13

Browse files
authored
Update view source link to link to the related page's source code on GitHub (#2)
1 parent 5653c32 commit a20dc13

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ Tests, build and local server commands are available from local environments.
1212

1313
Remote testing and [GitHub Pages](https://pages.github.com/) deployment can be triggered locally and is then handled remotely by a [GitHub Actions workflow](.github/workflows/release.yml).
1414

15-
### Previews of the home page
16-
17-
![Preview of the home page in dark mode](assets/docs/home-dark.png)
18-
19-
![Preview of the home page in light mode](assets/docs/home-light.png)
20-
2115
## Initial setup
2216

2317
1. Fork this repository

assets/docs/home-dark.png

-144 KB
Binary file not shown.

assets/docs/home-light.png

-143 KB
Binary file not shown.

src/layouts/page.layout.njk

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,19 @@
103103
<article>{{ content | safe }}</article>
104104

105105
<footer>
106+
{% if 'posts/' in page.src.path %}
107+
<a
108+
href="https://github.com/brendanmurty/site{% if page.src %}/blob/main/content{{ page.src.path }}{{ page.src.ext }}{% endif %}"
109+
>
110+
View post content on GitHub
111+
</a>
112+
{% else %}
106113
<a
107114
href="https://github.com/brendanmurty/site"
108-
title="View this website's code via the public GitHub repository">
109-
View source
115+
>
116+
View source code on GitHub
110117
</a>
118+
{% endif %}
111119
</footer>
112120
</section>
113121
</body>

0 commit comments

Comments
 (0)