Skip to content

Commit ebbaeda

Browse files
committed
Add title anchors
1 parent 41f148e commit ebbaeda

File tree

3 files changed

+47
-9
lines changed

3 files changed

+47
-9
lines changed

content/changelog/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
- [#688](https://github.com/estruyf/vscode-front-matter/issues/688): Allow to show the scheduled articles in the content dashboard (filter and group)
1414
- [#690](https://github.com/estruyf/vscode-front-matter/issues/690): Added the ability to filter values in the `contentRelationship` field
1515
- [#700](https://github.com/estruyf/vscode-front-matter/issues/700): Added the `{{pathToken.relPath}}` placeholder for the `previewPath` property
16+
- [#706](https://github.com/estruyf/vscode-front-matter/issues/706): Show the error of scripts failing in the Front Matter output panel
17+
- [#709](https://github.com/estruyf/vscode-front-matter/issues/709): Take "where clause" into account on content creation
18+
- [#710](https://github.com/estruyf/vscode-front-matter/issues/710): Hide child field when parent field its "when clause" is not met, also remove the fields from the content
19+
- [#713](https://github.com/estruyf/vscode-front-matter/issues/713): Add the ability to always use quotes around string values in front matter
1620

1721
### ⚡️ Optimizations
1822

@@ -29,6 +33,11 @@
2933
- [#699](https://github.com/estruyf/vscode-front-matter/issues/699): Changing border theme variable for the dashboard header
3034
- [#703](https://github.com/estruyf/vscode-front-matter/issues/703): Fix retrieval of Astro Collections for `pnpm` projects
3135
- [#704](https://github.com/estruyf/vscode-front-matter/issues/704): Fix `zod` schema script for optional fields
36+
- [#707](https://github.com/estruyf/vscode-front-matter/issues/707): Fix `clearEmpty` issue with `draft` and `boolean` fields which are by default set to `true`
37+
- [#711](https://github.com/estruyf/vscode-front-matter/issues/711): Fix in character mapping in the slug field
38+
- [#712](https://github.com/estruyf/vscode-front-matter/issues/712): Keep the search context when deleting media files
39+
- [#714](https://github.com/estruyf/vscode-front-matter/issues/714): Fix for taxonomy filtering from taxonomy view to content view
40+
- [#718](https://github.com/estruyf/vscode-front-matter/issues/718): Fix JSON schema for the `frontMatter.panel.actions.disabled` setting
3241

3342
## [9.3.1] - 2023-10-27
3443

content/docs/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ title: Introduction
33
slug: ""
44
description: Create, edit, and preview your pages within Visual Studio Code/Gitpod/... Front Matter allows you to keep control of your static site without any external tools.
55
date: 2021-08-30T16:13:00.546Z
6-
lastmod: 2023-03-27T08:12:48.985Z
6+
lastmod: 2023-12-06T13:23:17.866Z
77
weight: 1
88
---
99

1010
# Introduction
1111

1212
## Overview
1313

14-
Are you tired of managing your markdown articles manually? Do you want to simplify
15-
the process of content creation and management? Look no further than the Front Matter
14+
Are you tired of managing your markdown articles manually? Do you want to simplify
15+
the process of content creation and management? Look no further than the Front Matter
1616
extension for Visual Studio Code.
1717

18-
Designed for developers and content creators, Front Matter gives you the power and
19-
control of a full-blown CMS, without the hassle of dealing with servers, websites, or APIs.
20-
With Front Matter, you can create and manage your content directly in Visual Studio Code,
18+
Designed for developers and content creators, Front Matter gives you the power and
19+
control of a full-blown CMS, without the hassle of dealing with servers, websites, or APIs.
20+
With Front Matter, you can create and manage your content directly in Visual Studio Code,
2121
using your favorite tools and workflows.
2222

23-
The extension supports several static-site generators and frameworks, including
23+
The extension supports several static-site generators and frameworks, including
2424
Astro, Hugo, Jekyll, Hexo, NextJs, Gatsby, and more.
2525

2626
![Welcome screen to configure your website][01]

utils/markdownToHtml.ts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ const remarkFm = ({
3737
highlighter: shiki.Highlighter | undefined;
3838
}) => {
3939
return async (tree: any) => {
40+
// Log all elements
41+
// visit(tree, (node) => {
42+
// console.log(node);
43+
// });
44+
4045
visit(tree, "code", (node) => {
4146
if (highlighter) {
4247
const lang = node.lang || "";
@@ -82,11 +87,35 @@ const remarkFm = ({
8287
if (lastChild && lastChild.type === "text") {
8388
let string = lastChild.value.replace(/ +$/, "");
8489
const hId = string.toLowerCase().replace(/\s/g, "-");
85-
if (!node.data) node.data = {};
86-
if (!node.data.hProperties) node.data.hProperties = {};
90+
91+
if (!node.data) {
92+
node.data = {};
93+
}
94+
95+
if (!node.data.hProperties) {
96+
node.data.hProperties = {};
97+
}
98+
8799
node.data.id = node.data.hProperties.id = hId;
88100
node.data.class = node.data.hProperties.class =
89101
"header__offset scroll-mt-24 group";
102+
103+
node.children.push({
104+
type: "link",
105+
title: string,
106+
url: `#${hId}`,
107+
data: {
108+
hProperties: {
109+
class: "hidden group-hover:inline-block",
110+
},
111+
},
112+
children: [
113+
{
114+
type: "html",
115+
value: `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="ml-4 h-6 inline-block"><path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" /></svg>`,
116+
},
117+
],
118+
});
90119
}
91120
});
92121

0 commit comments

Comments
 (0)