Skip to content

Commit 3cbb829

Browse files
committed
Adding in GH Pages setup
1 parent a79af53 commit 3cbb829

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-cayman

actions-data-url.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://raw.githubusercontent.com/rajbos/actions-marketplace/rajbos/data/actions-data.json

index.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<html lang="en">
2+
<head>
3+
<script type="text/javascript">
4+
var jsonFileToUrl = 'actions-data-url.txt';
5+
var jsonUrl = 'actions-data.json';
6+
7+
function loadFile(url, isJson, callback) {
8+
var xobj = new XMLHttpRequest();
9+
if (isJson) {
10+
xobj.overrideMimeType("application/json");
11+
}
12+
13+
xobj.open('GET', url, true);
14+
xobj.onreadystatechange = function () {
15+
if (xobj.readyState == 4 && xobj.status == "200") {
16+
// Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode
17+
callback(xobj.responseText);
18+
}
19+
};
20+
xobj.send(null);
21+
}
22+
23+
function init() {
24+
loadFile(jsonFileToUrl, false, function(response) {
25+
console.log('found file with content' + response);
26+
var jsonFileToUrl = response;
27+
28+
loadFile(jsonFileToUrl, true, function(response) {
29+
var json = JSON.parse(response);
30+
31+
for(var index in json.actions) {
32+
var action = json.actions[index];
33+
document.getElementById('main').innerHTML += '<div class="panel">' + action.repoName + '</div><br />';
34+
}
35+
}
36+
)}
37+
)};
38+
39+
40+
</script>
41+
42+
<style>
43+
#main {
44+
border: solid 1px blue;
45+
}
46+
47+
.panel {
48+
border: solid 1px orange;
49+
}
50+
</style>
51+
</head>
52+
53+
<body onload="init()">
54+
<div id="main">
55+
56+
</div>
57+
</body>
58+
</html>

0 commit comments

Comments
 (0)