Skip to content

Commit e3997d0

Browse files
authored
Added citation examples, simplified citation code (cotes2020#2056)
Since the citation file and other stuff is already defined in `_config.yml`, removed them when calling `{% bibliography %}`. Also realized that `jekyll-scholar` helps in displaying only the papers cited in page, changed to use that. Signed-off-by: George Araújo <[email protected]>
1 parent feb9c9e commit e3997d0

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed

_includes/selected_papers.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
<div class="publications">
3-
{% bibliography -f {{ site.scholar.bibliography }} --group_by none --query @*[selected=true]* %}
3+
{% bibliography --group_by none --query @*[selected=true]* %}
44
</div>

_layouts/page.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ <h1 class="post-title">{{ page.title }}</h1>
1313
{{ content }}
1414
</article>
1515

16-
{%- if page.related_publications != null and page.related_publications.size > 0 -%}
17-
{% assign publications = page.related_publications | replace: ", ", "," | split: "," | join: "|" %}
16+
{%- if page.related_publications -%}
1817
<h2>References</h2>
1918
<div class="publications">
20-
{% bibliography -f {{ site.scholar.bibliography }} -q @*[key^={{ publications }}]* %}
19+
{% bibliography --cited_in_order %}
2120
</div>
2221
{%- endif %}
2322

_layouts/post.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ <h1 class="post-title">{{ page.title }}</h1>
6464
</div>
6565
</article>
6666

67-
{%- if page.related_publications != null and page.related_publications.size > 0 -%}
68-
{% assign publications = page.related_publications | replace: ", ", "," | split: "," | join: "|" %}
67+
{%- if page.related_publications -%}
6968
<h2>References</h2>
7069
<div class="publications">
71-
{% bibliography -f {{ site.scholar.bibliography }} -q @*[key^={{ publications }}]* %}
70+
{% bibliography --cited_in_order %}
7271
</div>
7372
{%- endif %}
7473

_pages/publications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ nav_order: 2
99
<!-- _pages/publications.md -->
1010
<div class="publications">
1111

12-
{% bibliography -f {{ site.scholar.bibliography }} %}
12+
{% bibliography %}
1313

1414
</div>

_posts/2023-07-12-post-bibliography.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ tags: formatting bib
77
categories: sample-posts
88
giscus_comments: true
99
related_posts: false
10-
related_publications: einstein1950meaning, einstein1905movement
10+
related_publications: true
1111
---
12-
This post shows how to add bibliography to simple blog posts. If you would like something more academic, check the [distill style post]({% post_url 2018-12-22-distill %}).
12+
This post shows how to add bibliography to simple blog posts. We support every citation style that [jekyll-scholar](https://github.com/inukshuk/jekyll-scholar) does. That means simple citation like {% cite einstein1950meaning %}, multiple citations like {% cite einstein1950meaning einstein1905movement %}, long references like {% reference einstein1905movement %} or also quotes:
13+
14+
{% quote einstein1905electrodynamics %}
15+
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
16+
sed do eiusmod tempor.
17+
18+
Lorem ipsum dolor sit amet, consectetur adipisicing.
19+
{% endquote %}
20+
21+
If you would like something more academic, check the [distill style post]({% post_url 2018-12-22-distill %}).

_projects/1_project.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: a project with a background image
55
img: assets/img/12.jpg
66
importance: 1
77
category: work
8-
related_publications: einstein1956investigations, einstein1950meaning
8+
related_publications: true
99
---
1010

1111
Every project has a beautiful feature showcase page.
@@ -44,8 +44,8 @@ To give your project a background in the portfolio page, just add the img tag to
4444
This image can also have a caption. It's like magic.
4545
</div>
4646

47-
You can also put regular text between your rows of images.
48-
Say you wanted to write a little bit about your project before you posted the rest of the images.
47+
You can also put regular text between your rows of images, even citations {% cite einstein1950meaning %}.
48+
Say you wanted to write a bit about your project before you posted the rest of the images.
4949
You describe how you toiled, sweated, *bled* for your project, and then... you reveal its glory in the next row of images.
5050

5151

0 commit comments

Comments
 (0)