diff --git a/Gemfile b/Gemfile index 716091cb7926..121f076ff38c 100644 --- a/Gemfile +++ b/Gemfile @@ -15,4 +15,6 @@ group :jekyll_plugins do gem 'jemoji' gem 'unicode_utils' gem 'webrick' + gem 'htmlcompressor' + gem 'htmlbeautifier' end diff --git a/_config.yml b/_config.yml index 55ea2c9c250b..60d2299a8b77 100644 --- a/_config.yml +++ b/_config.yml @@ -13,6 +13,7 @@ footer_text: > Powered by Jekyll with al-folio theme. Hosted by GitHub Pages. Photos from Unsplash. +keywords: jekyll, jekyll-theme, academic-website, portfolio-website # add your own keywords or leave empty lang: en # the language of your site (for example: en, fr, cn, ru, etc.) icon: 🔥 # the emoji used as the favicon @@ -40,10 +41,11 @@ max_width: 800px # TODO: add layout settings (single page vs. multi-page) # ----------------------------------------------------------------------------- -# Open Graph +# Open Graph & Schema.org # ----------------------------------------------------------------------------- # Display links to the page with a preview object on social media. serve_og_meta: false # Include Open Graph meta tags in the HTML head +serve_schema_org: false # Include Schema.org in the HTML head og_image: # The site-wide (default for all links) Open Graph preview image # ----------------------------------------------------------------------------- @@ -72,8 +74,10 @@ rss_icon: true contact_note: > You can even add a little note about which of these is the best way to reach you. -google_analytics: UA-XXXXXXXXX # out your google-analytics code -panelbear_analytics: XXXXXXXXX # panelbear analytics site ID +google_analytics: # your google-analytics ID (format: UA-XXXXXXXXX) +google_site_verification: # your google-site-verification ID (Google Search Console) +bing_site_verification: # out your bing-site-verification ID (Bing Webmaster) +panelbear_analytics: # panelbear analytics site ID (format: XXXXXXXXX) # ----------------------------------------------------------------------------- # Blog @@ -158,10 +162,26 @@ defaults: path: "assets/**/*.*" values: sitemap: false - # Extras github: [metadata] +# ----------------------------------------------------------------------------- +# Jekyll optimization +# ----------------------------------------------------------------------------- + +# HTML remove comments () +remove_HTML_comments: false + +# HTML beautifier (_plugins/beautify.rb) / https://github.com/threedaymonk/htmlbeautifier +beautify: false # This function has conflict with the code snippets, they can be displayed incorrectly + +# HTML minify (_plugins/minify.rb) Thanks to: https://www.ffbit.com/blog/2021/03/17/html-minification-in-jekyll.html +minify: false + +# CSS/SASS minify +sass: + style: compressed + # ----------------------------------------------------------------------------- # Jekyll Archives # ----------------------------------------------------------------------------- @@ -242,6 +262,8 @@ jekyll-diagrams: enable_google_analytics: false # enables google analytics enable_panelbear_analytics: false # enables panelbear analytics +enable_google_verification: false # enables google site verification +enable_bing_verification: false # enables bing site verification enable_mansory: true # enables automatic project cards arangement enable_math: true # enables math typesetting (uses MathJax) enable_tooltips: false # enables automatic tooltip links generated diff --git a/_includes/figure.html b/_includes/figure.html index d07322d955da..1ab941d6e80a 100644 --- a/_includes/figure.html +++ b/_includes/figure.html @@ -1,17 +1,16 @@ -{% assign path = include.path | remove: ".jpg" | remove: ".jpeg" | remove: ".png" | remove: ".tiff" %} +{%- assign path = include.path | remove: ".jpg" | remove: ".jpeg" | remove: ".png" | remove: ".tiff" -%}
- {% for i in site.imagemagick.widths %} - - {% endfor %} + {% for i in site.imagemagick.widths -%} + + {% endfor -%} - - {% if include.caption %}
{{ include.caption }}
{% endif %} + {%- if include.caption -%}
{{ include.caption }}
{%- endif %}
diff --git a/_includes/footer.html b/_includes/footer.html index 2e3452184cfa..acc4688f7cff 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,27 +1,25 @@ -{% if site.footer_fixed %} - -{% else %} - -{% endif %} + {% if site.footer_fixed %} + + {%- else -%} + + {%- endif %} \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index 00349ce47308..4bdc0ddb659f 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,50 +1,29 @@ - - - + + + {% include metadata.html %} - -{% if site.title == "blank" %} - {{ site.first_name }} {{ site.middle_name }} {{ site.last_name }} -{% else %} - {{ site.title }} -{% endif %} -{% if page.title != "blank" and page.url != "/" %} - | {{ page.title }} -{% endif %} - - + + + - -{% if site.serve_og_meta %} - - - - - - -{% endif %} + + + + - - - + + - - - - + + {% if site.icon != empty -%} + + {%- endif %} + + - - + {%- if site.enable_darkmode %} - -{% if site.icon != empty %} - -{% endif %} - - - -{% if site.enable_darkmode %} - - - -{% endif %} + + + + {%- endif -%} diff --git a/_includes/header.html b/_includes/header.html index 31e1fd2a4b19..6e067663c79a 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -1,92 +1,93 @@ -
- - +
\ No newline at end of file diff --git a/_includes/metadata.html b/_includes/metadata.html new file mode 100644 index 000000000000..3ebc2a1d55ef --- /dev/null +++ b/_includes/metadata.html @@ -0,0 +1,154 @@ +{% if site.enable_google_verification or site.enable_bing_verification %} + + {% if site.enable_google_verification -%} + + {%- endif -%} + {% if site.enable_bing_verification -%} + + {%- endif -%} +{%- endif %} + + + + + + + {%- if site.title == "blank" -%} + {%- capture title -%}{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}{%- endcapture -%} + {%- else -%} + {%- capture title -%}{{ site.title }}{%- endcapture -%} + {%- endif -%} + {%- if page.title != "blank" and page.url != "/" -%} + {{ title }} | {{ page.title }} + {%- else -%} + {{ title }} + {%- endif -%} + + + +{%- if page.keywords or site.keywords %} + +{%- endif %} + +{%- if site.serve_og_meta %} + + + + + + + + {% if page.og_image or site.og_image -%} + + {%- endif %} + + + + + + + {% if page.og_image or site.og_image -%} + + {%- endif %} + {% if site.twitter_username -%} + + + {%- endif %} +{%- endif %} + +{%- if site.serve_schema_org %} + + + {%- comment -%} Social links generator for "sameAs schema" {%- endcomment %} + {% assign sameaslinks = "" | split: "," %} + {%- if site.orcid_id -%} + {%- capture link -%}https://orcid.org/{{ site.orcid_id }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.scholar_userid -%} + {%- capture link -%}https://scholar.google.com/citations?user={{ site.scholar_userid }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.publons_id -%} + {%- capture link -%}https://publons.com/a/{{ site.publons_id }}/{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.research_gate_profile -%} + {%- capture link -%}https://www.researchgate.net/profile/{{site.research_gate_profile}}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.github_username -%} + {%- capture link -%}https://github.com/{{ site.github_username }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.linkedin_username -%} + {%- capture link -%}https://www.linkedin.com/in/{{ site.linkedin_username }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.twitter_username -%} + {%- capture link -%}https://twitter.com/{{ site.twitter_username }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.medium_username -%} + {%- capture link -%}https://medium.com/@{{ site.medium_username }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.quora_username -%} + {%- capture link -%}https://www.quora.com/profile/{{ site.quora_username }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.blogger_url -%} + {%- capture link -%}{{ site.blogger_url }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.work_url -%} + {%- capture link -%}{{ site.work_url }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.wikidata_id -%} + {%- capture link -%}https://www.wikidata.org/wiki/{{ site.wikidata_id }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.strava_userid -%} + {%- capture link -%}https://www.strava.com/athletes/{{ site.strava_userid }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.keybase_username -%} + {%- capture link -%}https://keybase.io/{{ site.keybase_username }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.gitlab_username -%} + {%- capture link -%}https://gitlab.com/{{ site.gitlab_username }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.dblp_url -%} + {%- capture link -%}{{ site.dblp_url }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if site.stackoverflow_id -%} + {%- capture link -%}https://stackoverflow.com/users/{{ site.stackoverflow_id }}{%- endcapture -%} + {%- assign sameaslinks = sameaslinks | push: link -%} + {%- endif -%} + {%- if sameaslinks != blank -%} + {%- assign sameaslinks = sameaslinks | split: "" -%} + {%- endif -%} + + +{%- endif %} diff --git a/_includes/news.html b/_includes/news.html index e1fc80bcb72f..be55051c91dd 100644 --- a/_includes/news.html +++ b/_includes/news.html @@ -1,24 +1,25 @@ -
-

