I’d like to create a page/article called ‘regions.’ On this page would be an alphabetically listed set of tags, with an alphabetically listed set of links to blog titles that are associated with that tag. I’m using the middleman-blog template and .erb.
This obviously doesn’t work but I’m thinking something like this:
\---
layout: "custom"
scotch_regions:
- highlands
- islay
- lowlands
\---
articles_tags.scotch_regions.each.sort do |article|
link_to article.title article
end
Tag examples would be: lowlands, highlands, islay.
Blog post titles: "Auchentoshan Three Wood, Dalwhinnie 15, Ardmore Traditional Cask, Laugavulin 16, Laphroaig 10.
What would be displayed:
Highlands
Ardmore Traditional Cask
Dalwhinnie 15
Islay
Laphroaig 10
Laugavulin 16
Lowlands
Auchentoshan Three Wood
I’ve read through most of the Middleman documentation and looked at some of the middleman-blog source. I’m just starting to use this platform and know very little Ruby.
First, is what I’m trying to do possible? I don’t want to beat my head in for nothing.
Second, how do I go about this? I’m not sure what variables to use and the exact ruby code.
Any help appreciated.
Thanks,
Kent