mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-03-28 17:42:40 +01:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
995c6fff2b | ||
|
|
c216062537 | ||
|
|
80a27a1e5e | ||
|
|
b8f5e10f4b | ||
|
|
d8bffdcf6c | ||
|
|
71c0360523 | ||
|
|
3260c2b3e0 | ||
|
|
a523c4ab63 | ||
|
|
24f69ea819 | ||
|
|
12d816b761 | ||
|
|
0e13a3783f | ||
|
|
09e5f3aa7f | ||
|
|
5991db1a83 |
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||

|
||||
|
||||
## 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.
|
||||
|
||||
@@ -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>
|
||||
|
||||

|
||||
|
||||
## 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
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vscode-front-matter-beta",
|
||||
"version": "4.0.0",
|
||||
"version": "4.0.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user