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 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
page_citation
  • Loading branch information
bedroesb committed Jan 24, 2025
commit 8d4f31b31b68e7518705fa38e2bbdda474dd2915
6 changes: 3 additions & 3 deletions _includes/citation.html → _includes/citation-page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if page.title %}
{% if page.page_citation and page.title %}
<h2>How to cite this page</h2>
<div>
<p>
{% if page.contributors %}
{{ page.contributors | join: ", " }},
{% endif %}
Expand All @@ -10,7 +10,7 @@ <h2>How to cite this page</h2>
{% endif %}
{% assign page_url = page.url | absolute_url %}
<a href="{{ page_url }}">{{ page_url }}</a> <span id="current_date"></span>.
</div>
</p>
{% endif %}

<script>
Expand Down
4 changes: 1 addition & 3 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ <h1>{{ page.title }}
{%- endif %}
{% include affiliation-tiles-page.html %}
{% include contributor-minitiles-page.html %}
{% if page.include_citation %}
{% include citation.html %}
{% endif %}
{% include citation-page.html %}
{%- if site.theme_variables.github_buttons.position == "bottom" %}
<div id="github-buttons-wrapper" class="d-flex mt-5">
{% include github-buttons.html %}
Expand Down
2 changes: 1 addition & 1 deletion pages/documentation/page_mechanics.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ 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:
* `page_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