Added support for dates of articles. :)
This commit is contained in:
parent
53bd81a8af
commit
7fa8f0b308
|
@ -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;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
%%-
|
%%-
|
||||||
title: qwik cms
|
title: qwik cms
|
||||||
header: qwik cms intro
|
header: qwik cms intro
|
||||||
|
date: 8th August 2021
|
||||||
-%%
|
-%%
|
||||||
|
|
||||||
# Introduction
|
# Introduction
|
||||||
|
|
|
@ -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">
|
||||||
|
|
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user