mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 20:55:21 +00:00
Fetch serverside
This commit is contained in:
parent
5c1164db8f
commit
845b58cf91
@ -1,6 +1,13 @@
|
||||
require("dotenv").config();
|
||||
let themeStyle = "";
|
||||
if (process.env.THEME) {
|
||||
fetch(process.env.THEME).then(response => response.text()).then(text => {
|
||||
themeStyle = "<style>" + text + "</style>";
|
||||
});
|
||||
}
|
||||
module.exports = {
|
||||
env: process.env.ELEVENTY_ENV,
|
||||
theme: process.env.THEME,
|
||||
themeStyle: themeStyle,
|
||||
baseTheme: process.env.BASE_THEME || "dark"
|
||||
};
|
@ -20,12 +20,8 @@
|
||||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
|
||||
<link href="/styles/style.css" rel="stylesheet">
|
||||
{%-if meta.theme%}
|
||||
<script>
|
||||
fetch("{{meta.theme}}").then(response => response.text()).then(text => {
|
||||
document.head.innerHTML += "<style>" + text + "</style>";
|
||||
});
|
||||
</script>
|
||||
{%-if meta.themeStyle%}
|
||||
{{meta.themeStyle}}
|
||||
{%endif%}
|
||||
<link href="/styles/custom-style.css" rel="stylesheet">
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user