Support for bibliography in blog posts and projects (#1553)

Implemented #1193

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
This commit is contained in:
George 2023-07-12 14:07:33 -03:00 committed by GitHub
parent c2019498d3
commit 3d0b362d19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 46 additions and 7 deletions

View File

@ -13,4 +13,12 @@ layout: default
{{ content }} {{ content }}
</article> </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> </div>

View File

@ -51,6 +51,14 @@ layout: default
</div> </div>
</article> </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 site.related_blog_posts.enabled -%}
{%- if page.related_posts == null or page.related_posts -%} {%- if page.related_posts == null or page.related_posts -%}
{% include related_posts.html %} {% include related_posts.html %}

View File

@ -6,7 +6,7 @@ description: march & april, looking forward to summer
tags: formatting links tags: formatting links
categories: sample-posts 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 #### Hipster list
<ul> <ul>

View File

@ -3,6 +3,7 @@ layout: post
title: a post with disqus comments title: a post with disqus comments
date: 2015-10-20 11:59:00-0400 date: 2015-10-20 11:59:00-0400
description: an example of a blog post with disqus comments description: an example of a blog post with disqus comments
tags: comments
categories: sample-posts external-services categories: sample-posts external-services
disqus_comments: true disqus_comments: true
related_posts: false related_posts: false

View File

@ -2,6 +2,7 @@
layout: distill layout: distill
title: a distill-style blog post title: a distill-style blog post
description: an example of a distill-style blog post and main elements description: an example of a distill-style blog post and main elements
tags: distill formatting
giscus_comments: true giscus_comments: true
date: 2021-05-22 date: 2021-05-22
featured: true featured: true

View File

@ -3,6 +3,7 @@ layout: post
title: a post with github metadata title: a post with github metadata
date: 2020-09-28 21:01:00 date: 2020-09-28 21:01:00
description: a quick run down on accessing github metadata. description: a quick run down on accessing github metadata.
tags: metadata
categories: sample-posts external-services categories: sample-posts external-services
--- ---

View File

@ -2,6 +2,7 @@
layout: post layout: post
title: a post with diagrams title: a post with diagrams
date: 2021-07-04 17:39:00 date: 2021-07-04 17:39:00
tags: formatting diagrams
description: an example of a blog post with diagrams description: an example of a blog post with diagrams
--- ---

View File

@ -3,6 +3,7 @@ layout: post
title: a post with giscus comments title: a post with giscus comments
date: 2022-12-10 11:59:00-0400 date: 2022-12-10 11:59:00-0400
description: an example of a blog post with giscus comments description: an example of a blog post with giscus comments
tags: comments
categories: sample-posts external-services categories: sample-posts external-services
giscus_comments: true giscus_comments: true
related_posts: false related_posts: false

View File

@ -3,7 +3,8 @@ layout: post
title: a post with table of contents title: a post with table of contents
date: 2023-03-20 11:59:00-0400 date: 2023-03-20 11:59:00-0400
description: an example of a blog post with table of contents description: an example of a blog post with table of contents
categories: sample-posts toc tags: formatting toc
categories: sample-posts
giscus_comments: true giscus_comments: true
related_posts: false related_posts: false
toc: toc:

View File

@ -3,6 +3,7 @@ layout: post
title: displaying beautiful tables with Bootstrap Tables title: displaying beautiful tables with Bootstrap Tables
date: 2023-03-20 14:37:00-0400 date: 2023-03-20 14:37:00-0400
description: an example of how to use Bootstrap Tables description: an example of how to use Bootstrap Tables
tags: formatting tables
categories: sample-posts categories: sample-posts
giscus_comments: true giscus_comments: true
related_posts: true related_posts: true

View File

@ -3,7 +3,7 @@ layout: post
title: a post with videos title: a post with videos
date: 2023-04-24 21:01:00 date: 2023-04-24 21:01:00
description: this is what included videos could look like description: this is what included videos could look like
tags: including videos tags: formatting videos
categories: sample-posts categories: sample-posts
--- ---
This is an example post with videos. It supports local video files. This is an example post with videos. It supports local video files.

View File

@ -3,7 +3,7 @@ layout: post
title: a post with audios title: a post with audios
date: 2023-04-25 10:25:00 date: 2023-04-25 10:25:00
description: this is what included audios could look like description: this is what included audios could look like
tags: including audios tags: formatting audios
categories: sample-posts categories: sample-posts
--- ---
This is an example post with audios. It supports local audio files. This is an example post with audios. It supports local audio files.

View File

@ -3,7 +3,8 @@ layout: post
title: a post with table of contents on a sidebar title: a post with table of contents on a sidebar
date: 2023-04-25 10:14:00-0400 date: 2023-04-25 10:14:00-0400
description: an example of a blog post with table of contents on a sidebar 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 giscus_comments: true
related_posts: false related_posts: false
toc: toc:

View File

@ -3,7 +3,8 @@ layout: post
title: a post with custom blockquotes title: a post with custom blockquotes
date: 2023-05-12 15:53:00-0400 date: 2023-05-12 15:53:00-0400
description: an example of a blog post with custom blockquotes description: an example of a blog post with custom blockquotes
categories: sample-posts blockquotes tags: formatting blockquotes
categories: sample-posts
giscus_comments: true giscus_comments: true
related_posts: true related_posts: true
--- ---

View File

@ -3,7 +3,8 @@ layout: post
title: a post with jupyter notebook title: a post with jupyter notebook
date: 2023-07-04 08:57:00-0400 date: 2023-07-04 08:57:00-0400
description: an example of a blog post with jupyter notebook description: an example of a blog post with jupyter notebook
categories: sample-posts jupyter-notebook tags: formatting jupyter
categories: sample-posts
giscus_comments: true giscus_comments: true
related_posts: false related_posts: false
--- ---

View File

@ -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 %}).

View File

@ -5,6 +5,7 @@ description: a project with a background image
img: assets/img/12.jpg img: assets/img/12.jpg
importance: 1 importance: 1
category: work category: work
related_publications: einstein1956investigations, einstein1950meaning
--- ---
Every project has a beautiful feature showcase page. Every project has a beautiful feature showcase page.