Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Slug field gets erased in Front Matter CMS when focusing on Markdown #813

Closed
steelcoder opened this issue May 24, 2024 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@steelcoder
Copy link

Describe the bug
When Front Matter CMS obtains focus while a Markdown file is open, even though fields are properly filled, it tends to erase the slug, resulting in the file being modified.

To Reproduce
Steps to reproduce the behavior:

  1. Open a Markdown file with filled fields.
  2. Open the lateral panel of Front Matter CMS.
  3. Observe that the slug field is erased and quotation marks are added:
    ---
    ...
    - slug: ""
    ...
    ---

Expected behavior
The file should remain unchanged, but properties should be loaded in the Metadata section.

Desktop (please complete the following information):

  • OS: macOS Sonoma (Apple Silicon)
  • Browser: Not applicable
  • Version: v10.1.0

Smartphone (please complete the following information):

  • Device: Not applicable
  • OS: Not applicable
  • Browser: Not applicable
  • Version: Not applicable
@steelcoder steelcoder added the bug Something isn't working label May 24, 2024
@estruyf
Copy link
Owner

estruyf commented May 24, 2024

Thanks, @steelcoder, for opening an issue. This should not be happening indeed, can you share a bit more information, like your configuration and page contents or project/repo? That way I can try to reproduce it on my end to check what is going on.

@steelcoder
Copy link
Author

steelcoder commented May 24, 2024 via email

@estruyf
Copy link
Owner

estruyf commented May 24, 2024

@steelcoder, it seems that the attachment has been removed. It would be better to reply to the GitHub issue itself.

Besides that, would you be able to record a short video to see what the behavior is?

@steelcoder
Copy link
Author

