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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions _includes/citation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% if page.title %}
<h2>How to cite this page</h2>
<div>
{% if page.contributors %}
{{ page.contributors | join: ", " }},
{% endif %}
"<em>{{ page.title }}</em>".
{% if 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" }}).
</div>
{% endif %}
3 changes: 3 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ <h1>{{ page.title }}
{%- endif %}
{% include affiliation-tiles-page.html %}
{% include contributor-minitiles-page.html %}
{% if page.include_citation %}
{% include citation.html %}
{% endif %}
{%- if site.theme_variables.github_buttons.position == "bottom" %}
<div id="github-buttons-wrapper" class="d-flex mt-5">
{% include github-buttons.html %}
Expand Down
3 changes: 2 additions & 1 deletion pages/documentation/page_mechanics.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ It is important to know that you can also set the these key-value pairs on multi

* `type`: The type of page, used for [website sections](website_sections).


* `include_citation`: When set to true, it will cause the citation section for the page to be generated in the format:
`<author names>. <page title> (<site name> material). Online: <page URL>. Accessed: <date>`.

### Related pages

Expand Down