Skip to content

Commit 6ba5335

Browse files
committed
Doc updates
1 parent 1c79227 commit 6ba5335

File tree

15 files changed

+2822
-3100
lines changed

15 files changed

+2822
-3100
lines changed

components/Docs/Markdown.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import { mdxAnnotations } from 'mdx-annotations';
1010

1111
export interface IMarkdownProps {
1212
content: string | undefined;
13+
slug: string | undefined;
1314
}
1415

15-
export const Markdown: React.FunctionComponent<IMarkdownProps> = ({content}: React.PropsWithChildren<IMarkdownProps>) => {
16+
export const Markdown: React.FunctionComponent<IMarkdownProps> = ({content, slug}: React.PropsWithChildren<IMarkdownProps>) => {
1617

1718
const getTitle = (props: any) => {
1819
const title = props?.children.length > 0 ? `${props?.children[0] as string}` : "";
@@ -47,7 +48,7 @@ export const Markdown: React.FunctionComponent<IMarkdownProps> = ({content}: Rea
4748
}
4849

4950
return (
50-
<div className={`markdown`}>
51+
<div className={`markdown ${slug}`}>
5152
{/* eslint-disable react/no-children-prop */}
5253
<ReactMarkdown
5354
components={{

components/Navigation/MobileNavigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { MenuIcon, XIcon } from '@heroicons/react/outline';
33
import * as React from 'react';
44
import { createContext, Fragment, useContext, useState } from 'react';
55
import { Header } from '../Page/Header';
6-
import create from 'zustand';
6+
import { create } from 'zustand';
77
import { GlobalNavigation } from './GlobalNavigation';
88
import { SocialNavigation } from './SocialNavigation';
99
import { DocsNavigation } from './DocsNavigation';

components/Page/CTA.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next';
33
import { Extension } from '../../constants/extension';
44
import { isProduction } from '../../helpers/isProduction';
55
import { FrontMatterLines } from './FrontMatterLines';
6-
const Slide = require('react-reveal/Slide');
76

87
export interface ICTAProps {}
98

@@ -48,15 +47,13 @@ export const CTA: React.FunctionComponent<ICTAProps> = (props: React.PropsWithCh
4847
<div className="sm:mx-auto sm:max-w-3xl sm:px-6">
4948
<div className={`py-12 sm:relative sm:py-16 lg:absolute lg:inset-y-0 lg:right-0 lg:w-1/2`}>
5049
<div className={`relative sm:mx-auto sm:max-w-3xl sm:px-0 lg:-mr-40 lg:max-w-none lg:h-full lg:pl-12`}>
51-
<Slide right>
52-
<img
53-
className={`w-full lg:h-full lg:w-auto lg:max-w-none`}
54-
// src={`https://res.cloudinary.com/estruyf/image/upload/w_1256/v1631871148/frontmatter/preview-3.2.0.png`}
55-
// src={"https://res.cloudinary.com/estruyf/image/upload/w_1256/v1649328023/frontmatter/7.1.0/panel-preview-light.png"}
56-
src={"https://res.cloudinary.com/estruyf/image/upload/w_1256/v1649335002/frontmatter/7.1.0/fm-doc-screenshot.png"}
57-
alt={`Front Matter - Headless CMS - Live page preview`}
58-
loading={`lazy`} />
59-
</Slide>
50+
<img
51+
className={`w-full lg:h-full lg:w-auto lg:max-w-none`}
52+
// src={`https://res.cloudinary.com/estruyf/image/upload/w_1256/v1631871148/frontmatter/preview-3.2.0.png`}
53+
// src={"https://res.cloudinary.com/estruyf/image/upload/w_1256/v1649328023/frontmatter/7.1.0/panel-preview-light.png"}
54+
src={"https://res.cloudinary.com/estruyf/image/upload/w_1256/v1649335002/frontmatter/7.1.0/fm-doc-screenshot.png"}
55+
alt={`Front Matter - Headless CMS - Live page preview`}
56+
loading={`lazy`} />
6057
</div>
6158
</div>
6259
</div>

components/Page/Features.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { features } from '../../constants/features';
44
import { CheckIcon } from '@heroicons/react/outline';
55
import Link from 'next/link';
66
import { Extension } from '../../constants/extension';
7-
const HeadShake = require('react-reveal/HeadShake');
87

98
export interface IFeaturesProps {}
109

@@ -43,15 +42,13 @@ export const Features: React.FunctionComponent<IFeaturesProps> = (props: React.P
4342
{strings(`features_cta_title`) as string}
4443
</p>
4544
<div className="mt-4">
46-
<HeadShake>
47-
<Link
48-
href={Extension.featureLink}
49-
className={`inline-block px-4 py-3 border border-transparent text-base font-medium shadow-sm text-white bg-vulcan-50 hover:bg-opacity-70 sm:px-8`}
50-
target={`_blank`}
51-
rel={`noopener noreferrer`}>
52-
{strings(`features_cta_button`) as string}
53-
</Link>
54-
</HeadShake>
45+
<Link
46+
href={Extension.featureLink}
47+
className={`inline-block px-4 py-3 border border-transparent text-base font-medium shadow-sm text-white bg-vulcan-50 hover:bg-opacity-70 sm:px-8`}
48+
target={`_blank`}
49+
rel={`noopener noreferrer`}>
50+
{strings(`features_cta_button`) as string}
51+
</Link>
5552
</div>
5653
</div>
5754
</div>

components/Page/Hero.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Link from 'next/link';
22
import * as React from 'react';
3-
const Slide = require('react-reveal/Slide');
43

54
export interface IHeroProps {
65
view: "left" | "right";
@@ -49,11 +48,10 @@ export const Hero: React.FunctionComponent<IHeroProps> = ({view, title, descript
4948
<div className={`sm:mx-auto sm:max-w-3xl sm:px-6`}>
5049
<div className={`py-12 sm:relative sm:py-16 lg:absolute lg:inset-y-0 lg:w-1/2 ${view === "left" ? `lg:left-0` : `lg:right-0`}`}>
5150
<div className={`relative sm:mx-auto sm:max-w-3xl sm:px-0 lg:max-w-none lg:h-full ${view === "left" ? `` : `lg:-mr-40 lg:pl-12`}`}>
52-
<Slide left={view === "left"} right={view !== "left"}>
53-
<img className={`w-full lg:h-full lg:w-auto lg:max-w-none ${view === "left" ? `lg:absolute lg:right-0` : ''}`}
54-
src={imgSrc}
55-
alt={imgAlt} />
56-
</Slide>
51+
<img
52+
className={`w-full lg:h-full lg:w-auto lg:max-w-none ${view === "left" ? `lg:absolute lg:right-0` : ''}`}
53+
src={imgSrc}
54+
alt={imgAlt} />
5755
</div>
5856
</div>
5957
</div>

content/changelog/v8.3.0.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ slug: v8.3.0
1313

1414
In this version of VSCode Front Matter now supports external config files, meaning you can store your configurations outside of the extension in a separate file. This allows for better organization and easier management of your configurations, as well as better collaboration with others.
1515

16+
17+
Front Matter has got a fresh new feature that allows you to store your configurations outside of the extension in a separate file. The file can be provided from a local or remote endpoint. Yes, you heard that right! You can now organize and manage your configurations with greater ease and collaborate more seamlessly with others. If you have configurations you want to share with others, you can now do so by simply sharing the URL of the file.
18+
19+
Here you can find an example of a remote config file:
20+
21+
```json
22+
{
23+
"$schema": "https://frontmatter.codes/frontmatter.schema.json",
24+
"frontMatter.extends": [
25+
"https://platen.io/frontmatter/platen.json",
26+
"./config/frontmatter.config.json"
27+
],
28+
...
29+
}
30+
```
31+
32+
> **Info**: Find out more about this feature in the [extending settings](/docs/settings#extending-settings) section.
33+
1634
## Experimental Visual Studio Code theme support
1735

1836
Finally we are introducing "experimental" support for Visual Studio Code themes. The dashboards will now adapt to the colors of your current theme.

content/docs/custom-actions.md

Lines changed: 45 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,30 @@ nothing more than a Node.js script which is referenced from within your project.
1818
![Custom action][01]
1919

2020
<!-- markdownlint-disable MD028 -->
21+
2122
> **Sample**: [Generate open graph preview image in Code with Front Matter][02]
2223
2324
> **Important**: You can add custom actions for your content and media files.
25+
2426
<!-- markdownlint-enable MD028 -->
27+
2528
## The custom action setting
2629

2730
The content and media custom actions can be defined by using the `frontMatter.custom.scripts` setting.
2831

2932
Custom actions can be configured with the following properties:
3033

31-
- `id`: The id of the custom action/script
32-
- `title`: The title of the custom action
33-
- `script`: The path to the script to execute
34-
- `command`: The command to execute. Example: `node`, `path to your node executable`, `bash`,
35-
`python`, ... (default: `node` - optional).
36-
- `type`: The type for which the script will be used. Can be `content`, `mediaFile`, or
37-
`mediaFolder`. (default: `content` - optional).
38-
- `bulk`: Run the script for one file or multiple files. .
39-
- `output`: Specifies the output type (default: `notification` - optional). Available values are:
40-
- `notification`: The output will be passed as a notification.
41-
- `editor`: The output will be passed to the editor.
42-
- `outputType`: Specifies the output type (default: `text` - optional). Available values the editor
43-
values from VS Code like:
44-
- `text`: The output will be passed as a text file.
45-
- `html`: The output will be passed as an HTML file.
46-
- `markdown`: The output will be passed as an Markdown file.
47-
- `hidden`: Hide the action from the UI. This is mostly used when creating a content script that
48-
will be used to post process new content (default: `false` - optional).
34+
| Title | Description | Default |
35+
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
36+
| `id` | The id of the custom action/script | `""` |
37+
| `title` | The title of the custom action | `""` |
38+
| `script` | The path to the script to execute | `""` |
39+
| `command` | The command to execute (optional). Example: `node`, `path to your node executable`, `bash`, `python`, ... | `node` |
40+
| `type` | The type for which the script will be used (optional). <br /><br /> Use one of the following types: `content`, `mediaFile`, or `mediaFolder`. | `content` |
41+
| `bulk` | Run the script for one file or multiple files. | `false` |
42+
| `output` | Specifies the output type (optional). <br /><br /> Available values are: `notification` and `editor`. <br /><br /> `notification`: The output will be passed as a notification. <br /> `editor`: The output will be passed to the editor. | `notification` |
43+
| `outputType` | Specifies the output type (optional). <br /><br /> Available values the editor values from VS Code like: <br /><br /> `text`: The output will be passed as a text file. <br /> `html`: The output will be passed as an HTML file. <br /> `markdown`: The output will be passed as a Markdown file. | `text` |
44+
| `hidden` | Hide the action from the UI. This is mostly used when creating a content script that will be used to post process new content (optional). | `false` |
4945

5046
> **Important**: Previously, you could define the `nodeBin` property to define the path to your node
5147
> executable. This path was needed when you are working with for instance `nvm` and have multiple
@@ -82,11 +78,13 @@ setting for your project as follows:
8278

8379
```json
8480
{
85-
"frontMatter.custom.scripts": [{
86-
"title": "Generate social image",
87-
"script": "./scripts/social-img.js",
88-
"command": "~/.nvm/versions/node/v14.15.5/bin/node"
89-
}]
81+
"frontMatter.custom.scripts": [
82+
{
83+
"title": "Generate social image",
84+
"script": "./scripts/social-img.js",
85+
"command": "~/.nvm/versions/node/v14.15.5/bin/node"
86+
}
87+
]
9088
}
9189
```
9290

@@ -108,7 +106,7 @@ want to update the front matter of your content, you need to provide the data in
108106
format.
109107

110108
```json
111-
{ "frontmatter": { "<field name>": "field value" }}
109+
{ "frontmatter": { "<field name>": "field value" } }
112110
```
113111

114112
Example:
@@ -143,13 +141,15 @@ your project as follows:
143141

144142
```json
145143
{
146-
"frontMatter.custom.scripts": [{
147-
"title": "Generate social image",
148-
"script": "./scripts/social-img.js",
149-
"command": "~/.nvm/versions/node/v16.13.0/bin/node",
150-
"bulk": true,
151-
"output": "editor"
152-
}]
144+
"frontMatter.custom.scripts": [
145+
{
146+
"title": "Generate social image",
147+
"script": "./scripts/social-img.js",
148+
"command": "~/.nvm/versions/node/v16.13.0/bin/node",
149+
"bulk": true,
150+
"output": "editor"
151+
}
152+
]
153153
}
154154
```
155155

@@ -231,28 +231,25 @@ print(f'frontMatterArg: {sys.argv[3]}')
231231
### Optimize image (media file script)
232232

233233
```javascript
234-
const path = require('path');
234+
const path = require("path");
235235

236236
const arguments = process.argv;
237237

238238
(async () => {
239239
if (arguments && arguments.length > 0) {
240-
const imagemin = (await import('imagemin')).default;
241-
const imageminJpegtran = (await import('imagemin-jpegtran')).default;
242-
const imageminPngquant = (await import('imagemin-pngquant')).default;
240+
const imagemin = (await import("imagemin")).default;
241+
const imageminJpegtran = (await import("imagemin-jpegtran")).default;
242+
const imageminPngquant = (await import("imagemin-pngquant")).default;
243243

244244
const fileArg = arguments[3]; // The file path
245245

246246
await imagemin([fileArg], {
247247
destination: path.dirname(fileArg),
248248
glob: false,
249-
plugins: [
250-
imageminJpegtran(),
251-
imageminPngquant()
252-
]
249+
plugins: [imageminJpegtran(), imageminPngquant()],
253250
});
254251

255-
console.log(`Optimized image ${path.basename(fileArg)}`)
252+
console.log(`Optimized image ${path.basename(fileArg)}`);
256253
}
257254
})();
258255
```
@@ -264,29 +261,26 @@ const arguments = process.argv;
264261
### Optimize images in the current folder (media folder script)
265262

266263
```javascript
267-
const path = require('path');
264+
const path = require("path");
268265

269266
const arguments = process.argv;
270267

271268
(async () => {
272269
if (arguments && arguments.length > 0) {
273-
const imagemin = (await import('imagemin')).default;
274-
const imageminJpegtran = (await import('imagemin-jpegtran')).default;
275-
const imageminPngquant = (await import('imagemin-pngquant')).default;
270+
const imagemin = (await import("imagemin")).default;
271+
const imageminJpegtran = (await import("imagemin-jpegtran")).default;
272+
const imageminPngquant = (await import("imagemin-pngquant")).default;
276273

277274
const workspaceArg = arguments[2]; // The workspace path
278275
const folderArg = arguments[3]; // The folder path
279276

280-
const files = await imagemin([path.join(folderArg, '*.{jpg,png}')], {
277+
const files = await imagemin([path.join(folderArg, "*.{jpg,png}")], {
281278
destination: folderArg,
282279
glob: true,
283-
plugins: [
284-
imageminJpegtran(),
285-
imageminPngquant()
286-
]
280+
plugins: [imageminJpegtran(), imageminPngquant()],
287281
});
288282

289-
console.log(`Optimized images: ${files.length}`)
283+
console.log(`Optimized images: ${files.length}`);
290284
}
291285
})();
292286
```
@@ -296,6 +290,7 @@ const arguments = process.argv;
296290
- `npm i imagemin imagemin-jpegtran imagemin-pngquant`
297291

298292
<!-- Link References -->
293+
299294
[01]: /assets/custom-action.png
300295
[02]: https://www.eliostruyf.com/generate-open-graph-preview-image-code-front-matter/
301296
[03]: https://github.com/estruyf/vscode-front-matter/blob/HEAD/sample/script-sample.js

0 commit comments

Comments
 (0)