Skip to content

Simple list of Collections + Collection Image (ie. just the top level, "not" the posts) #1790

Answered by pdehaan
koitaki asked this question in General
Discussion options

You must be logged in to vote

What about just doing a global data file with an array of collection names+meta?

Something like a global ./_data/collectionMap.js which has:

module.exports = [
  { "name": "coding",   "image": "/images/thumbnails/coding.jpg", "url": "/coding/" },
  { "name": "language", "image": "...",  "url": "/language/" },
  { "name": "png",      "image": "...",  "url": "/png/" },
  { "name": "resorts",  "image": "...",  "url": "/resorts/" },
  { "name": "skiing",   "image": "...",  "url": "/skiing/" }
];

Possibly don't even need that url property if it's just a slugified version of the topic.
But it's just a simple array, so you can do whatever custom ordering you want, or keep it alphabetical. I thin…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@pdehaan
Comment options

pdehaan May 23, 2021
Collaborator

@koitaki
Comment options

Answer selected by koitaki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants