Skip to content

Commit

Permalink
Support for bibliography in blog posts and projects (alshedivat#1553)
Browse files Browse the repository at this point in the history
Implemented alshedivat#1193

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
  • Loading branch information
george-gca authored Jul 12, 2023
1 parent 2720a5a commit 5624a26
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 7 deletions.
8 changes: 8 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@ <h1 class="post-title">{{ page.title }}</h1>
{{ content }}
</article>

{%- if page.related_publications != null and page.related_publications.size > 0 -%}
{% assign publications = page.related_publications | replace: ", ", "," | split: "," | join: "|" %}
<h2>References</h2>
<div class="publications">
{% bibliography -f {{ site.scholar.bibliography }} -q @*[key^={{ publications }}]* %}
</div>
{%- endif %}

</div>
8 changes: 8 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ <h1 class="post-title">{{ page.title }}</h1>
</div>
</article>

{%- if page.related_publications != null and page.related_publications.size > 0 -%}
{% assign publications = page.related_publications | replace: ", ", "," | split: "," | join: "|" %}
<h2>References</h2>
<div class="publications">
{% bibliography -f {{ site.scholar.bibliography }} -q @*[key^={{ publications }}]* %}
</div>
{%- endif %}

{%- if site.related_blog_posts.enabled -%}
{%- if page.related_posts == null or page.related_posts -%}
{% include related_posts.html %}
Expand Down
2 changes: 1 addition & 1 deletion _posts/2015-03-15-formatting-and-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: march & april, looking forward to summer
tags: formatting links
categories: sample-posts
---
Jean shorts raw denim Vice normcore, art party High Life PBR skateboard stumptown vinyl kitsch. Four loko meh 8-bit, tousled banh mi tilde forage Schlitz dreamcatcher twee 3 wolf moon. Chambray asymmetrical paleo salvia, sartorial umami four loko master cleanse drinking vinegar brunch. <a href="https://www.pinterest.com">Pinterest</a> DIY authentic Schlitz, hoodie Intelligentsia butcher trust fund brunch shabby chic Kickstarter forage flexitarian. Direct trade <a href="https://en.wikipedia.org/wiki/Cold-pressed_juice">cold-pressed</a> meggings stumptown plaid, pop-up taxidermy. Hoodie XOXO fingerstache scenester Echo Park. Plaid ugh Wes Anderson, freegan pug selvage fanny pack leggings pickled food truck DIY irony Banksy.
Jean shorts raw denim Vice normcore, art party High Life PBR skateboard stumptown vinyl kitsch. Four loko meh 8-bit, tousled banh mi tilde forage Schlitz dreamcatcher twee 3 wolf moon. Chambray asymmetrical paleo salvia, sartorial umami four loko master cleanse drinking vinegar brunch. [Pinterest](https://www.pinterest.com) DIY authentic Schlitz, hoodie Intelligentsia butcher trust fund brunch shabby chic Kickstarter forage flexitarian. Direct trade <a href="https://en.wikipedia.org/wiki/Cold-pressed_juice">cold-pressed</a> meggings stumptown plaid, pop-up taxidermy. Hoodie XOXO fingerstache scenester Echo Park. Plaid ugh Wes Anderson, freegan pug selvage fanny pack leggings pickled food truck DIY irony Banksy.

#### Hipster list
<ul>
Expand Down
1 change: 1 addition & 0 deletions _posts/2015-10-20-disqus-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: post
title: a post with disqus comments
date: 2015-10-20 11:59:00-0400
description: an example of a blog post with disqus comments
tags: comments
categories: sample-posts external-services
disqus_comments: true
related_posts: false
Expand Down
1 change: 1 addition & 0 deletions _posts/2018-12-22-distill.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: distill
title: a distill-style blog post
description: an example of a distill-style blog post and main elements
tags: distill formatting
giscus_comments: true
date: 2021-05-22
featured: true
Expand Down
1 change: 1 addition & 0 deletions _posts/2020-09-28-github-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: post
title: a post with github metadata
date: 2020-09-28 21:01:00
description: a quick run down on accessing github metadata.
tags: metadata
categories: sample-posts external-services
---

Expand Down
1 change: 1 addition & 0 deletions _posts/2021-07-04-diagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: post
title: a post with diagrams
date: 2021-07-04 17:39:00
tags: formatting diagrams
description: an example of a blog post with diagrams
---

Expand Down
1 change: 1 addition & 0 deletions _posts/2022-12-10-giscus-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: post
title: a post with giscus comments
date: 2022-12-10 11:59:00-0400
description: an example of a blog post with giscus comments
tags: comments
categories: sample-posts external-services
giscus_comments: true
related_posts: false
Expand Down
3 changes: 2 additions & 1 deletion _posts/2023-03-20-table-of-contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ layout: post
title: a post with table of contents
date: 2023-03-20 11:59:00-0400
description: an example of a blog post with table of contents
categories: sample-posts toc
tags: formatting toc
categories: sample-posts
giscus_comments: true
related_posts: false
toc:
Expand Down
1 change: 1 addition & 0 deletions _posts/2023-03-21-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: post
title: displaying beautiful tables with Bootstrap Tables
date: 2023-03-20 14:37:00-0400
description: an example of how to use Bootstrap Tables
tags: formatting tables
categories: sample-posts
giscus_comments: true
related_posts: true
Expand Down
2 changes: 1 addition & 1 deletion _posts/2023-04-24-videos.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: post
title: a post with videos
date: 2023-04-24 21:01:00
description: this is what included videos could look like
tags: including videos
tags: formatting videos
categories: sample-posts
---
This is an example post with videos. It supports local video files.
Expand Down
2 changes: 1 addition & 1 deletion _posts/2023-04-25-audios.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: post
title: a post with audios
date: 2023-04-25 10:25:00
description: this is what included audios could look like
tags: including audios
tags: formatting audios
categories: sample-posts
---
This is an example post with audios. It supports local audio files.
Expand Down
3 changes: 2 additions & 1 deletion _posts/2023-04-25-sidebar-table-of-contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ layout: post
title: a post with table of contents on a sidebar
date: 2023-04-25 10:14:00-0400
description: an example of a blog post with table of contents on a sidebar
categories: sample-posts toc sidebar
tags: formatting toc sidebar
categories: sample-posts
giscus_comments: true
related_posts: false
toc:
Expand Down
3 changes: 2 additions & 1 deletion _posts/2023-05-12-custom-blockquotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ layout: post
title: a post with custom blockquotes
date: 2023-05-12 15:53:00-0400
description: an example of a blog post with custom blockquotes
categories: sample-posts blockquotes
tags: formatting blockquotes
categories: sample-posts
giscus_comments: true
related_posts: true
---
Expand Down
3 changes: 2 additions & 1 deletion _posts/2023-07-04-jupyter-notebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ layout: post
title: a post with jupyter notebook
date: 2023-07-04 08:57:00-0400
description: an example of a blog post with jupyter notebook
categories: sample-posts jupyter-notebook
tags: formatting jupyter
categories: sample-posts
giscus_comments: true
related_posts: false
---
Expand Down
12 changes: 12 additions & 0 deletions _posts/2023-07-12-post-bibliography.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
layout: post
title: a post with bibliography
date: 2023-07-12 09:56:00-0400
description: an example of a blog post with bibliography
tags: formatting bib
categories: sample-posts
giscus_comments: true
related_posts: false
related_publications: einstein1950meaning, einstein1905movement
---
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 %}).
1 change: 1 addition & 0 deletions _projects/1_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: a project with a background image
img: assets/img/12.jpg
importance: 1
category: work
related_publications: einstein1956investigations, einstein1950meaning
---

Every project has a beautiful feature showcase page.
Expand Down

0 comments on commit 5624a26

Please sign in to comment.