mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-03-28 17:42:40 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7392d7ea0d | ||
|
|
9fcc231a7a | ||
|
|
149703a5df | ||
|
|
463455121e |
@@ -1,5 +1,13 @@
|
||||
# Change Log
|
||||
|
||||
## [8.0.1] - 2022-07-13
|
||||
|
||||
### 🐞 Fixes
|
||||
|
||||
- Fix `PSD` media card icon image
|
||||
- Fix missing clipboard icon for the media card action
|
||||
- Fix in tags rendering on content cards
|
||||
|
||||
## [8.0.0] - 2022-07-11 - [Release notes](https://beta.frontmatter.codes/updates/v8.0.0)
|
||||
|
||||
### ✨ New Features
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "vscode-front-matter-beta",
|
||||
"version": "8.0.0",
|
||||
"version": "8.0.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "vscode-front-matter-beta",
|
||||
"version": "8.0.0",
|
||||
"version": "8.0.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"node-fetch": "^2.6.7"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"displayName": "Front Matter",
|
||||
"description": "Front Matter is a CMS that runs within Visual Studio Code. It gives you the power and control of a full-blown CMS while also providing you the flexibility and speed of the static site generator of your choice like: Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...",
|
||||
"icon": "assets/frontmatter-teal-128x128.png",
|
||||
"version": "8.0.0",
|
||||
"version": "8.0.1",
|
||||
"preview": false,
|
||||
"publisher": "eliostruyf",
|
||||
"galleryBanner": {
|
||||
|
||||
@@ -30,20 +30,23 @@ export const Item: React.FunctionComponent<IItemProps> = ({ fmFilePath, date, ti
|
||||
}
|
||||
|
||||
const tagField = settings.dashboardState.contents.tags;
|
||||
let tagsValue = [];
|
||||
|
||||
if (tagField === "tags") {
|
||||
return pageData.fmTags;
|
||||
tagsValue = pageData.fmTags;
|
||||
} else if (tagField === "categories") {
|
||||
return pageData.fmCategories;
|
||||
tagsValue = pageData.fmCategories;
|
||||
} else {
|
||||
tagsValue = pageData[tagField] || [];
|
||||
}
|
||||
|
||||
const tagsValue = pageData[tagField] || [];
|
||||
|
||||
if (Array.isArray(tagsValue)) {
|
||||
if (typeof tagsValue === "string") {
|
||||
return [tagsValue];
|
||||
} else if (Array.isArray(tagsValue)) {
|
||||
return tagsValue;
|
||||
}
|
||||
|
||||
return [tagsValue];
|
||||
return [];
|
||||
}, [settings, pageData]);
|
||||
|
||||
if (view === DashboardViewType.Grid) {
|
||||
@@ -119,4 +122,4 @@ export const Item: React.FunctionComponent<IItemProps> = ({ fmFilePath, date, ti
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
};
|
||||
@@ -248,7 +248,7 @@ export const Item: React.FunctionComponent<IItemProps> = ({media}: React.PropsWi
|
||||
}, [media]);
|
||||
|
||||
const isImageFile = useMemo(() => {
|
||||
if (media.mimeType?.startsWith("image/")) {
|
||||
if (media.mimeType?.startsWith("image/") && !media.mimeType?.startsWith("image/vnd.adobe.photoshop")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -258,12 +258,13 @@ export const Item: React.FunctionComponent<IItemProps> = ({media}: React.PropsWi
|
||||
const path = media.fsPath;
|
||||
const extension = path.split('.').pop();
|
||||
|
||||
let icon = <DocumentIcon className={`h-4/6 text-gray-300 dark:text-vulcan-200`} />;
|
||||
console.log(media);
|
||||
|
||||
if (isImageFile) {
|
||||
return <PhotographIcon className={`h-1/2 text-gray-300 dark:text-vulcan-200`} />;
|
||||
}
|
||||
|
||||
let icon = <DocumentIcon className={`h-4/6 text-gray-300 dark:text-vulcan-200`} />;
|
||||
|
||||
if (isVideoFile) {
|
||||
icon = <VideoCameraIcon className={`h-4/6 text-gray-300 dark:text-vulcan-200`} />;
|
||||
}
|
||||
@@ -384,7 +385,11 @@ export const Item: React.FunctionComponent<IItemProps> = ({media}: React.PropsWi
|
||||
|
||||
<MenuItems widthClass='w-40'>
|
||||
<MenuItem
|
||||
title={<div className='flex items-center'><PencilIcon className="mr-2 h-5 w-5 flex-shrink-0" aria-hidden={true} /> <span>Edit metadata</span></div>}
|
||||
title={(
|
||||
<div className='flex items-center'>
|
||||
<PencilIcon className="mr-2 h-5 w-5 flex-shrink-0" aria-hidden={true} /> <span>Edit metadata</span>
|
||||
</div>
|
||||
)}
|
||||
onClick={updateMetadata}
|
||||
/>
|
||||
|
||||
@@ -409,7 +414,11 @@ export const Item: React.FunctionComponent<IItemProps> = ({media}: React.PropsWi
|
||||
) : (
|
||||
<>
|
||||
<MenuItem
|
||||
title={`Copy media path`}
|
||||
title={(
|
||||
<div className='flex items-center'>
|
||||
<ClipboardIcon className="mr-2 h-5 w-5 flex-shrink-0" aria-hidden={true} /> <span>Copy media path</span>
|
||||
</div>
|
||||
)}
|
||||
onClick={copyToClipboard} />
|
||||
|
||||
{ customScriptActions() }
|
||||
|
||||
@@ -139,9 +139,9 @@ export const Media: React.FunctionComponent<IMediaProps> = (props: React.PropsWi
|
||||
}
|
||||
|
||||
{
|
||||
contentFolders && contentFolders.length > 0 && contentFolders.map(group => (
|
||||
contentFolders && contentFolders.length > 0 && contentFolders.map((group, idx) => (
|
||||
group.folders && group.folders.length > 0 && (
|
||||
<div className={`mb-8`}>
|
||||
<div key={`group-${idx}`} className={`mb-8`}>
|
||||
<h2 className='text-lg mb-8 first-letter:uppercase'>Content folder: <b>{group.title}</b></h2>
|
||||
|
||||
<List gap={0}>
|
||||
|
||||
Reference in New Issue
Block a user