serhii.net

In the middle of the desert you can say anything you want

05 Jun 2024

Quarto website creation notes

quarto create project 

Listing pages

---
title: "Blog"
listing:
- id: test-l1
  contents: "blog_posts/*"
  sort: "date desc"
  type: table
  categories: true
- id: test-l2
  contents: "blog_posts/*"
  sort: "date desc"
  type: default
  categories: true
- id: test-l3
  contents: "blog_posts/*"
  sort: "date desc"
  type: grid
  categories: true
---

This will be a test listing page.


## Table listing
::: {#test-l1}
:::


## Default listing
::: {#test-l2}
:::


## Grid listing
::: {#test-l3}
:::
  • Configs
    • each directory can have it’s own _metadata.yml with configs that will be applied to all files in that directory

Publications

To get something like Drew Dimmery - Research or our old wowchemy thingy some magic will be needed.

Doing

---
title: "Publications and Awards"
bibliography: "./publications/papers.bib"
nocite: |
  @*
---

results in a list in a certain CSL format, which is limited — no ways to link videos/slides/… etc.

So likely it’ll be yet another listings view, or how Drew Dimmery - Quarto for an Academic Website did it — papers to YAML with ALL the metadata, then python script (inside quarto qmds, first nice case I see for this!) to convert it into the on-screen form.

And if code — then maybe it’s a conveter package from wowchemy yaml thingy?

OK, then:

  • Concatenate all wowchemy publication files into one large yaml (one-time python thing?)
  • do EJS template for it

(Alternatively — just use the dirs as-is and do no yaml)

Onwards

Creating a publications view


	<% for (let i = 0; i < item['authors'].length; i++) { %>
<%= item['authors'][i] %>,
    <% } %>

Changes in the paper mds

  • Remove markdown from all existing paper md, HTML-only
  • Remove “image” key
  • date is publishing date of the paper, not of its page — publishDate doesn’t exist
  • publicationType: maybe at some point change the int representation into str, as per latest hugo blocks behaviour
  • doi: no URI
  • publication: no In *journal*, just journal

This and only this will be supported:

title: 'Title'
authors:
  - TODO
  - TODO
date: '2010-10-20T00:00:00Z'
doi: 

# Publication name and optional abbreviated publication name.
publication: 'Proceedings of the World Congress on Engineering and Computer Science. Vol. 1'
publication_short: 'WCeCS 2010'

abstract: 'Long abstract'
links:
  - name: TODO Anthology
    url: https://aclanthology.org/L14-1240

url_pdf:
slides:
video:

tags:
  - paper-tag

EDIT: more fields here: hugo-blox-builder/modules/blox-bootstrap/archetypes/publication/index.md at main · HugoBlox/hugo-blox-builder

url_pdf:
url_code:
url_dataset:
url_poster:
url_source:
url_project:
url_slides:
url_video:

Process

Parsing date year

Datetime formatting / customization in ejs - Stack Overflow describes ways to do things with dates in EJS/JS

<%= new Date().getFullYear();%>

OK so I can use JS?

// Works
<%= new Date(item.date).getFullYear() %>

Iconify Icons

I can’t seem to use shortcodes inside html EJS (same as markdown problem I guess?)

But I can use the CSS (and ofc just download the PNG files)

Accessing file path to find its Bibtex

.. in a file inside same dir as paper markdown.

Most horrible thing I’ve ever written but seems to work:

<%= item.path %><br>              
<% let x= item.path.split('/') %> 
<% x.pop() %>                     
<%- x.join('/') %>                
<%- x.join('/') %>/cite.bib       

// ---

<% let x= item.path.split('/'); x.pop(); let biburi =  x.join('/')+'/cite.bib' %>
<a href="<%- biburi %>">
	<%= biburi %>
</a>

(I should just do a lua filter or something at this point)

Anchors

Idea: link from elsewhere directly to the paper in papers

Final system: described in 240618-1448 Quarto publications page and adding anchors

Nel mezzo del deserto posso dire tutto quello che voglio.