lxcprojects / keywords

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

Liquid code for _includes folder with Markdown file for transcription and translation #2

Closed egpalazzolo closed 1 year ago

egpalazzolo commented 1 year ago

A few weeks ago, Alex showed us how to use a piece of liquid code to add markdown files from the separate _includes/excerpts folder to the keywords_item.html formatting page. We borrowed the code from his "Frontlines Nurses" project (https://github.com/elotroalex/frontlines/blob/main/_layouts/generic_collection_item.html). I think that maybe it's just a question of surrounding HTML? But we'd like to find a way to get those Markdown files of the transcription and translation added to the individual pages.

jabrah commented 1 year ago

I drew up a quick demo copying the excerpts example in the Frontlines project in my local copy of the Keywords project and it seemed to work! You can see how I added it to the _layouts/generic_collection_item.html: https://github.com/jabrah/keywords/blob/demo/page-excerpts/_layouts/generic_collection_item.html#L66-L69 (just a demo, this code is not in the project GH)

Here's what that demo code looks like on the page, including the bottom part of the image viewer, the metadata, and the top part of the excerpt. I also spot checked a couple of other pages and they seemed to pull the correct excerpts for those pages too.

image

More work could definitely be done to get it integrated more nicely with the rest of the page, but that's easier to iterate on with the excerpts rendering.