Skip to content

Accessing repository topics in github pages theme #23326

Answered by DavyCats
DavyCats asked this question in General
Discussion options

You must be logged in to vote

I found an alternative method using the repository description rather than topics, but thanks for the suggestion!

Here is what I’m doing in case anyone is interested :

I’m adding “Category:<label>” at the end of the description and then using this to create arrays of repo names:

{% assign productionReady = '' | split: '' %}
{% assign experimental = '' | split: '' %}

{% for repository in site.github.public_repositories %}
{% assign category = repository.description | split: "Category:" | last %}
{% assign repoName = repository.name | split: '@@@' %}
{% if category == "Production-Ready" %}
{% assign productionReady = productionReady | concat: repoName %}
{% endif %}
{% if category == "Exper…

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants