Use hashed URL for arrow button

This commit is contained in:
Cadence Ember 2020-07-16 23:21:24 +12:00
parent 5fc765d8cb
commit f1f24f8c4a
No known key found for this signature in database
GPG Key ID: 128B99B1B74A6412
3 changed files with 6 additions and 6 deletions

View File

@ -187,7 +187,7 @@ module.exports = [
contentType: "application/json", contentType: "application/json",
content: { content: {
title: getPageTitle(post), title: getPageTitle(post),
html: pugCache.get("pug/fragments/post.pug").web({post, settings}) html: pugCache.get("pug/fragments/post.pug").web({post, settings, getStaticURL})
} }
} }
}).catch(error => { }).catch(error => {

View File

@ -19,9 +19,9 @@ mixin post(post, headerWithNavigation)
= `@${post.getBasicOwner().username}` = `@${post.getBasicOwner().username}`
if headerWithNavigation if headerWithNavigation
button(data-previous).navigate-posts button(data-previous).navigate-posts
img(src="/static/img/arrow-circled.svg" alt="Previous post.").icon.previous img(src=getStaticURL("html", "/static/img/arrow-circled.svg") alt="Previous post.").icon.previous
button(data-next).navigate-posts button(data-next).navigate-posts
img(src="/static/img/arrow-circled.svg" alt="Next post.").icon img(src=getStaticURL("html", "/static/img/arrow-circled.svg") alt="Next post.").icon
div.relative-box div.relative-box
div.scrolling-box div.scrolling-box

View File

@ -35,7 +35,6 @@ subdirs("pug", async (err, dirs) => {
await require("../lib/utils/upgradedb")() await require("../lib/utils/upgradedb")()
pinski.setNotFoundTarget("/404") pinski.setNotFoundTarget("/404")
Object.assign(pinski.pugDefaultLocals, {constants})
for (const file of constants.themes.collatedFiles) { for (const file of constants.themes.collatedFiles) {
pinski.addRoute(`/static/css/${file}.css`, `sass/${file}.sass`, "sass") pinski.addRoute(`/static/css/${file}.css`, `sass/${file}.sass`, "sass")
} }
@ -63,8 +62,9 @@ subdirs("pug", async (err, dirs) => {
pinski.addAPIDir("assistant_api") pinski.addAPIDir("assistant_api")
} }
require("pinski/plugins").setInstance(pinski) const plugins = require("pinski/plugins")
plugins.setInstance(pinski)
Object.assign(pinski.pugDefaultLocals, {constants})
Object.assign(passthrough, pinski.getExports()) Object.assign(passthrough, pinski.getExports())
console.log("[.] Server started") console.log("[.] Server started")