alshedivat / al-folio

A beautiful, simple, clean, and responsive Jekyll theme for academics
https://alshedivat.github.io/al-folio/
MIT License
11.09k stars 11.19k forks source link

Sort publication by abbr property, e.g., journal paper, conf paper, book, and so on #1264

Open DoHaiSon opened 1 year ago

DoHaiSon commented 1 year ago

Dear alshedivat and other users,

Thank a lot for this beauty publication page, but I wanna something to make it better for viewers.

I really want a new feature such as a button/toggle to re-order the publication page.

  1. Order by year which is available right now.
  2. Order by types of publications abbr property. For example, journal first and then conf. Among them, journals are sorted by public year.

This feature is really helpful when academia often checks journals first and then conf.

jmrplens commented 1 year ago

I have something that I think is what you are looking for. If it is interesting I can make a pull request to add it to the repository. You can see it here: https://jmrplens.github.io/publications/

All you need to do is modify:

_pages/publications.md

---
layout: page
permalink: /publications/
title: Publications
description: Publications about some works that I have done or collaborated with. You can download the documents to read them in full.
sections:
  - bibquery: "@article"
    text: "Journal articles"
  - bibquery: "@inproceedings"
    text: "Conference and workshop papers"
  - bibquery: "@misc|@phdthesis|@mastersthesis"
    text: "Thesis"
years: [2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015]
social: true
nav: true
nav_order: 4
---

<div class="publications">

{%- for section in page.sections %}
  <a id="{{section.text}}"></a>
  <p class="bibtitle">{{section.text}}</p>
  {%- for y in page.years %}

    {%- comment -%}  Count bibliography in actual section and year {%- endcomment -%}
    {%- capture citecount -%}
    {%- bibliography_count -f {{site.scholar.bibliography}} -q {{section.bibquery}}[year={{y}}] -%}
    {%- endcapture -%}

    {%- comment -%} If exist bibliography in actual section and year, print {%- endcomment -%}
    {%- if citecount !="0" %}

      <h2 class="year">{{y}}</h2>
      {% bibliography -f {{site.scholar.bibliography}} -q {{section.bibquery}}[year={{y}}] %}

    {%- endif -%}

  {%- endfor %}

{%- endfor %}

</div>

Create or add this css:

/* Mobile devices. With class="hidden-mobile" the element not show */
@media (max-width: 576px) {
        .hidden-mobile {
          display: none;
        }
        /* Publications - Year display in mobile */
        h2.year {
            color: var(--global-divider-color);
            border-bottom: 1px solid var(--global-divider-color);
            margin-bottom: 2rem!important;
            // reset
            border-top: 0 !important;
            padding-top: 0 !important;
            margin-top: 0 !important;
        }
}

/* Bib type style */
p.bibtitle {
    color: var(--global-theme-color);
        font-weight: 400;
        font-size: 1.5em;
        text-align: center;
        border-bottom: 1px solid #bbb;
}
DoHaiSon commented 1 year ago

Thx jmrplens. That looks cool and exactly what Im looking for. I'll spend time to modify ur code into a toggle in the publication page.

<3.

george-gca commented 1 year ago

@DoHaiSon this might be a good addition to the repo. If you don't mind, send a PR.