evidence
evidence copied to clipboard
Support for Markdown Frontmatter
Feature Description
The ability to add frontmatter to the top of a markdown file that is rendered by Evidence, and have it passed through to the
of the evidence pages.Eg in YAML format
---
title: A page title
description: Here is a detailed description of the page that is typically up to 160 characters
og:
title: Title for social
description: Description for social
image: img_for_social.png
---
# Page h1
Here is the start of the page content
Would render in the final page HTML as
<head>
<title>A page title</title>
<meta name="description" content="Here is a detailed description of the page that is typically up to 160 characters"/>
<meta property="og:title" content="Title for social">
<meta property="og:description" content="Description for social">
<meta property="og:image" content="https://www.website.com/path/to/img_for_social.png">
</head>
Goal of Feature
- Better indexing of pages by search engines
- Ability to change how the page appears when shared on Slack, Twitter etc.
Current Solution
Can directly put HTML into a .md page to be processed by svelte
<svelte:head>
<title>A page title</title>
<meta name="description" content="Here is a detailed description of the page that is typically up to 160 characters"/>
</svelte:head>
But the __layout.svelte file will override the title tag to be "Evidence" irrespective. This can (and should) be removed to allow greater control.
Related Issues
- MDsveX supports frontmatter, but requires using MDsveX layouts (rather than svelte layouts)
- https://github.com/pngwn/MDsveX/issues/313
- https://github.com/pngwn/MDsveX/issues/242
- An interesting Svelte layouts + MDsveX implementation