Quarto website creation notes
quarto create project
Listing pages
- Quarto – Document Listings
- Dates are awkward: Quarto – Quarto Dates and Date Formatting
---
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
- each directory can have it’s own
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?
- Quarto – Custom Listings together with “listing from yaml” may help?..
- Supporting category like feature for listing authors (e.g. filter by author like categories) · Issue #6246 · quarto-dev/quarto-cli TL;DR complex tags work
- EJS – Embedded JavaScript templates is used for templating — looks kinda similar to Hugo
- Meghan Hall describes this and links to Quarto’s own listing templates: quarto-cli/src/resources/projects/website/listing/listing-table.ejs.md at main · quarto-dev/quarto-cli
- (Quarto – Article Templates for the general thing)
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
-
Albert Rapp - The ultimate guide to starting a Quarto blog
- cool tutorial about the basics, including:
- many ways to use listings to create blogs, archive pages, etc. + per-directory options
- layouts to create cool pages e.g. contacts
- include-after-body footers
- styling, incl. scss rules
- page-layouts and complex reactive grids
- cool tutorial about the basics, including:
-
Quarto – Article Layout is my friend — columns, margins, overflows etc.
-
Code/Other links text can be changed here: quarto-cli/src/resources/language/_language.yml at main · quarto-dev/quarto-cli
-
Quarto glob syntax can do a lot: Quarto – Quarto Glob Syntax
-
cool pic sources:
-
sample of including a style in the qmd: quarto-web/docs/gallery/index.qmd at main · quarto-dev/quarto-web
Creating a publications view
-
This convets bibtex into directory+md: GetRD/academic-file-converter: 📚 Import Bibtex publications and Jupyter Notebook blog posts into your Markdown website or book. 将Bibtex转换为Markdown网站
-
Hugo Blox template? hugo-blox-builder/modules/blox-bootstrap/layouts/publication/single.html at main · HugoBlox/hugo-blox-builder
-
Gallery example: https://github.com/quarto-dev/quarto-web/blob/main/docs/gallery/gallery.ejs
- Ex. includes using quarto syntax w/
:::
in a template: quarto-web/ejs/links.ejs at main · quarto-dev/quarto-web
- Ex. includes using quarto syntax w/
-
Would be cool to have the format consistent with the existing quarto infra: quarto-web/docs/journals/authors.qmd at main · quarto-dev/quarto-web
-
EJS
<% for (let i = 0; i < item['authors'].length; i++) { %>
<%= item['authors'][i] %>,
<% } %>
- Problem: full HTML templates don’t accept markdown bits: Markdown not parsed in listings with custom EJS · Issue #8756 · quarto-dev/quarto-cli
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*
, justjournal
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.
-
Problem: no access to filename being rendered!
-
item.filename
is the name, not path. I can’t do “link to file in the same directory as the one being listed” -
Find the name of the current file being rendered in Quarto - General - Posit Community
-
At some point you could use shortcodes in frontmatter: Variables in categories (in frontmatter) do not parse properly when
categories
is set to true in listing · Issue #5578 · quarto-dev/quarto-cli- metadata is the one in the listing page, not the page being listed :(
-
[FR] New Lua utility function to access qmd input filename · Issue #2249 · quarto-dev/quarto-cli
- mcanouil/quarto-lua-env: lua-env is an extension for Quarto to provide access to LUA objects as metadata.
- extension to get access to some vars
- works for not-frontmatter
-
Just realized that for listings
item.path
(=location of page) is just what I need — I just need to change the last element- Split Path String - DEV Community for js path operations
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
- Text fragments
- not supported in firefox
- could write a trivial style and use quarto’s mechanisms for citations but that doesn’t matter because not widely supported
- anchors
- markdown - How to link to a named anchor in Multimarkdown? - Stack Overflow
- completed with anchors, taken from dirname and optionally overwritten by a paper’s front-matter
Final system: described in 240618-1448 Quarto publications page and adding anchors