Compare commits

..

13 Commits
4.0.0 ... 4.0.1

Author SHA1 Message Date
Elio Struyf
995c6fff2b Merge branch 'dev' 2021-09-24 10:36:51 +02:00
Elio Struyf
c216062537 4.0.1 2021-09-24 10:36:40 +02:00
Elio Struyf
80a27a1e5e Merge branch 'dev' 2021-09-24 10:35:47 +02:00
Elio Struyf
b8f5e10f4b #116 - Fix for not showing the -1 limit on inputs 2021-09-24 10:27:49 +02:00
Elio Struyf
d8bffdcf6c #115 - Fix for updating added categories/tags 2021-09-24 10:24:33 +02:00
Elio Struyf
71c0360523 Remove +1 2021-09-24 10:14:52 +02:00
Elio Struyf
3260c2b3e0 Updated changelog 2021-09-24 10:11:38 +02:00
Elio Struyf
a523c4ab63 #114 - Fix for category/tag provides as string 2021-09-24 10:07:15 +02:00
Elio Struyf
24f69ea819 Adding start 2021-09-24 10:03:47 +02:00
Elio Struyf
12d816b761 #114 - Empty array fix + empty data 2021-09-24 08:45:45 +02:00
Elio Struyf
0e13a3783f Better notification 2021-09-23 08:41:09 +02:00
Elio Struyf
09e5f3aa7f Merge branch 'dev' 2021-09-23 08:10:23 +02:00
Elio Struyf
5991db1a83 Updated banner 2021-09-23 08:09:59 +02:00
10 changed files with 63 additions and 19 deletions

View File

