Experimenting with themes

This commit is contained in:
Ole Eskild Steensen 2022-03-14 23:48:50 +01:00 committed by Ole Eskild Steensen
parent 6d39919a3f
commit 5c1164db8f
5 changed files with 16 additions and 5 deletions

6
src/site/_data/meta.js Normal file
View File

@ -0,0 +1,6 @@
require("dotenv").config();
module.exports = {
env: process.env.ELEVENTY_ENV,
theme: process.env.THEME,
baseTheme: process.env.BASE_THEME || "dark"
};

View File

@ -20,6 +20,13 @@
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script> <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"> <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>
{%endif%}
<link href="/styles/custom-style.css" rel="stylesheet"> <link href="/styles/custom-style.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">

View File

@ -8,7 +8,7 @@ permalink: "notes/{{ page.fileSlug | slugify }}/"
<title>{{ page.fileSlug }}</title> <title>{{ page.fileSlug }}</title>
{%include "components/pageheader.njk"%} {%include "components/pageheader.njk"%}
</head> </head>
<body> <body class="theme-{{meta.baseTheme}} markdown-preview-view">
{%include "components/notegrowthhistory.njk"%} {%include "components/notegrowthhistory.njk"%}
<div class="content"> <div class="content">

View File

@ -4,7 +4,7 @@
<title>{{ title }}</title> <title>{{ title }}</title>
{%include "components/pageheader.njk"%} {%include "components/pageheader.njk"%}
</head> </head>
<body> <body class="theme-{{meta.baseTheme}} markdown-preview-view">
{%include "components/notegrowthhistory.njk"%} {%include "components/notegrowthhistory.njk"%}
<div class="content"> <div class="content">
{%- for garden in collections.gardenEntry -%} {%- for garden in collections.gardenEntry -%}

View File

@ -48,9 +48,7 @@ body {
} }
a { a {
text-decoration: none; text-decoration: underline;
padding-bottom: 3px;
border-bottom: 1px solid rgb(97, 186, 245);
color: rgb(97, 186, 245); color: rgb(97, 186, 245);
} }