www-from-model/README.md
Stephan Heunis 91720317ca
All checks were successful
Deploy on webserver / Build site and deploy on success (push) Successful in 1m12s
Introduce term page template generalizations
Along the same lines as 478015 which introduced a generalization for the taxonomy list page,
this commit generalizes the term page template, so that we can remove all duplicates for
taxonomy-specific layout templates.

Several new partials are introduced that are now used in a term page heading and info section,
specifically for the date, identifiers, links, licenses, and related terms such as persons or
topics. These same partials are also worked into the existing 'taxonomy-list-vertical-item'
partial to remove further redundant code. As part of these changes, new icons were added. Also
content has to be updated to change 'date_created' to 'date' in order to streamline its handling
in the single generalized template. The associated jinja templates were also updated with this
change.

The term page layout can be customized in the same taxonomy's '_index.md' page front matter as
is done for the taxonomy list page customization. Newly introduced options are all sub-properties
of the new 'term' property under 'params':

- 'person_display': When a list of persons are rendered for a given term, what should those
  people be called? This is a string value that defaults to 'Contributors'.
- 'depiction_type': The type of depiction that should be rendered for the given term page (and
  in 'taxonomy-list-vertical-item'), if such a file exists in the term bundle. This expects a
  string that will be matched against image files in the term bundle, and will default to 'depiction'.
  This option is necessary because the depiction registration workflow saves depiction files with
  names representing their types, e.g. 'portrait', 'logo', etc.
- 'show_relations': In which format should term relations be displayed at the bottom of the term page,
  if at all. The default is to display no relations (explicitly: 'none'). Other options include
  'expandable', which will show list of expandable taxonomy groups, each group containing all terms of
  that taxonomy that relate to the current term; and 'congo', which will render the Congo-theme default
  list of related terms.

Here are two example configurations for the term options:

'content/persons/_index.md':
---
title: Persons
params:
  term:
    depiction_type: portrait # portrait | logo | depiction (default)
    show_relations: expandable # expandable | congo | none (default)
---

'content/publications/_index.md':
---
title: Publications
params:
  term:
    person_display: Authors # defaults to 'Contributors'
---

Finally, new config is added to several taxonomy index pages to perform these customizations for terms:
- persons: should render the 'portrait' depiction type and show expandable relations
- publications: display persons as 'Authors'
- instruments: should render the 'logo' depiction type
2026-05-31 23:56:10 +02:00

106 lines
4.2 KiB
Markdown

# 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.md` page
- 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:
```yaml
---
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
---
```
The term template is also customizable in the same taxonomy's `_index.md` page front matter.
Current customization options are:
- `person_display`: When a list of persons are rendered for a given term, what should those people be called?
This is a string value that defaults to `Contributors`.
- `depiction_type`: The type of depiction that should be rendered for the given term page (and taxonomy list page list item),
if such a file exists in the term bundle. This expects a string that will be matched against image files in
the term bundle, and will default to `depiction`. This option is necessary because the depiction registration
workflow saves depiction files with names representing their types, e.g. `portrait`, `logo`, etc.
- `show_relations`: In which format should term relations be displayed at the bottom of the term page, if at all. The default is
to display no relations (explicitly: `none`). Other options include `expandable`, which will show list of
expandable taxonomy groups, each group containing all terms of that taxonomy that relate to the current term;
and `congo`, which will render the Congo-theme default list of related terms.
Here are two example configurations for the term options:
`content/persons/_index.md`:
```yaml
---
title: Persons
params:
term:
depiction_type: portrait # portrait | logo | depiction (default)
show_relations: expandable # expandable | congo | none (default)
---
```
`content/publications/_index.md`:
```yaml
---
title: Publications
params:
term:
person_display: Authors # defaults to 'Contributors'
---
```