Compare commits

...

8 Commits

Author SHA1 Message Date
Elio Struyf
704d84454d 1.17.0 2021-06-14 18:20:32 +02:00
Elio Struyf
6d46762e30 #36 - added new option 2021-06-14 18:20:19 +02:00
Elio Struyf
82cf9497ae Merge pull request #32 from estruyf/dependabot/npm_and_yarn/elliptic-6.5.4
Bump elliptic from 6.5.3 to 6.5.4
2021-06-14 18:03:36 +02:00
Elio Struyf
d1563c2c23 Merge pull request #33 from estruyf/dependabot/npm_and_yarn/y18n-4.0.1
Bump y18n from 4.0.0 to 4.0.1
2021-06-14 18:03:27 +02:00
Elio Struyf
7744fdc4b2 Merge pull request #35 from estruyf/dependabot/npm_and_yarn/ssri-6.0.2
Bump ssri from 6.0.1 to 6.0.2
2021-06-14 18:03:18 +02:00
dependabot[bot]
e2042b590a Bump ssri from 6.0.1 to 6.0.2
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-30 03:05:17 +00:00
dependabot[bot]
d8ed7464a1 Bump y18n from 4.0.0 to 4.0.1
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-30 22:54:18 +00:00
dependabot[bot]
cc08ac6f53 Bump elliptic from 6.5.3 to 6.5.4
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-09 16:01:01 +00:00
9 changed files with 52 additions and 6165 deletions

View File

@@ -1,5 +1,9 @@
# Change Log
## [1.17.0] - 2020-06-14
- [#36](https://github.com/estruyf/vscode-front-matter/issues/36): Add the option to change the Front Matter its description field
## [1.16.1] - 2020-05-27
- Fix for Node.js v14.16.0

View File

@@ -139,6 +139,15 @@ Specifies the optimal description length for SEO (set to `-1` to turn it off). D
"frontMatter.taxonomy.seoDescriptionLength": 160
}
```
### `frontMatter.taxonomy.seoDescriptionLength`
Specifies the name of the SEO description field for your page. Default is `description`.
```json
{
"frontMatter.taxonomy.seoDescriptionField": "description"
}
```
### `frontMatter.taxonomy.frontMatterType`

6177
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
"displayName": "Front Matter",
"description": "Simplifies working with front matter of your articles. Useful extension when you are using a static site generator like: Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...",
"icon": "assets/front-matter.png",
"version": "1.16.1",
"version": "1.17.0",
"preview": false,
"publisher": "eliostruyf",
"galleryBanner": {
@@ -137,6 +137,11 @@
"default": 160,
"description": "Specifies the optimal description length for SEO (set to `-1` to turn it off)."
},
"frontMatter.taxonomy.seoDescriptionField": {
"type": "string",
"default": "description",
"description": "Specifies the name of the SEO description field for your page. Default is 'description'."
},
"frontMatter.templates.folder": {
"type": "string",
"default": ".templates",

View File

@@ -1,4 +1,4 @@
import { SETTING_SEO_DESCRIPTION_LENGTH, SETTING_SEO_TITLE_LENGTH } from './../constants/settings';
import { SETTING_SEO_DESCRIPTION_FIELD, SETTING_SEO_DESCRIPTION_LENGTH, SETTING_SEO_TITLE_LENGTH } from './../constants/settings';
import * as vscode from 'vscode';
import { CONFIG_KEY } from '../constants';
import { ArticleHelper, SeoHelper } from '../helpers';
@@ -41,13 +41,14 @@ export class StatusListener {
const config = vscode.workspace.getConfiguration(CONFIG_KEY);
const titleLength = config.get(SETTING_SEO_TITLE_LENGTH) as number || -1;
const descLength = config.get(SETTING_SEO_DESCRIPTION_LENGTH) as number || -1;
const fieldName = config.get(SETTING_SEO_DESCRIPTION_FIELD) as string || "description";
if (article.data.title && titleLength > -1) {
SeoHelper.checkLength(editor, collection, article, "title", titleLength);
}
if (article.data.description && descLength > -1) {
SeoHelper.checkLength(editor, collection, article, "description", descLength);
if (article.data[fieldName] && descLength > -1) {
SeoHelper.checkLength(editor, collection, article, fieldName, descLength);
}
}

View File

@@ -18,6 +18,7 @@ export const SETTING_FRONTMATTER_TYPE = "taxonomy.frontMatterType";
export const SETTING_SEO_TITLE_LENGTH = "taxonomy.seoTitleLength";
export const SETTING_SEO_DESCRIPTION_LENGTH = "taxonomy.seoDescriptionLength";
export const SETTING_SEO_DESCRIPTION_FIELD = "taxonomy.seoDescriptionField";
export const SETTING_TEMPLATES_FOLDER = "templates.folder";
export const SETTING_TEMPLATES_PREFIX = "templates.prefix";

View File

@@ -11,6 +11,7 @@ export interface PanelSettings {
export interface SEO {
title: number;
description: number;
descriptionField: string;
}
export interface Slug {

View File

@@ -11,7 +11,9 @@ export const SeoStatus: React.FunctionComponent<ISeoStatusProps> = (props: React
const { data, seo } = props;
const { title, description } = data;
if (!title && !description) {
const { descriptionField } = seo;
if (!title && !data[descriptionField]) {
return null;
}
@@ -19,7 +21,7 @@ export const SeoStatus: React.FunctionComponent<ISeoStatusProps> = (props: React
<div className="seo__status">
<h3>SEO Status</h3>
{ (title && seo.title > 0) && <SeoDetails title="Title" allowedLength={seo.title} value={title} /> }
{ (description && seo.description > 0) && <SeoDetails title="Description" allowedLength={seo.description} value={description} /> }
{ (data[descriptionField] && seo.description > 0) && <SeoDetails title="Description" allowedLength={seo.description} value={data[descriptionField]} /> }
</div>
);
};

View File

@@ -1,4 +1,4 @@
import { SETTING_CUSTOM_SCRIPTS } from './../constants/settings';
import { SETTING_CUSTOM_SCRIPTS, SETTING_SEO_DESCRIPTION_FIELD } from './../constants/settings';
import * as os from 'os';
import { PanelSettings, CustomScript } from './../models/PanelSettings';
import { CancellationToken, Disposable, Uri, Webview, WebviewView, WebviewViewProvider, WebviewViewResolveContext, window, workspace, commands, env as vscodeEnv } from "vscode";
@@ -220,7 +220,8 @@ export class ExplorerView implements WebviewViewProvider, Disposable {
data: {
seo: {
title: config.get(SETTING_SEO_TITLE_LENGTH) as number || -1,
description: config.get(SETTING_SEO_DESCRIPTION_LENGTH) as number || -1
description: config.get(SETTING_SEO_DESCRIPTION_LENGTH) as number || -1,
descriptionField: config.get(SETTING_SEO_DESCRIPTION_FIELD) as string || "description"
},
slug: {
prefix: config.get(SETTING_SLUG_PREFIX) || "",