From d18f24945f35fde4e04b29ab27abce93ffbc6a99 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 4 Nov 2024 12:45:50 +0000 Subject: share html head --- src/mixins/head.pug | 10 ++++++++++ src/views/comments.pug | 8 ++------ src/views/index.pug | 11 ++--------- src/views/subs.pug | 8 ++------ 4 files changed, 16 insertions(+), 21 deletions(-) create mode 100644 src/mixins/head.pug (limited to 'src') diff --git a/src/mixins/head.pug b/src/mixins/head.pug new file mode 100644 index 0000000..f7c1baf --- /dev/null +++ b/src/mixins/head.pug @@ -0,0 +1,10 @@ +mixin head() + head + meta(name="viewport" content="width=device-width, initial-scale=1.0") + meta(charset='UTF-8') + title reddit + link(rel="stylesheet", href="/styles.css") + link(rel="preconnect" href="https://rsms.me/") + link(rel="stylesheet" href="https://rsms.me/inter/inter.css") + script(src="https://cdn.dashjs.org/latest/dash.all.min.js") + diff --git a/src/views/comments.pug b/src/views/comments.pug index 9210d96..50c54ec 100644 --- a/src/views/comments.pug +++ b/src/views/comments.pug @@ -1,15 +1,11 @@ include ../mixins/comment include ../mixins/header +include ../mixins/head include ../utils doctype html html - head - meta(charset='UTF-8') - meta(name="viewport" content="width=device-width, initial-scale=1.0") - title reddit - link(rel='stylesheet', href='/styles.css') - script(src="https://cdn.dashjs.org/latest/dash.all.min.js") + +head() script. function toggleDetails(details_id) { var detailsElement = document.getElementById(details_id); diff --git a/src/views/index.pug b/src/views/index.pug index 5367b41..0988b08 100644 --- a/src/views/index.pug +++ b/src/views/index.pug @@ -1,19 +1,12 @@ include ../mixins/post include ../mixins/sub include ../mixins/header +include ../mixins/head include ../utils - var subs = [] doctype html html - head - meta(name="viewport" content="width=device-width, initial-scale=1.0") - meta(charset='UTF-8') - title reddit - link(rel="stylesheet", href="/styles.css") - link(rel="preconnect" href="https://rsms.me/") - link(rel="stylesheet" href="https://rsms.me/inter/inter.css") - script(src="https://cdn.dashjs.org/latest/dash.all.min.js") - + +head() +subMgmt() script. function updateButton(sub) { diff --git a/src/views/subs.pug b/src/views/subs.pug index 2d2ee4f..f7e2b81 100644 --- a/src/views/subs.pug +++ b/src/views/subs.pug @@ -1,14 +1,10 @@ include ../mixins/sub include ../mixins/header +include ../mixins/head doctype html html - head - meta(charset='UTF-8') - meta(name="viewport" content="width=device-width, initial-scale=1.0") - title reddit - link(rel='stylesheet', href='/styles.css') - + +head() +subMgmt() script. function newSubItem(sub) { -- cgit v1.2.3