lxcprojects / keywords

Kinship and Longing project site
http://docs.k4bl.org/
Other
0 stars 3 forks source link

Should think about how to better handle "excerpts" #49

Closed jabrah closed 1 week ago

jabrah commented 2 weeks ago

The Jekyll site cannot build unless all documents present in the keywords.csv also has an accompanying "excerpt" page. The Jekyll build fails if one of these is missing.

With the Keywords collection, we want to display some transcription and translation information along side the generated metadata view that we get from Wax. We are currently doing this by defining an "excerpt" for the document that shares its pid in the _includes/excerpts folder. With the way Jekyll works, we can't check for the presence of these files and include them only if they exist. On top of that, this isn't exactly what the _includes folder is really intended for.

How can we fix this?

1. Script

We could write a script that can read the CSV and create new excerpt files for each row, if they don't already exist. This would ensure that all necessary files are present at build time and is pretty simple to implement.

2. Move these "excerpts" into _data

In my opinion, the better option is to move all of these excerpts into the _data directory, since it's data anyway. For example, we could move them to _data/<collection>/<pid>.md, maintaining current file names. In this example, they would be moved to _data/keywords/. Now, in the templates, we'd be able to check to see if _data/keywords/<pid>.md exists and include it on the right page, or skip the excerpt if the file is not present.