(New in v0.0.30) You can include custom taxonomy data files to include additional data for each taxonomy term (e.g., author biographies, category descriptions) by creating YAML files in the _includes/yamls/[taxonomy_name]/ directory. For example, if you have a taxonomy called "authors" and you want to add a biography for the author "Richard M Ritviks", you can create a file called _includes/yamls/authors.yaml file and put an id field with the value "someoneCool" (this is the unique id of the author). Then you can use any number of fields you want to include for the author "Richard M Ritviks", including the name as "Name: Richard M Ritviks" field.
Please the following example (created in _includes/yamls/authors.yaml file):
1 2 3 4 5 6 7 | |
Now, you can use {{ taxonomy_yamls.authors.id.someoneCool.Name }} for the name of the author "Richard M Ritviks" in your templates, or {{ taxonomy_yamls.authors.id.someonefunny.Name }} for the name of the author "Adam R Smith" in your templates.
If you want to use a variable to dynamically access the author ID, use bracket notation:
1 2 | |
Note that, to use this feature correctly, your theme needs to have a proper authors.html.jinja2 template file in the templates directory. There, you can use the {{ taxonomy_yaml['id'][taxonomy_term].Name }} syntax to access the data you have added to the YAML file.
(New in v0.0.36) You can include custom data files to include additional data for your website. This can come really handy if you are dealing with structured, repetitive data that you want to include in your website. Currently, both .yaml and .csv files are supported.
CSV files allow you to manage structured, tabular data that can be easily displayed on your website. This is particularly useful for publications, team members, project lists, or any repetitive data.
Step 1: Create your CSV file
Place your CSV file in the _includes/datafiles/ directory. For example, create _includes/datafiles/publications.csv:
1 2 3 | |
Note: You can use markdown formatting (like **bold**) within CSV fields, and it will be rendered properly.
Step 2: Reference data files in frontmatter
In your page's frontmatter, list the CSV files you want to use (in order):
1 2 3 4 5 6 7 | |
Step 3: Use markers in your content
Use the {[!data!]} marker where you want each data file to appear. The first marker uses the first data file, the second marker uses the second data file, and so on:
1 2 3 4 5 6 7 8 9 10 11 | |
Step 4: Create a custom template
Create a custom template (e.g., pubs.html.jinja2) in your theme's templates directory to display the data. Here's an example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
Key features:
{[!data!]} markers will display content only (no heading){[!data!]} markers will display the heading, content, and data| markdown filter to render markdown formatting in CSV fieldsYAML files are ideal for structured data with nested information or when you need more flexibility than CSV provides.
Step 1: Create your YAML file
Place your YAML file in the _includes/datafiles/ directory. For example, create _includes/datafiles/members.yaml:
1 2 3 4 5 6 7 8 9 | |
Important: Each item in the list starts with a dash (-) and fields are indented consistently.
Step 2: Reference in frontmatter and use markers
The usage is identical to CSV files:
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Step 3: Access in templates
YAML data is accessed the same way as CSV data:
1 2 3 4 5 6 | |
YAML vs CSV:
- Use CSV for simple tabular data (publications, events, etc.)
- Use YAML for complex nested data or when you need better readability
- Both work with the same {[!data!]} marker system
You can include one or more supplementary markdown files into one of your main markdown file (i.e, files inside the posts or pages directory, or their sub-directories, that would be finally converted to a proper HTML page) using the {!path/to/file.md!} syntax. This can be useful for reusing common content across multiple pages, including code snippets or examples from external files. For more details, see the Markdown Processing page.