forked from pantheon-systems/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-browser.js
34 lines (26 loc) · 921 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
import React from "react"
import { location, globalHistory } from "@reach/router"
// custom typefaces
import "prismjs/themes/prism-okaidia.css"
// Code block line numbering
import "prismjs/plugins/line-numbers/prism-line-numbers.css"
// Code block shell prompt
import './src/styles/codeBlocks.css'
// Previous version scripts and styles
// require("/source/docs/assets/js/main.js")
// // TOC generator
import "tocbot/dist/tocbot.css"
import "tocbot/dist/tocbot.min.js"
import "./src/styles/global.scss"
//Segment
export const onRouteUpdate = () => {
window.locations = window.locations || [document.referrer];
locations.push(window.location.href);
window.previousPath = locations[locations.length - 2];
window.analytics && window.analytics.page({
url: window.location.href,
referrer: window.previousPath,
title: document.title
})
//console.log("Title: ", document.title) //For debugging
}