Custom document head injection (#2)

* Custom document header injection.
Fixed manifest.json.
Removed "Null minute read".

Signed-off-by: Armored Dragon <publicmail@armoreddragon.com>

* Fixed manifest.json

Signed-off-by: Armored Dragon <publicmail@armoreddragon.com>

* Fixed existing custom_header not being filled on the admin settings page.

Signed-off-by: Armored Dragon <publicmail@armoreddragon.com>

---------

Signed-off-by: Armored Dragon <publicmail@armoreddragon.com>
pull/4/head
Armored Dragon 2024-05-01 05:32:07 -05:00 committed by GitHub
parent fc83b5bbe9
commit 3203fea2f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 58 additions and 13 deletions

View File

@ -26,7 +26,7 @@ let settings = {
CD_JSON: true,
WEBSITE_NAME: "",
PLAUSIBLE_URL: "",
CUSTOM_HEADER: "",
USER_MINIMUM_PASSWORD_LENGTH: 7,

View File

@ -42,6 +42,23 @@
text-align: right;
font-size: 1rem;
}
.page .page-center .setting-list .largeset {
flex-direction: column;
height: -moz-fit-content;
height: fit-content;
}
.page .page-center .setting-list .largeset .value {
width: 100%;
padding: 0.25rem;
box-sizing: border-box;
}
.page .page-center .setting-list .largeset .value textarea {
width: 100%;
margin: auto;
font-size: initial;
resize: vertical;
min-height: 3rem;
}
.page .page-center .setting-list .setting.fit-column {
flex-direction: column;
width: 100%;

View File

@ -47,6 +47,23 @@
}
}
.largeset {
flex-direction: column;
height: fit-content;
.value {
width: 100%;
padding: 0.25rem;
box-sizing: border-box;
textarea {
width: 100%;
margin: auto;
font-size: initial;
resize: vertical;
min-height: 3rem;
}
}
}
.setting.fit-column {
flex-direction: column;
width: 100%;

View File

@ -1,11 +1,10 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<%- include("partials/document-head.ejs") %>
<link rel="stylesheet" type="text/css" href="../css/settings.css" />
<link rel="stylesheet" type="text/css" href="../css/generic.css" />
<script src="/js/generic.js"></script>
<title>Yet-Another-Blog</title>
</head>
<body>
<%- include("partials/header.ejs") %>
@ -61,6 +60,12 @@
<input id="WEBSITE_NAME" value="<%- settings.WEBSITE_NAME -%>" onchange="changeValue(this.id, this)" type="text" />
</div>
</div>
<div class="setting largeset">
<div class="title">Custom head</div>
<div class="value">
<textarea id="CUSTOM_HEADER" onchange="changeValue(this.id, this)" ><%= settings.CUSTOM_HEADER -%></textarea>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<%- include("partials/document-head.ejs") %>
<link rel="stylesheet" type="text/css" href="../css/author.css" />
<link rel="stylesheet" type="text/css" href="../css/generic.css" />
<title>Yet-Another-Blog</title>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<%- include("partials/document-head.ejs") %>
<link rel="stylesheet" type="text/css" href="/css/settings.css" />
<link rel="stylesheet" type="text/css" href="/css/generic.css" />
<script src="/js/generic.js"></script>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<%- include("partials/document-head.ejs") %>
<link rel="stylesheet" type="text/css" href="/css/index.css" />
<link rel="stylesheet" type="text/css" href="/css/generic.css" />
<title>Yet-Another-Blog</title>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<%- include("partials/document-head.ejs") %>
<link rel="stylesheet" type="text/css" href="/css/login.css" />
<link rel="stylesheet" type="text/css" href="/css/generic.css" />
<script src="/js/generic.js"></script>

View File

@ -0,0 +1,4 @@
<meta charset="utf-8" />
<title><%= website_name %></title>
<% if (settings.CUSTOM_HEADER) { %> <%- settings.CUSTOM_HEADER %> <% } %>

View File

@ -5,7 +5,6 @@
<div class="badges">
<div class="info">
<div class="info-blip icon publish-date"><%= post.publish_date ? post.publish_date.toLocaleString('en-US', { dateStyle:'medium'}) : "Unknown Publish Date" %></div>
<div class="info-blip icon reading-time">Null minute read</div>
<% if (logged_in_user) { %>
<!-- -->
<div class="info-blip visibility-flag <%= post.visibility.toLowerCase() %>"><span><%= post.visibility %></span></div>

View File

@ -1,11 +1,11 @@
<!DOCTYPE html>
<html lang="">
<head>
<%- include("partials/document-head.ejs") %>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="../css/post.css" />
<link rel="stylesheet" type="text/css" href="../css/generic.css" />
<script src="/js/generic.js"></script>
<title>Yet-Another-Blog</title>
</head>
<body>
<%- include("partials/header.ejs") %>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<%- include("partials/document-head.ejs") %>
<link rel="stylesheet" type="text/css" href="/css/newPost.css" />
<link rel="stylesheet" type="text/css" href="/css/generic.css" />
<script src="/js/generic.js"></script>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<%- include("partials/document-head.ejs") %>
<link rel="stylesheet" type="text/css" href="/css/index.css" />
<link rel="stylesheet" type="text/css" href="/css/generic.css" />
<script src="/js/generic.js"></script>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<%- include("partials/document-head.ejs") %>
<link rel="stylesheet" type="text/css" href="/css/login.css" />
<link rel="stylesheet" type="text/css" href="/css/generic.css" />
<script src="/js/generic.js"></script>

View File

@ -8,7 +8,10 @@
"register": "/ejs/register.ejs",
"author": "/ejs/author.ejs",
"post": "/ejs/post.ejs",
"postSearch": "/ejs/postSearch.ejs",
"postNew": "/ejs/postNew.ejs",
"settings": "/ejs/login.ejs",
"user-settings": "/ejs/user-settings.ejs"
"user-settings": "/ejs/user-settings.ejs",
"admin-settings": "/ejs/admin-settings.ejs"
}
}