-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-browser.js
38 lines (33 loc) · 981 Bytes
/
gatsby-browser.js
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
require("prismjs/themes/prism-okaidia.css")
require("prismjs/plugins/line-numbers/prism-line-numbers.css")
import littlefoot from 'littlefoot'
import 'littlefoot/dist/littlefoot.css'
import './src/assets/scss/_progress.scss'
export const onServiceWorkerUpdateReady = () => {
const answer = window.confirm(
`This application has been updated. ` +
`Reload to display the latest version?`
)
if (answer === true) {
window.location.reload()
}
}
export function onRouteUpdate({ location }) {
addLittlefoot()
}
function addLittlefoot() {
const bt = `
<button
aria-controls="fncontent:<%= id %>"
aria-expanded="false"
aria-label="Footnote <%= number %>"
class="littlefoot-footnote__button"
id="<%= reference %>"
rel="footnote"
title="See Footnote <%= number %>"
/>
<%= number %>
</button>
`
littlefoot({buttonTemplate: bt})
}