mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 20:55:21 +00:00
Add support for setting style settings
This commit is contained in:
parent
be33faaba3
commit
f7e92d227c
@ -2,7 +2,7 @@ require("dotenv").config();
|
|||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const crypto = require("crypto");
|
const crypto = require("crypto");
|
||||||
const {globSync} = require("glob");
|
const { globSync } = require("glob");
|
||||||
|
|
||||||
module.exports = async () => {
|
module.exports = async () => {
|
||||||
let baseUrl = process.env.SITE_BASE_URL || "";
|
let baseUrl = process.env.SITE_BASE_URL || "";
|
||||||
@ -20,6 +20,9 @@ module.exports = async () => {
|
|||||||
title: false,
|
title: false,
|
||||||
default: process.env.NOTE_ICON_DEFAULT,
|
default: process.env.NOTE_ICON_DEFAULT,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const styleSettingsCss = process.env.STYLE_SETTINGS_CSS || "";
|
||||||
|
|
||||||
if (process.env.NOTE_ICON_TITLE && process.env.NOTE_ICON_TITLE == "true") {
|
if (process.env.NOTE_ICON_TITLE && process.env.NOTE_ICON_TITLE == "true") {
|
||||||
bodyClasses.push("title-note-icon");
|
bodyClasses.push("title-note-icon");
|
||||||
noteIconsSettings.title = true;
|
noteIconsSettings.title = true;
|
||||||
@ -45,6 +48,10 @@ module.exports = async () => {
|
|||||||
bodyClasses.push("backlinks-note-icon");
|
bodyClasses.push("backlinks-note-icon");
|
||||||
noteIconsSettings.backlinks = true;
|
noteIconsSettings.backlinks = true;
|
||||||
}
|
}
|
||||||
|
if(styleSettingsCss){
|
||||||
|
bodyClasses.push("css-settings-manager");
|
||||||
|
}
|
||||||
|
|
||||||
let timestampSettings = {
|
let timestampSettings = {
|
||||||
timestampFormat: process.env.TIMESTAMP_FORMAT || "MMM dd, yyyy h:mm a",
|
timestampFormat: process.env.TIMESTAMP_FORMAT || "MMM dd, yyyy h:mm a",
|
||||||
showCreated: process.env.SHOW_CREATED_TIMESTAMP == "true",
|
showCreated: process.env.SHOW_CREATED_TIMESTAMP == "true",
|
||||||
@ -60,6 +67,7 @@ module.exports = async () => {
|
|||||||
baseTheme: process.env.BASE_THEME || "dark",
|
baseTheme: process.env.BASE_THEME || "dark",
|
||||||
siteName: process.env.SITE_NAME_HEADER || "Digital Garden",
|
siteName: process.env.SITE_NAME_HEADER || "Digital Garden",
|
||||||
siteBaseUrl: baseUrl,
|
siteBaseUrl: baseUrl,
|
||||||
|
styleSettingsCss
|
||||||
};
|
};
|
||||||
|
|
||||||
return meta;
|
return meta;
|
||||||
|
@ -39,3 +39,11 @@
|
|||||||
<meta name="{{ name }}" content="{{ content }}">
|
<meta name="{{ name }}" content="{{ content }}">
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if meta.styleSettingsCss %}
|
||||||
|
<style>
|
||||||
|
{{ meta.styleSettingsCss | safe }}
|
||||||
|
</style>
|
||||||
|
{% endif %}
|
||||||
|
<style>
|
||||||
|
</style>
|
Loading…
x
Reference in New Issue
Block a user