user742030
user742030

Reputation:

(Hugo) Load dynamic Content from Raw GitHub

Is there a way to load content into Hugo dynamically from a raw GitHub user content?

e.g.

I if there is an about.md (among other pages) in a repo that is also in the static site but I'd rather not have the duplication and it would help on maintainability.

Upvotes: 3

Views: 901

Answers (1)

bep
bep

Reputation: 1737

Look at the examples for the base64 template functions described here:

https://gohugo.io/templates/functions/

{{ $resp := getJSON "https://api.github.com/repos/spf13/hugo/readme" }} {{ $resp.content | base64Decode | markdownify }}

Upvotes: 7

Related Questions