{
"$schema": "https://frontmatter.codes/frontmatter.schema.json",
"frontMatter.taxonomy.contentTypes": [
{
"name": "default",
"defaultFileName": "article",
"filePrefix": null,
"pageBundle": true,
"previewPath": null,
"postScript": "create-structure",
"fields": [
{
"title": "Title",
"name": "title",
"type": "string",
"required": true,
"description": "SEO Title of the Article"
},
{
"title": "Slug",
"name": "slug",
"type": "slug",
"editable": true,
"default": "{{slug}}",
"required": true,
"description": "Website Article Path (Only lowercase a-z, 0-9 and hyphens)"
},
{
"title": "Description",
"name": "description",
"type": "string",
"required": true,
"description": "SEO Description of the Article"
},
{
"title": "Focus Keywords",
"name": "focus_keywords",
"type": "string",
"description": "Keywords to Find the Post (Keep Empty to Auto-Generate)"
},
{
"title": "Featured Media",
"name": "featured_media",
"type": "image",
"required": true,
"description": "Highlighted Visual Content"
},
{
"title": "Featured Media Description",
"name": "featured_media_description",
"type": "string",
"description": "Featured Media Description (Takes Priority Over Media Library)"
},
{
"title": "Featured Media Title",
"name": "featured_media_title",
"type": "string",
"description": "Featured Media Title (Keep Empty to Auto-Generate)"
},
{
"title": "Categories",
"name": "categories",
"type": "categories",
"taxonomyLimit": 1,
"required": true
},
{
"title": "Tags",
"name": "tags",
"type": "tags",
"description": "Select All Relevant Tags for the Article"
},
{
"title": "keywords",
"name": "keywords",
"type": "list",
"description": "Most Relevant Keywords for SEO Ordered By Importance"
},
{
"title": "Author",
"name": "author",
"type": "choice",
"default": "8",
"required": true,
"choices": [
{
"id": "8",
"title": "Author 1"
},
{
"id": "9",
"title": "Author 2"
}
],
"description": "Author ID of the Article on the Website"
},
{
"title": "Status",
"name": "status",
"type": "draft",
"default": "draft",
"required": true
},
{
"title": "Publish Date",
"name": "published",
"type": "datetime",
"isPublishDate": true,
"when": {
"fieldRef": "status",
"operator": "eq",
"value": "published"
}
},
{
"title": "Language",
"name": "lang",
"type": "choice",
"choices": [
"fr",
"en"
],
"default": "fr",
"required": true
}
]
},
{
"name": "doc",
"filePrefix": null,
"pageBundle": false,
"previewPath": null,
"fields": [
{
"title": "type",
"name": "type",
"type": "string",
"default": "doc",
"hidden": true
},
{
"title": "Language",
"name": "lang",
"type": "choice",
"choices": [
"fr",
"en"
],
"default": "fr",
"required": true
}
]
}
],
"frontMatter.file.preserveCasing": true,
"frontMatter.taxonomy.seoDescriptionLength": 120,
"frontMatter.framework.id": "other",
"frontMatter.content.publicFolder": "",
"frontMatter.taxonomy.dateFormat": "yyyy-MM-dd",
"frontMatter.content.draftField": {
"name": "status",
"type": "choice",
"choices": [
"draft",
"packaged",
"published"
]
},
"frontMatter.content.pageFolders": [
{
"title": "Ecostylia",
"path": "[[workspace]]",
"contentTypes": [
"default"
]
}
],
"frontMatter.dashboard.openOnStart": false,
"frontMatter.sponsors.ai.enabled": false,
"frontMatter.custom.scripts": [
{
"id": "create-structure",
"title": "Create Doc & Glossary",
"script": "./.frontmatter/config/custom/scripts/create-structure.js",
"command": "node"
},
{
"title": "Create media.xlsx from the post",
"command": "node",
"script": "./.frontmatter/config/custom/scripts/import-media-from-md.js"
},
{
"title": "Update Media Library from media.xlsx",
"command": "node",
"script": "./.frontmatter/config/custom/scripts/update-media-db-from-media-list.js"
},
{
"title": "Package",
"command": "bash",
"script": "./.frontmatter/config/custom/scripts/launch-package.sh",
"environments": [
{
"type": "windows",
"command": "powershell",
"script": "./.frontmatter/config/custom/scripts/launch-package.ps1"
}
]
},
{
"title": "Publish & Notify",
"command": "bash",
"script": "./.frontmatter/config/custom/scripts/launch-publish-notify.sh",
"environments": [
{
"type": "windows",
"command": "powershell",
"script": "./.frontmatter/config/custom/scripts/launch-publish-notify.ps1"
}
]
},
{
"title": "Publish",
"command": "bash",
"script": "./.frontmatter/config/custom/scripts/launch-publish.sh",
"environments": [
{
"type": "windows",
"command": "powershell",
"script": "./.frontmatter/config/custom/scripts/launch-publish.ps1"
}
]
}
],
"frontMatter.snippets.wrapper.enabled": false,
"frontMatter.content.snippets": {
"Embed": {
"description": "",
"body": [
"block", "type: embed", "url: [[&url]]", "caption: \"[[caption]]\"", ""
],
"fields": [
{
"name": "url",
"title": "Url",
"type": "string",
"required": true,
"single": true
},
{
"name": "caption",
"title": "caption",
"type": "string",
"required": false,
"default": ""
}
],
"isMediaSnippet": false
}
}
}

@estruyf
Copy link
Owner

estruyf commented May 24, 2024

@steelcoder I checked the configuration. The reason there is an update when you open the panel is the default property, which is set on the slug field. The update only happens when there is no slug set on the page.

Screen.Recording.2024-05-24.at.21.16.42.mov

@steelcoder
Copy link
Author

steelcoder commented May 24, 2024 via email

@estruyf
Copy link
Owner

estruyf commented May 24, 2024

I'm not able to reproduce it, would you be able to give me some sample data/files?

Would you be able to record the file update like I did?

@estruyf
Copy link
Owner

estruyf commented May 28, 2024

@steelcoder, do you have an update for me?

@steelcoder
Copy link
Author

steelcoder commented May 28, 2024 via email

@estruyf
Copy link
Owner

estruyf commented May 28, 2024

@steelcoder, that is what I thought. It was more on the questions I asked before:

I'm unable to reproduce it. Would you be able to give me some sample data/files?

Would you be able to record the file update like I did?

@estruyf
Copy link
Owner

estruyf commented Aug 14, 2024

Closing the issue due to no response.

@estruyf estruyf closed this as completed Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants