Added support for dates of articles. :)

This commit is contained in:
BurnyLlama 2021-08-08 18:32:09 +02:00
parent 53bd81a8af
commit 7fa8f0b308
4 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,11 @@ article > header {
margin-bottom: 2rem; margin-bottom: 2rem;
} }
article > header > i {
color: var(--accent);
display: block;
}
.toc-container { .toc-container {
grid-area: toc; grid-area: toc;
display: grid; display: grid;

View File

@ -1,6 +1,7 @@
%%- %%-
title: qwik cms title: qwik cms
header: qwik cms intro header: qwik cms intro
date: 8th August 2021
-%% -%%
# Introduction # Introduction

View File

@ -10,6 +10,7 @@
<article> <article>
<header> <header>
{{ externalMeta.header }} {{ externalMeta.header }}
<i>{{ externalMeta.date }}</i>
</header> </header>
<div class="toc-container"> <div class="toc-container">

View File

@ -1,6 +1,10 @@
import fs from 'fs'
import { JSDOM } from 'jsdom' import { JSDOM } from 'jsdom'
import { parseExternalContext } from './externalContext.js' import { parseExternalContext } from './externalContext.js'
const ConfigFile = fs.readFileSync('./config.json')
const Config = JSON.parse(ConfigFile)
function generateToc(dom) { function generateToc(dom) {
// Get all ToC anchors from the DOM // Get all ToC anchors from the DOM
const tocAnchors = dom.window.document.querySelectorAll(".toc-anchor") const tocAnchors = dom.window.document.querySelectorAll(".toc-anchor")