From 01b6581275b8ffea5caea3508bdae52ee13959a8 Mon Sep 17 00:00:00 2001 From: 3nprob <3nprob@3nprob> Date: Thu, 7 Oct 2021 00:51:38 +0900 Subject: [PATCH] Configurable page title --- src/config.ts | 1 + src/handlers.ts | 2 ++ templates/album.pug | 2 +- templates/gallery.pug | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index 3fbe69a..2b011f2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -6,4 +6,5 @@ export default { https_proxy: process.env.RIMGU_HTTPS_PROXY || null, imgur_client_id: process.env.RIMGU_IMGUR_CLIENT_ID || null, disable_comments: process.env.RIMGU_DISABLE_COMMENTS === 'true', + page_title: process.env.RIMGU_PAGE_TITLE || 'rimgu', }; diff --git a/src/handlers.ts b/src/handlers.ts index aec9c3a..e5c565c 100644 --- a/src/handlers.ts +++ b/src/handlers.ts @@ -21,6 +21,7 @@ export const handleAlbum = async (request: Hapi.Request, h: Hapi.ResponseToolkit const url = await fetchAlbumURL(request.params.albumID); return h.view('album', { url, + title: CONFIG.page_title, util, }); }; @@ -44,6 +45,7 @@ export const handleGallery = async (request: Hapi.Request, h: Hapi.ResponseToolk return h.view('gallery', { ...gallery, comments, + title: CONFIG.page_title, util, }); }; diff --git a/templates/album.pug b/templates/album.pug index f0717dd..2c1109e 100644 --- a/templates/album.pug +++ b/templates/album.pug @@ -1,6 +1,6 @@ html head - title imgur-proxy + title #{title} include includes/head.pug body img(src=util.proxyURL(url), alt='' class='album-img') diff --git a/templates/gallery.pug b/templates/gallery.pug index 7770c4d..b0dd378 100644 --- a/templates/gallery.pug +++ b/templates/gallery.pug @@ -34,7 +34,7 @@ mixin commentbox(comment) +commentbox(reply) html head - title imgur-proxy + title #{title} include includes/head.pug body div(class='Gallery-Content')