indiana-university / rivet-docs

Website and documentation for Rivet, Indiana University’s design system for web application development
https://rivet.iu.edu/
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Updated add-on page to fetch README files from add-on repos rather than inline docs #92

Closed scottanthonymurray closed 5 years ago

scottanthonymurray commented 5 years ago

Previously, documentation for Rivet add-ons were duplicated on both the Rivet website and the add-on repo itself.

This PR updates the Rivet add-on directory to fetch an add-on's default branch README file via the GitHub API and embed it into the page.

The API call is made via Hugo's getJSON function. The README file is cached for 10 hours once fetched, preventing rate limiting issues.

The API URL is built by manipulating an add-on's repo front matter property.

An add-on repo must be hosted on github.com for this process to work.