-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
41 lines (40 loc) · 1.29 KB
/
Copy pathindex.html
File metadata and controls
41 lines (40 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<html>
<head>
<title>justinasr.github.io</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css">
</head>
<body>
<div id="app" class="container">
<h1 class="mt-4 mb-2" style="text-align: center;">justinasr.github.io</h1>
<ul>
<li><a href="https://github.com/justinasr/justinasr.github.io"><i>Github repo</i></li>
<li v-for="path in paths">
<a :href="path">{{path}}</a>
</li>
</ul>
</div>
<script>
const app = new Vue({
el: '#app',
data: {
paths: [],
},
created (){
const component = this;
$.get('https://api.github.com/repos/justinasr/justinasr.github.io/contents/', function(data) {
const regex = new RegExp('[0-9]{4}-[0-9]{2}-[0-9]{2}-.*\.md');
let paths = data.map(x => x.path).filter(x => regex.test(x)).map(x => x.replace('.md', ''));
paths.sort();
component.paths = paths;
}).fail(function (data) {
console.error(data);
})
},
methods: {
}
})
</script>
</body>
</html>