news

- {% if site.news %} -
- - {% assign news = site.news | reverse %} - {% for item in news limit: site.news_limit %} - - - - - {% endfor %} -
{{ item.date | date: "%b %-d, %Y" }} - {% if item.inline %} - {{ item.content | remove: '

' | remove: '

' | emojify }} - {% else %} - {{ item.title }} - {% endif %} -
-
- {% else %} -

No news so far...

- {% endif %} -
+ +
+

news

+ {% if site.news -%} +
+ + {%- assign news = site.news | reverse -%} + {% for item in news limit: site.news_limit %} + + + + + {%- endfor %} +
{{ item.date | date: "%b %-d, %Y" }} + {% if item.inline -%} + {{ item.content | remove: '

' | remove: '

' | emojify }} + {%- else -%} + {{ item.title }} + {%- endif %} +
+
+ {%- else -%} +

No news so far...

+ {%- endif %} +
diff --git a/_includes/pagination.html b/_includes/pagination.html index 676101755041..4b8d27e3aee1 100644 --- a/_includes/pagination.html +++ b/_includes/pagination.html @@ -1,17 +1,17 @@ -{% if paginator.total_pages > 1 %} +{%- if paginator.total_pages > 1 -%} -{% endif %} +{%- endif -%} diff --git a/_includes/projects.html b/_includes/projects.html index bfac1d922d41..0f2e486b9ce1 100644 --- a/_includes/projects.html +++ b/_includes/projects.html @@ -1,34 +1,36 @@ -
- {% if project.redirect %} - - {% else %} - - {% endif %} -
- {% if project.img %} - {% include figure.html - path=project.img - alt="project thumbnail" %} - {% endif %} -
-

{{ project.title }}

-

{{ project.description }}

-
\ No newline at end of file diff --git a/_includes/projects_horizontal.html b/_includes/projects_horizontal.html index e0dd5f20349c..7d1be4949eba 100644 --- a/_includes/projects_horizontal.html +++ b/_includes/projects_horizontal.html @@ -1,12 +1,12 @@
- {% if project.redirect %} + {%- if project.redirect -%} - {% else %} + {%- else -%} - {% endif %} + {%- endif -%}
- {% if project.img %} + {%- if project.img -%}
{% responsive_image_block %} path: {{ project.img }} @@ -14,26 +14,26 @@ {% endresponsive_image_block %}
- {% else %} + {%- else -%} diff --git a/_includes/scripts/analytics.html b/_includes/scripts/analytics.html index 504d39b49568..f59eacdc6a21 100644 --- a/_includes/scripts/analytics.html +++ b/_includes/scripts/analytics.html @@ -1,21 +1,18 @@ -{% if site.enable_google_analytics %} - - - -{% endif %} - - -{% if site.enable_panelbear_analytics %} - - - + + {%- endif -%} + {%- if site.enable_panelbear_analytics -%} + + + -{% endif %} + +{%- endif -%} diff --git a/_includes/scripts/bootstrap.html b/_includes/scripts/bootstrap.html index 2c5d4ee066da..86f4cba652ea 100644 --- a/_includes/scripts/bootstrap.html +++ b/_includes/scripts/bootstrap.html @@ -1,4 +1,4 @@ - - - + + + diff --git a/_includes/scripts/jquery.html b/_includes/scripts/jquery.html index 8de7788d3e18..add3a8dede6a 100644 --- a/_includes/scripts/jquery.html +++ b/_includes/scripts/jquery.html @@ -1,2 +1,2 @@ - + diff --git a/_includes/scripts/mansory.html b/_includes/scripts/mansory.html index 5a93a9eeda31..77214a7aa3b6 100644 --- a/_includes/scripts/mansory.html +++ b/_includes/scripts/mansory.html @@ -1,6 +1,6 @@ -{% if site.enable_mansory %} - - - - -{% endif %} + {%- if site.enable_mansory -%} + + + + + {%- endif -%} diff --git a/_includes/scripts/mathjax.html b/_includes/scripts/mathjax.html index 53db9e018b14..c55ec056d26b 100644 --- a/_includes/scripts/mathjax.html +++ b/_includes/scripts/mathjax.html @@ -1,12 +1,12 @@ -{% if site.enable_math %} - - - - -{% endif %} + {%- if site.enable_math -%} + + + + + {%- endif %} diff --git a/_includes/scripts/misc.html b/_includes/scripts/misc.html index 260ce1b199e6..8d711d48b638 100644 --- a/_includes/scripts/misc.html +++ b/_includes/scripts/misc.html @@ -1,15 +1,14 @@ {% if site.enable_tooltips %} - - -{% endif %} + + +{%- endif %} +{%- if site.enable_medium_zoom %} + + + +{%- endif -%} -{% if site.enable_medium_zoom %} - - - -{% endif %} - - - + + diff --git a/_includes/selected_papers.html b/_includes/selected_papers.html index 0093c87aed12..61457dbcf198 100644 --- a/_includes/selected_papers.html +++ b/_includes/selected_papers.html @@ -1,4 +1,5 @@ -
-

selected publications

- {% bibliography -f papers -q @*[selected=true]* %} -
+ +
+

selected publications

+ {% bibliography -f papers -q @*[selected=true]* %} +
diff --git a/_includes/social.html b/_includes/social.html index 98148d00c1fe..4ed62e1aeba7 100644 --- a/_includes/social.html +++ b/_includes/social.html @@ -1,20 +1,57 @@ -{% if site.email %}
{% endif %} -{% if site.orcid_id %}{% endif %} -{% if site.scholar_userid %}{% endif %} -{% if site.publons_id %}{% endif %} -{% if site.research_gate_profile %}{% endif %} -{% if site.github_username %}{% endif %} -{% if site.linkedin_username %}{% endif %} -{% if site.twitter_username %}{% endif %} -{% if site.medium_username %}{% endif %} -{% if site.quora_username %}{% endif %} -{% if site.blogger_url %}{% endif %} -{% if site.work_url %}{% endif %} -{% if site.wikidata_id %}{% endif %} -{% if site.strava_userid %}{% endif %} -{% if site.keybase_username %}{% endif %} -{% if site.gitlab_username %}{% endif %} -{% if site.dblp_url %}{% endif %} -{% if site.stackoverflow_id %}{% endif %} - -{% if site.rss_icon %}{% endif %} + {%- if site.email -%} + + {% endif %} + {%- if site.orcid_id -%} + + {% endif %} + {%- if site.scholar_userid -%} + + {% endif %} + {%- if site.publons_id -%} + + {% endif %} + {%- if site.research_gate_profile -%} + + {% endif %} + {%- if site.github_username -%} + + {% endif %} + {%- if site.linkedin_username -%} + + {% endif %} + {%- if site.twitter_username -%} + + {% endif %} + {%- if site.medium_username -%} + + {% endif %} + {%- if site.quora_username -%} + + {% endif %} + {%- if site.blogger_url -%} + + {% endif %} + {%- if site.work_url -%} + + {% endif %} + {%- if site.wikidata_id -%} + + {% endif %} + {%- if site.strava_userid -%} + + {% endif %} + {%- if site.keybase_username -%} + + {% endif %} + {%- if site.gitlab_username -%} + + {% endif %} + {%- if site.dblp_url -%} + + {% endif %} + {%- if site.stackoverflow_id -%} + + {% endif %} + {%- if site.rss_icon -%} + + {% endif %} \ No newline at end of file diff --git a/_layouts/about.html b/_layouts/about.html index 1663006a9047..7490c6b16063 100644 --- a/_layouts/about.html +++ b/_layouts/about.html @@ -2,52 +2,57 @@ layout: default --- -
- -
-

- {% if site.title == "blank" %}{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}{% else %}{{ site.title }}{% endif %} -

-

{{ page.description }}

-
- -
- {% if page.profile %} -
- {% if page.profile.image %} - {% assign profile_image_path = page.profile.image | prepend: 'assets/img/' %} - {% include figure.html - path=profile_image_path - class="img-fluid z-dept-1 rounded"%} - {% endif %} - {% if page.profile.address %} -
- {{ page.profile.address }} -
- {% endif %} -
- {% endif %} - -
- {{ content }} -
- - {% if page.news %} - {% include news.html %} - {% endif %} - - {% if page.selected_papers %} - {% include selected_papers.html %} - {% endif %} - - {% if page.social %} - - {% endif %} -
+ +
+
+

+ {% if site.title == "blank" -%}{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}{%- else -%}{{ site.title }}{%- endif %} +

+

{{ page.subtitle }}

+
+ +
+ {% if page.profile -%} +
+ {%- if page.profile.image %} + {%- assign profile_image_path = page.profile.image | prepend: 'assets/img/' -%} + {% include figure.html + path=profile_image_path + class="img-fluid z-dept-1 rounded" -%} + {% endif -%} + {%- if page.profile.address %} +
+ {{ page.profile.address }} +
+ {%- endif %} +
+ {%- endif %} + +
+ {{ content }} +
+ + {% if page.news -%} + + {%- include news.html %} + {%- endif %} + {% if page.selected_papers -%} + + {%- include selected_papers.html %} + {%- endif %} + {%- if page.social %} + + + {%- endif %} +
diff --git a/_layouts/bib.html b/_layouts/bib.html index 407949754836..b224402fa7d9 100644 --- a/_layouts/bib.html +++ b/_layouts/bib.html @@ -1,151 +1,158 @@ --- --- + +
+
+ {%- if entry.abbr -%} + {%- if site.data.venues[entry.abbr] -%} + {{entry.abbr}} + {%- else -%} + {{entry.abbr}} + {%- endif -%} + {%- endif -%} +
-
-
- {% if entry.abbr %} - {% if site.data.venues[entry.abbr] %} - {{entry.abbr}} - {% else %} - {{entry.abbr}} - {% endif %} - {% endif %} -
+ +
+ {% if entry.type == "thesis" -%} + {{reference}} + {%- else %} + +
{{entry.title}}
+ +
+ {%- for author in entry.author_array -%} + {%- assign author_is_self = false -%} + {%- if author.last == site.scholar.last_name%} + {%- if site.scholar.first_name contains author.first -%} + {%- assign author_is_self = true -%} + {%- endif -%} + {%- endif -%} + {%- assign coauthor_url = nil -%} + {%- if site.data.coauthors[author.last] -%} + {%- for coauthor in site.data.coauthors[author.last] -%} + {%- if coauthor.firstname contains author.first -%} + {%- assign coauthor_url = coauthor.url -%} + {%- break -%} + {%- endif -%} + {%- endfor -%} + {%- endif -%} + + {%- if forloop.length == 1 -%} + {%- if author_is_self %} + {{author.last}}, {{author.first}} + {%- else -%} + {{author.last}}, {{author.first}} + {%- endif -%} + {%- else -%} + {%- unless forloop.last -%} + {% if author_is_self %} + {{author.last}}, {{author.first}},  + {%- else -%} + {% if coauthor_url -%} + {{author.last}}, {{author.first}},  + {%- else -%} + {{author.last}}, {{author.first}},  + {%- endif -%} + {%- endif -%} + {%- else -%} + {% if author_is_self -%} + and {{author.last}}, {{author.first}} + {% else -%} + {%- if coauthor_url -%} + and {{author.last}}, {{author.first}} + {% else -%} + and {{author.last}}, {{author.first}} + {%- endif -%} + {%- endif -%} + {%- endunless -%} + {%- endif -%} + {%- endfor %} +
-
- {% if entry.type == "thesis" %} - {{reference}} - {% else %} -
{{entry.title}}
-
- {% for author in entry.author_array %} - {% assign author_is_self = false %} - {% if author.last == site.scholar.last_name%} - {% if site.scholar.first_name contains author.first%} - {% assign author_is_self = true %} - {% endif %} - {% endif %} - {% assign coauthor_url = nil %} - {% if site.data.coauthors[author.last] %} - {% for coauthor in site.data.coauthors[author.last] %} - {% if coauthor.firstname contains author.first %} - {% assign coauthor_url = coauthor.url %} - {% break %} - {% endif %} - {% endfor %} - {% endif %} - - {% if forloop.length == 1 %} - {% if author_is_self %} - {{author.last}}, {{author.first}} - {% else %} - {{author.last}}, {{author.first}} - {% endif %} - {% else %} - {% unless forloop.last %} - {% if author_is_self %} - {{author.last}}, {{author.first}}, - {% else %} - {% if coauthor_url %} - {{author.last}}, {{author.first}}, - {% else %} - {{author.last}}, {{author.first}}, - {% endif %} - {% endif %} - {% else %} - {% if author_is_self %} - and {{author.last}}, {{author.first}} - {% else %} - {% if coauthor_url %} - and {{author.last}}, {{author.first}} - {% else %} - and {{author.last}}, {{author.first}} - {% endif %} - {% endif %} - {% endunless %} - {% endif %} - {% endfor %} -
- -
- {% if entry.type == "article" %} - {{entry.journal}} - {% elsif entry.type == "inproceedings" %} - In {{entry.booktitle}} - {% endif %} - {% if entry.month %} - {{entry.month | capitalize}} - {% endif %} - {% if entry.year %} - {{entry.year}} - {% endif %} -
- {% endif %} + + {% if entry.type == "article" -%} + {%- capture entrytype -%}{{entry.journal}}{%- endcapture -%} + {%- elsif entry.type == "inproceedings" -%} + {%- capture entrytype -%}In {{entry.booktitle}} {%- endcapture -%} + {%- endif -%} + {%- if entry.month -%} + {%- capture entrymonth -%}{{ " " }}{{ entry.month | capitalize }}{%- endcapture -%} + {%- endif -%} + {%- if entry.year -%} + {%- capture entryyear -%}{{ " " }}{{entry.year}}{%- endcapture -%} + {%- endif -%} + {%- capture periodical -%}{{ entrytype }}{{ entrymonth }}{{ entryyear }}{%- endcapture -%} +
+ {{ periodical | strip }} +
+ {%- endif %} + + + - + {% if entry.abstract -%} + + + {%- endif -%} - - {% if entry.abstract %} - - {% endif %} - - - {% if entry.bibtex_show %} - - {% endif %} -
-
+ {% if entry.bibtex_show -%} + + + {%- endif %} +
+
diff --git a/_layouts/default.html b/_layouts/default.html index 2c7a26f39849..8a2121200be5 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,27 +1,30 @@ +--- +layout: parse +--- + - {% if page.redirect %}{% endif %} - {% include head.html %} + {%- if page.redirect -%} + + {%- endif -%} + {% include head.html %} - + + - - {% include header.html %} + {%- include header.html %} -
{{ content }}
- - {% include footer.html %} - + {%- include footer.html %} {% include scripts/jquery.html %} @@ -30,5 +33,4 @@ {% include scripts/misc.html %} {% include scripts/mathjax.html %} {% include scripts/analytics.html %} - diff --git a/_layouts/distill.html b/_layouts/distill.html index 87ead5317eb0..6f69e29ef71e 100644 --- a/_layouts/distill.html +++ b/_layouts/distill.html @@ -1,16 +1,20 @@ + - {% include head.html %} + {%- include head.html %} + {% include scripts/mathjax.html %} + {% if page._styles %} + - {% endif %} + {%- endif %} @@ -19,7 +23,7 @@ "description": "{{ page.description }}", "published": "{{ page.date | date: '%B %-d, %Y' }}", "authors": [ - {% for author in page.authors %} + {% for author in page.authors -%} { "author": "{{ author.name }}", "authorURL": "{{ author.url }}", @@ -49,14 +53,12 @@ } - + - - {% include header.html %} + {%- include header.html %} -
@@ -67,23 +69,23 @@

{{ page.title }}

- {% if page.toc %} + {% if page.toc -%} - {% endif %} + {%- endif %} {{ content }} @@ -96,8 +98,7 @@

Contents

- - {% include footer.html %} + {%- include footer.html %} diff --git a/_layouts/page.html b/_layouts/page.html index 10b9ab4f66fa..9e34f406f31d 100644 --- a/_layouts/page.html +++ b/_layouts/page.html @@ -1,15 +1,16 @@ --- layout: default --- -
+ +
-
-

{{ page.title }}

-

{{ page.description }}

-
+
+

{{ page.title }}

+

{{ page.description }}

+
-
- {{ content }} -
+
+ {{ content }} +
-
+
diff --git a/_layouts/parse.html b/_layouts/parse.html new file mode 100644 index 000000000000..4da5f35df186 --- /dev/null +++ b/_layouts/parse.html @@ -0,0 +1,30 @@ +{%- if site.remove_HTML_comments -%} + {%- assign _comments = "" | split: " " -%} + {%- capture _comment_befores -%}{{ content }}{%- endcapture -%} + {%- assign _comment_befores = _comment_befores | split: _comments.first -%} + {%- for _comment_before in _comment_befores -%} + {%- if forloop.first -%} + {%- continue -%} + {%- endif -%} + {%- capture _comment_outside -%} + {%- if _carry -%} + {{ _comments.first }} + {%- endif -%} + {{ _comment_before }} + {%- endcapture -%} + {%- capture _comment -%} + {%- unless _carry -%} + {{ _comments.first }} + {%- endunless -%} + {{ _comment_outside | split: _comments.last | first }} + {%- if _comment_outside contains _comments.last -%} + {{ _comments.last }} + {%- assign _carry = false -%} + {%- else -%} + {%- assign _carry = true -%} + {%- endif -%} + {%- endcapture -%} + {%- assign content = content | remove_first: _comment -%} + {%- endfor -%} +{%- endif -%} +{{ content | beautify | minify }} diff --git a/_layouts/post.html b/_layouts/post.html index a67b8ac33c4d..cd95734eddd7 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,12 +1,13 @@ --- layout: default --- - -{% assign year = page.date | date: "%Y" %} -{% assign tags = page.tags | join: "" %} -{% assign categories = page.categories | join: "" %} + +{%- assign year = page.date | date: "%Y" -%} +{%- assign tags = page.tags | join: "" -%} +{%- assign categories = page.categories | join: "" -%} {% if page._styles %} + @@ -16,23 +17,23 @@

{{ page.title }}

- + @@ -42,7 +43,7 @@

{{ page.title }}

{{ content }} - {% if site.disqus_shortname and page.comments %} + {%- if site.disqus_shortname and page.comments -%}
- {% endif %} + {%- endif %}
diff --git a/_pages/about.md b/_pages/about.md index 2008d41688f0..f4226ee8bf7a 100644 --- a/_pages/about.md +++ b/_pages/about.md @@ -2,7 +2,7 @@ layout: about title: about permalink: / -description: Affiliations. Address. Contacts. Moto. Etc. +subtitle: Affiliations. Address. Contacts. Moto. Etc. profile: align: right diff --git a/_pages/projects.md b/_pages/projects.md index f3ca5556481e..33d68b118194 100644 --- a/_pages/projects.md +++ b/_pages/projects.md @@ -7,51 +7,51 @@ nav: true display_categories: [work, fun] horizontal: false --- + +
- {% if site.enable_project_categories and page.display_categories %} +{%- if site.enable_project_categories and page.display_categories %} - {% for category in page.display_categories %} -

{{ category }}

- {% assign categorized_projects = site.projects | where: "category", category %} - {% assign sorted_projects = categorized_projects | sort: "importance" %} - - {% if page.horizontal %} -
-
- {% for project in sorted_projects %} - {% include projects_horizontal.html %} - {% endfor %} -
-
- {% else %} -
- {% for project in sorted_projects %} - {% include projects.html %} - {% endfor %} -
- {% endif %} - {% endfor %} - - {% else %} - - {% assign sorted_projects = site.projects | sort: "importance" %} - - {% if page.horizontal %} -
-
- {% for project in sorted_projects %} - {% include projects_horizontal.html %} - {% endfor %} -
-
- {% else %} -
- {% for project in sorted_projects %} - {% include projects.html %} - {% endfor %} -
- {% endif %} - - {% endif %} + {%- for category in page.display_categories %} +

{{ category }}

+ {%- assign categorized_projects = site.projects | where: "category", category -%} + {%- assign sorted_projects = categorized_projects | sort: "importance" %} + + {% if page.horizontal -%} +
+
+ {%- for project in sorted_projects -%} + {% include projects_horizontal.html %} + {%- endfor %} +
+
+ {%- else -%} +
+ {%- for project in sorted_projects -%} + {% include projects.html %} + {%- endfor %} +
+ {%- endif -%} + {% endfor %} +{%- else -%} + + {%- assign sorted_projects = site.projects | sort: "importance" -%} + + {% if page.horizontal -%} +
+
+ {%- for project in sorted_projects -%} + {% include projects_horizontal.html %} + {%- endfor %} +
+
+ {%- else -%} +
+ {%- for project in sorted_projects -%} + {% include projects.html %} + {%- endfor %} +
+ {%- endif -%} +{%- endif -%}
diff --git a/_pages/publications.md b/_pages/publications.md index 58634bd53fc1..9254ad1cd041 100644 --- a/_pages/publications.md +++ b/_pages/publications.md @@ -6,10 +6,10 @@ description: publications by categories in reversed chronological order. generat years: [1956, 1950, 1935, 1905] nav: true --- - +
-{% for y in page.years %} +{%- for y in page.years %}

{{y}}

{% bibliography -f papers -q @*[year={{y}}]* %} {% endfor %} diff --git a/_plugins/beautify.rb b/_plugins/beautify.rb new file mode 100644 index 000000000000..3831c8048be7 --- /dev/null +++ b/_plugins/beautify.rb @@ -0,0 +1,27 @@ +require 'htmlbeautifier' + +module Jekyll + module StripHTML + def beautify(content) + if beautify_enabled? + content = HtmlBeautifier.beautify(content) + else + content + end + end + + private + + def beautify_enabled? + config = @context.registers[:site].config + true?(config['beautify']) + end + + def true?(obj) + obj.to_s.downcase == 'true' + end + + end +end + +Liquid::Template.register_filter(Jekyll::StripHTML) diff --git a/_plugins/minify.rb b/_plugins/minify.rb new file mode 100644 index 000000000000..23c8bf611ec5 --- /dev/null +++ b/_plugins/minify.rb @@ -0,0 +1,28 @@ +# Source: https://www.ffbit.com/blog/2021/03/17/html-minification-in-jekyll.html +require 'htmlcompressor' + +module Jekyll + module MinifyFilter + def minify(content) + if minify_enabled? + compressor = HtmlCompressor::Compressor.new + compressor.compress content + else + content + end + end + + private + + def minify_enabled? + config = @context.registers[:site].config + true?(config['minify']) + end + + def true?(obj) + obj.to_s.downcase == 'true' + end + end +end + +Liquid::Template.register_filter(Jekyll::MinifyFilter)