Compare commits

...

4 Commits

Author SHA1 Message Date
Elio Struyf
7392d7ea0d Merge pull request #371 from estruyf/dev 2022-07-13 13:57:22 +02:00
Elio Struyf
9fcc231a7a 8.0.1 2022-07-13 13:52:14 +02:00
Elio Struyf
149703a5df Fix for tags rendering on content cards 2022-07-13 13:52:06 +02:00
Elio Struyf
463455121e Improve media cards 2022-07-13 10:04:52 +02:00
6 changed files with 37 additions and 17 deletions

View File

@@ -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
View File

@@ -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"

View File

@@ -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": {

View File

@@ -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;
};
};

View File

@@ -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() }

View File

@@ -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}>