r-Techsupport / hyde

A web editor and CMS for Jekyll/git static sites.
GNU General Public License v3.0
4 stars 2 forks source link

Remove the metadata table from markdown rendering #2

Closed zleyyij closed 2 weeks ago

zleyyij commented 1 month ago

Currently, the whole raw markdown file contains a table at the top of the file, roughly in the below format:

---
layout: default
title: Fixing Cleanboot
nav_exclude: false
has_children: false
parent: General Guides
search_exclude: false
last_modified_date: 2023-05-22
---

The implementation for renderMarkdown should switch from directly rendering the markdown to parsing the markdown into a syntax tree, removing the metadata table from that tree (possibly in a way that it can be read from late, may be useful?), and then rendering. This will make it so that the metadata table is not rendered into the preview window.

Work on this could maybe include support for properly rendering certain types of meta styling like {: .warning .warning-icon }. Refer to the marked documentation for adding support for custom markdown.

zleyyij commented 1 month ago

might already be a frontmatter plugin for marked.js