-
Notifications
You must be signed in to change notification settings - Fork 28
/
base.pug
55 lines (52 loc) · 2.49 KB
/
base.pug
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
doctype html
html(lang='en')
// see the full source code on github in case you're interested.
head
meta(charset='UTF-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
meta(name='viewport', content='width=device-width, initial-scale=1.0')
//- appending title to name in case it exists, else showing name as the title of the page
- const pageTitle = meta.title ? `${meta.title} | Quetre`: 'Quetre'
title= pageTitle
meta(name="description", content=meta.description)
//- preloading css and fonts for performance gains
link(rel='preload', href='/fonts/WorkSans.woff2', as='font', type='font/woff2', crossorigin)
link(rel='preload', href='/fonts/Quicksand.woff2', as='font', type='font/woff2', crossorigin)
link(rel='preload stylesheet', href='/css/styles.css', as='style', crossorigin)
//- favicons & theme color
meta(name="theme-color", media="(prefers-color-scheme: light)", content="#e3f6f5")
meta(name="theme-color", media="(prefers-color-scheme: dark)", content="#0f0d1c")
link(rel="icon", href="/icon.svg", type="image/svg+xml")
link(rel='icon', href='/favicon.ico', sizes='any')
link(rel="apple-touch-icon", href="/apple-touch-icon.png")
link(rel="manifest", href="/site.webmanifest")
//- some seo stuff
meta(property='og:url', content=meta.url)
meta(property='og:type', content='website')
meta(property='og:title', content=meta.title)
meta(property='og:description', content=meta.description)
meta(property='og:image', content=meta.imageUrl)
meta(name='twitter:card', content='summary_large_image')
meta(property='twitter:url', content=meta.url)
meta(name='twitter:title', content=pageTitle)
meta(name='twitter:description', content=meta.description)
meta(name='twitter:image', content=meta.imageUrl)
//- own script
script(src='/js/index.js', defer)
//- initially setting this var to false. will update in case an answer contains some math expression
- let someAnswerContainsMath = false;
body.body
-if (title !=='About')
a.skip-link(href="#main") Skip to main content
//- stuff that's visible on page goes here
include _header
block content
p placeholder text
include _footer
//- including mathjax script only when some answer has math expressions(using the var from above)
if someAnswerContainsMath
script#MathJax-script(
type='text/javascript',
src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js',
async
)