@@ -1,5 +1,11 @@
# Change Log
## [4.0.1] - 2021-09-24
- [#114](https://github.com/estruyf/vscode-front-matter/issues/114): Fix for categories/tags provided as string in YAML
- [#115](https://github.com/estruyf/vscode-front-matter/issues/115): Fix for updating added categories/tags
- [#116](https://github.com/estruyf/vscode-front-matter/issues/116): Fix for not showing the `-1` limit on inputs
## [4.0.0] - 2021-09-22 - [Release Notes](https://beta.frontmatter.codes/updates/v4_0_0)
- [#101](https://github.com/estruyf/vscode-front-matter/issues/101): Date picker available on the metadata section

View File

@@ -1,6 +1,6 @@
<h1 align="center">
<a href="https://beta.frontmatter.codes">
<img alt="Front Matter BETA" src="./assets/frontmatter-beta.png">
<a href="https://frontmatter.codes">
<img alt="Front Matter" src="https://frontmatter.codes/assets/frontmatter-social.png">
</a>
</h1>
@@ -28,8 +28,6 @@
</a>
</h2>
![](./assets/v4.0.0/banner-v2.png)
## What is Front Matter?
Front Matter BETA is an essential Visual Studio Code extension that simplifies working and managing your markdown articles. We created the extension to support many static-site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and more.

View File

@@ -1,6 +1,6 @@
<h1 align="center">
<a href="https://frontmatter.codes">
<img alt="Front Matter" src="./assets/frontmatter-teal-128x128.png">
<img alt="Front Matter" src="https://frontmatter.codes/assets/frontmatter-social.png">
</a>
</h1>
@@ -26,8 +26,6 @@
</a>
</h2>
![](./assets/v4.0.0/banner-v2.png)
## What is Front Matter?
Front Matter is an essential Visual Studio Code extension that simplifies working and managing your markdown articles. We created the extension to support many static-site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and more.

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "vscode-front-matter-beta",
"version": "4.0.0",
"version": "4.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -3,7 +3,7 @@
"displayName": "Front Matter",
"description": "An essential Visual Studio Code extension when you want to manage the markdown pages of your static site like: Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...",
"icon": "assets/frontmatter-teal-128x128.png",
"version": "4.0.0",
"version": "4.0.1",
"preview": false,
"publisher": "eliostruyf",
"galleryBanner": {
@@ -658,4 +658,4 @@
"dependencies": {
"@docsearch/js": "^3.0.0-alpha.40"
}
}
}

View File

@@ -433,7 +433,9 @@ export class ExplorerView implements WebviewViewProvider, Disposable {
}
const article = ArticleHelper.getFrontMatter(editor);
this.pushMetadata(article!.data);
if (article?.data) {
this.pushMetadata(article!.data);
}
}
/**

View File

@@ -1,7 +1,7 @@
import { basename } from "path";
import { extensions, Uri, ExtensionContext } from "vscode";
import { extensions, Uri, ExtensionContext, window, workspace, commands } from "vscode";
import { Folders, WORKSPACE_PLACEHOLDER } from "../commands/Folders";
import { SETTINGS_CONTENT_FOLDERS, SETTINGS_CONTENT_PAGE_FOLDERS, SETTING_DATE_FIELD, SETTING_MODIFIED_FIELD, SETTING_SEO_DESCRIPTION_FIELD, SETTING_TAXONOMY_CONTENT_TYPES } from "../constants";
import { EXTENSION_NAME, GITHUB_LINK, SETTINGS_CONTENT_FOLDERS, SETTINGS_CONTENT_PAGE_FOLDERS, SETTING_DATE_FIELD, SETTING_MODIFIED_FIELD, SETTING_SEO_DESCRIPTION_FIELD, SETTING_TAXONOMY_CONTENT_TYPES } from "../constants";
import { DEFAULT_CONTENT_TYPE_NAME } from "../constants/ContentType";
import { EXTENSION_BETA_ID, EXTENSION_ID, EXTENSION_STATE_VERSION } from "../constants/Extension";
import { ContentType } from "../models";
@@ -39,7 +39,32 @@ export class Extension {
}
if (usedVersion !== installedVersion) {
Notifications.info(`Find out what is new at [v${installedVersion} release notes](https://${this.isBetaVersion() ? 'beta.' : ''}frontmatter.codes/updates)`);
const whatIsNewTitle = `Check the changelog`;
const githubTitle = `Give it a ⭐️`;
const whatIsNew = {
title: whatIsNewTitle,
run: () => {
const uri = Uri.file(`${Extension.getInstance().extensionPath.fsPath}/CHANGELOG.md`);
workspace.openTextDocument(uri).then((() => {
commands.executeCommand("markdown.showPreview", uri)
}));
}
};
const starGitHub = {
title: githubTitle,
run: () => {
commands.executeCommand('vscode.open', Uri.parse(GITHUB_LINK));
}
};
window.showInformationMessage(`${EXTENSION_NAME} has been updated to v${installedVersion} — check out what's new!`, starGitHub, whatIsNew).then((selection => {
if (selection?.title === whatIsNewTitle || selection?.title === githubTitle) {
selection.run();
}
}));
this.setVersion(installedVersion);
}

View File

@@ -5,7 +5,7 @@ import { TaxonomyType } from '../models';
import { SETTING_TAXONOMY_TAGS, SETTING_TAXONOMY_CATEGORIES, CONFIG_KEY } from '../constants';
import { Folders } from '../commands/Folders';
import { join, basename } from 'path';
import { existsSync, readFileSync, writeFileSync } from 'fs';
import { existsSync, readFileSync, watch, writeFileSync } from 'fs';
import { Extension } from './Extension';
export class Settings {
@@ -38,12 +38,22 @@ export class Settings {
* @param callback
*/
public static onConfigChange(callback: (global?: any) => void) {
const projectConfig = Settings.projectConfigPath;
workspace.onDidChangeConfiguration(() => {
callback();
});
// Background listener for when it is not a user interaction
if (projectConfig && existsSync(projectConfig)) {
watch(projectConfig, () => {
callback();
});
}
workspace.onDidSaveTextDocument(async (e) => {
const filename = e.uri.fsPath;
if (Settings.checkProjectConfig(filename)) {
const file = await workspace.openTextDocument(e.uri);
if (file) {

View File

@@ -26,7 +26,7 @@ export const TextField: React.FunctionComponent<ITextFieldProps> = ({limit, labe
let isValid = true;
if (limit && limit !== -1) {
isValid = ((text || "").length < limit);
isValid = ((text || "").length <= limit);
}
return (
@@ -46,7 +46,7 @@ export const TextField: React.FunctionComponent<ITextFieldProps> = ({limit, labe
}} />
{
limit && (text || "").length >= limit && (
limit && limit > 0 && (text || "").length > limit && (
<div className={`metadata_field__limit`}>
Field limit reached {(text || "").length}/{limit}
</div>

View File

@@ -123,7 +123,7 @@ export const TagPicker: React.FunctionComponent<ITagPickerProps> = (props: React
React.useEffect(() => {
if (prevSelected !== crntSelected) {
setSelected(crntSelected);
setSelected(typeof crntSelected === "string" ? [crntSelected] : crntSelected);
}
}, [crntSelected]);
@@ -186,7 +186,12 @@ export const TagPicker: React.FunctionComponent<ITagPickerProps> = (props: React
}
</Downshift>
<Tags values={selected.sort((a: string, b: string) => a.toLowerCase() < b.toLowerCase() ? -1 : 1 )} onRemove={onRemove} onCreate={onCreate} options={options} disableConfigurable={!!disableConfigurable} />
<Tags
values={(selected || []).sort((a: string, b: string) => a.toLowerCase() < b.toLowerCase() ? -1 : 1 )}
onRemove={onRemove}
onCreate={onCreate}
options={options}
disableConfigurable={!!disableConfigurable} />
</div>
);
};