Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'how to cite this page' section to page layout #315

Merged
merged 11 commits into from
Feb 7, 2025
Prev Previous commit
Next Next commit
Fix current date with java script in citation section
  • Loading branch information
anenadic authored Jan 24, 2025
commit ade7049dbb87b89ee13fb33af628360488518c5a
11 changes: 8 additions & 3 deletions _includes/citation.html
Original file line number Diff line number Diff line change
@@ -2,13 +2,18 @@
<h2>How to cite this page</h2>
<div>
{% if page.contributors %}
{{ page.contributors | join: ", " }},
{{ page.contributors | join: ", " }},
{% endif %}
"<em>{{ page.title }}</em>".
{% if site.url %}
{{ site.url }}.
{{ site.url }}.
{% endif %}
{% assign page_url = page.url | absolute_url %}
<a href="{{ page_url }}">{{ page_url }}</a> (accessed {{ site.time | date: "%d %B, %Y" }}).
<a href="{{ page_url }}">{{ page_url }}</a> <span id="current_date"></span>.
</div>
{% endif %}

<script>
var current_date = new Date().toLocaleDateString('en-uk', { year:"numeric", month:"long", day:"numeric"})
document.getElementById("current_date").textContent = "(accessed " + current_date + ")";
</script>