Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
alshedivat committed Jan 10, 2024
1 parent ae29053 commit e640914
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 54 deletions.
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The recommended approach for using **al-folio** is to first create your own site using the template with as few changes as possible, and only when it is up and running customize it however you like. This way it is easier to pinpoint what causes a potential issue in case of a bug. The minimum steps required to create your own site are:

1. Create a new repository using this template. For this, click on `Use this template -> Create a new repository` above the file list. If you plan to upload your site to `<your-github-username>.github.io`, note that the name of your repository MUST BE `<your-github-username>.github.io` or `<your-github-orgname>.github.io`, as stated in the [GitHub pages docs](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#types-of-github-pages-sites).
1. Create a new repository using this template. For this, click on [Use this template -> Create a new repository](https://github.com/new?template_name=al-folio&template_owner=alshedivat) above the file list. If you plan to upload your site to `<your-github-username>.github.io`, note that the name of your repository MUST BE `<your-github-username>.github.io` or `<your-github-orgname>.github.io`, as stated in the [GitHub pages docs](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#types-of-github-pages-sites).
2. In this new repository, go to `Settings -> Actions -> General -> Workflow permissions` and give `Read and write permissions` to GitHub Actions.
3. Open file `_config.yml`, set `url` to `https://<your-github-username>.github.io` and leave `baseurl` **empty**.
4. Finally, in the repository page go to `Settings -> Pages -> Build and deployment`, make sure that `Source` is set to `Deploy from a branch` and set the branch to `gh-pages` (NOT to master).
Expand Down
16 changes: 8 additions & 8 deletions _data/coauthors.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
"Adams":
"adams":
- firstname: ["Edwin", "E.", "E. P.", "Edwin Plimpton"]
url: https://en.wikipedia.org/wiki/Edwin_Plimpton_Adams

"Podolsky":
"podolsky":
- firstname: ["Boris", "B.", "B. Y.", "Boris Yakovlevich"]
url: https://en.wikipedia.org/wiki/Boris_Podolsky

"Rosen":
"rosen":
- firstname: ["Nathan", "N."]
url: https://en.wikipedia.org/wiki/Nathan_Rosen

"Bach":
"bach":
- firstname: ["Johann Sebastian", "J. S."]
url: https://en.wikipedia.org/wiki/Johann_Sebastian_Bach

- firstname: ["Carl Philipp Emanuel", "C. P. E."]
url: https://en.wikipedia.org/wiki/Carl_Philipp_Emanuel_Bach

"Przibram":
"przibram":
- firstname: ["Karl"]
url: https://link.springer.com/article/10.1007/s00016-019-00242-z

"Schrödinger":
"schrodinger":
- firstname: ["Erwin"]
url: https://en.wikipedia.org/wiki/Erwin_Schr%C3%B6dinger

"Lorentz":
"lorentz":
- firstname: ["Hendrik Antoon"]
url: https://en.wikipedia.org/wiki/Hendrik_Lorentz

"Planck":
"planck":
- firstname: ["Max"]
url: https://en.wikipedia.org/wiki/Max_Planck
4 changes: 3 additions & 1 deletion _includes/selected_papers.liquid
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<div class="publications">{% bibliography -f {{ site.scholar.bibliography }} --group_by none --query @*[selected=true]* %}</div>
<div class="publications">
{% bibliography --group_by none --query @*[selected=true]* %}
</div>
58 changes: 33 additions & 25 deletions _layouts/bib.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
{% else %}
{% assign entry_path = entry.preview | prepend: '/assets/img/publication_preview/' %}
{%
include figure.html path=entry_path sizes
= "200px" class="preview z-depth-1 rounded" zoomable=false alt=entry.preview
include figure.html
path=entry_path
sizes = "200px"
class="preview z-depth-1 rounded"
zoomable=false
alt=entry.preview
%}
{% endif %}
{% elsif entry.abbr %}
Expand All @@ -23,7 +27,7 @@
<abbr
class="badge"
{% if venue_style %}
{{- venue_style -}}
{{ venue_style }}
{% endif %}
><a href="{{site.data.venues[entry.abbr].url}}">{{ entry.abbr }}</a></abbr
>
Expand All @@ -41,10 +45,12 @@
<!-- Author -->
<div class="author">
{% assign author_array_size = entry.author_array | size %}

{% assign author_array_limit = author_array_size %}
{% if site.max_author_limit and author_array_size > site.max_author_limit %}
{% assign author_array_limit = site.max_author_limit %}
{% endif %}

{% for author in entry.author_array limit: author_array_limit %}
{% assign author_is_self = false %}
{% assign author_last_name = author.last | remove: '¶' | remove: '&' | remove: '*' | remove: '†' | remove: '^' %}
Expand All @@ -54,19 +60,19 @@
{% endif %}
{% endif %}
{% assign coauthor_url = null %}
{% if site.data.coauthors[author_last_name] %}
{% for coauthor in site.data.coauthors[author_last_name] %}
{% assign clean_last_name = author_last_name | downcase | remove_accents %}
{% if site.data.coauthors[clean_last_name] %}
{% for coauthor in site.data.coauthors[clean_last_name] %}
{% if coauthor.firstname contains author.first %}
{% assign coauthor_url = coauthor.url %}
{% break %}
{% endif %}
{% endfor %}
{% endif %}

{% if forloop.length > 1 %}
{% if forloop.first == false %},&nbsp;{% endif %}
{% if forloop.last and author_array_limit == author_array_size %}
and&nbsp;
{% endif %}
{% if forloop.last and author_array_limit == author_array_size %}and&nbsp;{% endif %}
{% endif %}
{% if author_is_self %}
<em>
Expand All @@ -86,6 +92,7 @@
{% endif %}
{% endfor %}
{% assign more_authors = author_array_size | minus: author_array_limit %}

{% assign more_authors_hide = more_authors | append: ' more author' %}
{% if more_authors > 0 %}
{% if more_authors > 1 %}
Expand All @@ -94,7 +101,9 @@
{% assign more_authors_show = '' %}
{% for author in entry.author_array offset: author_array_limit %}
{% assign more_authors_show = more_authors_show | append: author.first | append: ' ' | append: author.last %}
{% unless forloop.last %}{% assign more_authors_show = more_authors_show | append: ', ' %}{% endunless %}
{% unless forloop.last %}
{% assign more_authors_show = more_authors_show | append: ', ' %}
{% endunless %}
{% endfor %}
, and
<span
Expand Down Expand Up @@ -126,25 +135,24 @@
{% elsif proceedings contains entry.type %}
{% capture entrytype %}<em>In {{entry.booktitle}}</em> {% endcapture %}
{% elsif thesis contains entry.type %}
{% capture entrytype %}<em
>{{entry.school}}</em
>
{% endcapture %}
{% capture entrytype %}<em>{{entry.school}}</em> {% endcapture %}
{% else %}
{% capture entrytype %}{% endcapture %}
{% endif %}
{% if entry.month %}
{% capture entrymonth %}{{ " "
}}{{ entry.month | capitalize }}{% endcapture %}
{% capture entrymonth %}{{ " " }}{{ entry.month | capitalize }}{% endcapture %}
{% endif %}
{% if entry.year %}
{% capture entryyear %}{{ " " }}{{entry.year}}{% endcapture %}
{% endif %}
{% assign entrytype_text = entrytype | strip_html | strip %}
{% capture periodical %}{{ entrytype }}{% if
entrytype_text != "" and entryyear != "" %}, {% endif %}{{ entrymonth }}{{ entryyear }}{% endcapture %}
<div class="periodical">{{ periodical | strip }}</div>
<div class="periodical">{{ entry.note | strip }}</div>
{% capture periodical %}{{ entrytype }}{% if entrytype_text != "" and entryyear != "" %}, {% endif %}{{ entrymonth }}{{ entryyear }}{% endcapture %}
<div class="periodical">
{{ periodical | strip }}
</div>
<div class="periodical">
{{ entry.note | strip }}
</div>

<!-- Links/Buttons -->
<div class="links">
Expand Down Expand Up @@ -202,10 +210,7 @@
{% endif %}
</div>
{% if site.enable_publication_badges %}
{%
assign entry_has_altmetric_badge = entry.altmetric or entry.doi or entry.eprint or entry.pmid or
entry.isbn
%}
{% assign entry_has_altmetric_badge = entry.altmetric or entry.doi or entry.eprint or entry.pmid or entry.isbn %}
{% assign entry_has_dimensions_badge = entry.dimensions or entry.doi or entry.pmid %}
{% if entry_has_altmetric_badge or entry_has_dimensions_badge %}
<div class="badges">
Expand Down Expand Up @@ -242,18 +247,20 @@
data-hide-zero-citations="true"
data-style="small_rectangle"
data-legend="hover-right"
style="margin-bottom: 3px"
style="margin-bottom: 3px;"
></span>
{% endif %}
</div>
{% endif %}
{% endif %}

{% if entry.abstract %}
<!-- Hidden abstract block -->
<div class="abstract hidden">
<p>{{ entry.abstract }}</p>
</div>
{% endif %}

{% if entry.bibtex_show %}
<!-- Hidden bibtex block -->
<div class="bibtex hidden">
Expand All @@ -262,10 +269,11 @@
{% endhighlight %}
</div>
{% endif %}

{% if entry.video %}
<!-- Hidden video block -->
<div class="abstract hidden">
<div style="text-align: center">{% include video.html path=entry.video class="img-fluid rounded z-depth-1" controls=true %}</div>
<div style="text-align: center;">{% include video.html path=entry.video class="img-fluid rounded z-depth-1" controls=true %}</div>
</div>
{% endif %}
</div>
Expand Down
17 changes: 11 additions & 6 deletions _layouts/page.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ layout: default
<p class="post-description">{{ page.description }}</p>
</header>

<article>{{ content }}</article>
<article>
{{ content }}
</article>

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

{% if site.giscus and page.giscus_comments %}
{% include giscus.liquid %}
{% endif %}
{% if site.giscus and page.giscus_comments %}{% include giscus.liquid %}{% endif %}
</div>
25 changes: 18 additions & 7 deletions _layouts/post.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ layout: default
{% assign year = page.date | date: '%Y' %}
{% assign tags = page.tags | join: '' %}
{% assign categories = page.categories | join: '' %}

{% if page._styles %}
<!-- Page/Post style -->
<style type="text/css">
{{ page._styles }}
</style>
{% endif %}

{% assign url_beginning = page.url | slice: 0, 6 %}

<div class="post">
Expand Down Expand Up @@ -38,6 +40,7 @@ layout: default
{% endif %}
{% endfor %}
{% endif %}

{% if categories != '' %}
&nbsp; &middot; &nbsp;
{% for category in page.categories %}
Expand All @@ -56,24 +59,32 @@ layout: default

<article class="post-content">
{% if page.toc and page.toc.beginning %}
<div id="table-of-contents">{% toc %}</div>
<div id="table-of-contents">
{% toc %}
</div>
<hr>
{% endif %}
<div id="markdown-content">{{ content }}</div>
<div id="markdown-content">
{{ content }}
</div>
</article>

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

{% if site.related_blog_posts.enabled %}
{% if page.related_posts == null or page.related_posts %}
{% include related_posts.liquid %}
{% endif %}
{% endif %}
{% if site.disqus_shortname and page.disqus_comments %}{% include disqus.liquid %}{% endif %}

{% if site.disqus_shortname and page.disqus_comments %}
{% include disqus.liquid %}
{% endif %}
{% if site.giscus and page.giscus_comments %}
{% include giscus.liquid %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion _pages/publications.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ nav_order: 2
<!-- _pages/publications.md -->
<div class="publications">

{% bibliography -f {{ site.scholar.bibliography }} %}
{% bibliography %}

</div>
32 changes: 32 additions & 0 deletions _plugins/remove-accents.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# based on https://distresssignal.org/busting-css-cache-with-jekyll-md5-hash
# https://gist.github.com/BryanSchuetz/2ee8c115096d7dd98f294362f6a667db
module Jekyll
module CleanString
class RemoveAccents
require 'i18n'
I18n.config.available_locales = :en

attr_accessor :string

def initialize(string:)
self.string = string
end

def digest!
remove_accents
end

private

def remove_accents
I18n.transliterate(string)
end
end

def remove_accents(string)
RemoveAccents.new(string: string).digest!
end
end
end

Liquid::Template.register_filter(Jekyll::CleanString)
13 changes: 11 additions & 2 deletions _posts/2023-07-12-post-bibliography.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ tags: formatting bib
categories: sample-posts
giscus_comments: true
related_posts: false
related_publications: einstein1950meaning, einstein1905movement
related_publications: true
---

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

{% quote einstein1905electrodynamics %}
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor.

Lorem ipsum dolor sit amet, consectetur adipisicing.
{% endquote %}

If you would like something more academic, check the [distill style post]({% post_url 2018-12-22-distill %}).
6 changes: 3 additions & 3 deletions _projects/1_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: a project with a background image
img: assets/img/12.jpg
importance: 1
category: work
related_publications: einstein1956investigations, einstein1950meaning
related_publications: true
---

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

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

<div class="row justify-content-sm-center">
Expand Down

0 comments on commit e640914

Please sign in to comment.