- HTML 47.1%
- Jinja 17.3%
- JavaScript 16.1%
- Python 12.7%
- CSS 6.8%
The goal of this change is to deduplicate all custom templates that are in use for taxonomy pages.
This commit defines the entrypoint for any taxonomy list page to be the 'layouts/taxonomy.html' template,
and removes all taxonomy-specific templates (e.g. 'layouts/publications/taxonomy.html'). Per-taxonomy
page customization are now handled via new partials and with front matter configuration via 'params'.
Any given taxonomy list page can now be customized to do the following:
- show all terms vs only terms that have a metadata-generated '_index.md' page (via '.Params.title')
- list items in a grid vs list items vertically
- include vs exclude filtering functionality (inclusion assumes the vertical list layout)
- specify which filter fields to use (e.g. 'kind', 'topic', 'year'), if filtering functionality is active
- specify which fields to include in the text search functionality, if filtering functionality is active
Customization happens in the '_index.md' page of any given taxonomy content directory.
For example 'content/publications/_index.md':
---
title: Publications
params:
list_variant: vertical # grid (default) | vertical (if filter == true, list_variant is set to vertical)
items: generated # generated (default) | all
filter: true # false (default) | true
filter_fields: # no default
- kind
- topic
- year
search_fields: # default: kind, topic, year, author, title
- kind
- topic
- year
- author
- title
---
And partials are then rendered based on this configuration.
Main configuration introduced with this commit:
- persons: grid view (default)
- objectives: grid view (default)
- projects: grid view (default)
- publications: filter view
- datasets: filter view
- instruments: filter view
The main repo README is updated with a description of this configuration and template pattern
TODO:
- add some partials for the parts that are displayed on a list item (e.g. the list of authors, the topics,
the icon-links, etc); and perhaps also configuration variables for their inclusion/exclusion
- Improved logic for selecting depictions; the current depiction registration workflow registers files
with names derived from the depiction kind, e.g. 'logo.png' or 'portrait.webp'. These are generally for
different purposes, and the logic might want to prefer a specific kind for a specific taxonomy, e.g.
'portrait' for 'persons', or 'logo' for 'instrument'.
- Update filtering-related code to make better use of hugo templating functionality; some aspects are still
hardcoded, e.g. 'data-*' for setting the list-item data values.
- Apply similar improvements to the 'term.html' template as done above for 'taxonomy.html'
|
||
|---|---|---|
| .datalad | ||
| .forgejo | ||
| archetypes | ||
| assets | ||
| code | ||
| config/_default | ||
| content | ||
| layouts | ||
| page_templates | ||
| static | ||
| themes | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| package.json | ||
| README.md | ||
Metadata-based website of the Psychoinformatics group
This website is using hugo to build site content that is (mostly) pulled from a metadata system, using a formal metadata model for all content.
This repository should not see any manual content edits. All custom editing is constraint to the presentation (looks/style). Content changes are exclusively done via editing the respective records in the underlying metadata system.
Requirements
As per congo theme version 2.12.0 (2025-06-22), hugo 0.146.0 or later is required.
Setup notes
Hugo doesn't like symlinks (cheers windows!). Hence all files are annexed in
unlocked mode (git annex config --set annex.addunlocked true).
Development and maintenance
Update the navigation graph
The navigation graph is render by a dedicated JS blob that is built from https://hub.psychoinformatics.de/orinoco/things-graph-renderer
Making node/edge styling changes currently need to be done in the JS sources.
The JS code reads the graph from static/graph.json. This file is generated by
code/pool2graph.py. Choice of node and edge types to consider for the navigation
graph is done at the top of this file.
Layout templates
Taxonomy list pages can be customized to present terms in different formats by specifying
configuration properties in the taxonomy-specific _index.md page front matter. Technically,
this is done by using the layouts/taxonomy.html template as the main entrypoint for a taxonomy
list page rendering, which in turn renders specific partials driven by configuration.
Any given taxonomy list page can be customized to do the following:
- show all terms vs only terms that have a metadata-generated
_index.mdpage - list items in a grid (with a depiction if available) vs list items vertically
- include vs exclude filtering functionality (inclusion assumes the vertical list layout)
- specify which filter fields to use (e.g.
kind,topic,year), if filtering functionality is active - specify which fields to include in the text search functionality, if filtering functionality is active
An example configuration for the publications taxonomy list (including defaults),
specified in content/publications/_index.md, is:
---
title: Publications
params:
list_variant: vertical # grid (default) | vertical (if filter == true, list_variant is set to vertical)
items: generated # generated (default) | all
filter: true # false (default) | true
filter_fields: # no default
- kind
- topic
- year
search_fields: # default: kind, topic, year, author, title
- kind
- topic
- year
- author
- title
---