Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DoHaiSon opened this issue Mar 16, 2023 · 3 comments

Comments

@DoHaiSon
Copy link
Contributor

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
Copy link
Contributor

jmrplens commented Apr 23, 2023

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
Copy link
Contributor Author

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants