Learning Jekyll and hosting through Github Pages I'm trying to figure out how to access a private repo's latest release and cache the download URLs to a Jekyll page. I know how to access the data through the Github API with an access token using AJAX:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
let USER = "grim"
let REPO = "foobar"
let TOKEN = "jsfjksgfjasgdjgsajgasjk"
$.ajax({
url: `https://api.github.com/repos/${USER}/${REPO}/releases/latest?access_token=${TOKEN}`,
jsonp: true,
method: "GET",
dataType: "json",
contentType: 'application/json',
success: function(res) {
console.log(res.assets)
},
error: function(res) {
console.log(res)
}
})
</script>
In the config.yml I'm setting the USER
, REPO
and TOKEN
. My research I did find the Cache API but it isn't listed. Using Github Pages as the host and coded in Jekyll is there a way to get the latest release and cache the response on a private repo with Jekyll? If I cannot cache the API is there a way to store the release URLs on the Jekyll build so I can code it to the buttons so the buttons act as a download?
Research: