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

Show UI feedback when format / extension are incorrect #25

Open
privatemaker opened this issue Jun 5, 2023 · 1 comment
Open

Show UI feedback when format / extension are incorrect #25

privatemaker opened this issue Jun 5, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@privatemaker
Copy link

I encountered the following issue whereby the config did not show an error (which makes sense) and the UI shows This collection has no entries yet. My collection settings were:

collections:
  - label: "Widgets"
    name: "widgets"
    folder: "content/widgets/"
    extension: "md"
    format: "yaml"

The UX bug (as I would call it) is that Sveltia did not return content in the UI nor inform the user as to why there was no content.

I assumed this is because Sveltia tried to parse the entire file as yaml but since it was a .md + frontmatter file, Sveltia failed silently. Converting the files .yaml and updating extension: "yaml" worked, but incorrect for my SSG.

Changing the value to format: "frontmatter" makes all the data correctly show, as expected 😄

Suggestions

  1. Show user friendly message in UI
## Oops

We found content, but were unable to display it.
Please make sure your settings and files are correct:

folder: "content/widgets/"
extension: "md"
format: yaml
  1. Console log a parsing error (if there is?) such as this so there's a clue.

Relates to #17 but I think is discreet enough to warrant a separate issue and path to resolution.

@kyoshino
Copy link
Member

Agreed! I’ll at least add a collection-level validation in the near future, including those format inconsistencies, duplicate collection names, etc.

@kyoshino kyoshino added the enhancement New feature or request label Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants