Closed joeroe closed 3 years ago
I started working on this earlier in the week but have since become occupied with other work. The process I've been using so far is definitely similar to what you're proposing. However, I've been reverse-engineering the theme's taxonomy (https://github.com/htr3n/hyde-hyde) without a full understanding of it or of Hugo, rather than creating a taxonomy from scratch, which has made the work confusing.
If you're willing to try refactoring this then go for it! I just created a branch called hugo-taxonomy, which includes some of the work I've done so far. Here are some notes:
The first problem is just that csv2md.R
was only generating .md files for the first 25 records, because seq_along(x)
counts the number of columns, not rows.
I've refactored and got things mostly working, bar some tweaks, at https://github.com/joeroe/open-archaeo/tree/hugo-taxonomy. It's still missing the tag index on the sidebar, but I think it should be possible to get hugo to do that, rather than having to generate links manually via R.
Since you've switched to Hugo for the website, it would be relatively* straightforward to use its taxonomy system (https://gohugo.io/content-management/taxonomies/) to let users navigate the list by tag, author, language, etc.
You would have to switch to having one .md file per entry. But those files would still be very simple (example below), so you could probably keep the basic csv -> R -> .md workflow.
The .md files for an entry would need to look something like this:
And then you would simply leave Hugo to automatically generate a formatted list of all entries in index.md, as well as sorted indexes by tag etc.
(Happy to have a go at a pull request if you think it's a good idea @zackbatist!)