-
Notifications
You must be signed in to change notification settings - Fork 4
/
404.html
40 lines (34 loc) · 1.66 KB
/
404.html
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
<!doctype html>
<html lang="en">
<head>
<base href="/">
<meta charset=utf-8>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Juncture</title>
<link href="https://v3.juncture-digital.org/images/favicon.svg" rel="icon" type="image/svg+xml"/>
<link href="https://v3.juncture-digital.org/images/favicon.png" rel="icon" type="image/png"/>
<link rel="apple-touch-icon" href="https://v3.juncture-digital.org/images/mobile-icon.png">
</head>
<body>
<main></main>
<script type="module">
// import { mount, getMarkdown, markdownToHtml } from 'https://cdn.jsdelivr.net/npm/[email protected]/js/ghp.js'
import { mount, getMarkdown, markdownToHtml, pathDir, setConfig } from 'https://v3.juncture-digital.org/ghp.js'
let [acct, repo, ...path] = location.pathname.split('/').filter(pe => pe).slice(location.hostname.indexOf('github.io') > -1 ? 1 : 0)
let branch = new URL(location.href).searchParams.get('ref') || 'main'
acct = acct || 'juncture-digital'
repo = repo || '.github'
console.log(acct, repo, branch, path)
pathDir(acct, repo, branch, path).then(resp => {
let baseurl = `/${acct}/${repo}${resp.dir}`
document.head.querySelector('base').href = baseurl
window.jekyll = { site: { baseurl }, source: { owner: acct, repository: repo, branch, dir: resp.dir }, page: resp }
setConfig()
getMarkdown(`${acct}/${repo}/${branch}/${path.join('/')}`).then(markdown => {
window.config.markdown = markdown
mount(document.body.querySelector('main'), markdownToHtml(markdown))
})
})
</script>
</body>
</html>