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

Add error handling for missing or malformed markdown files #10

Closed
ZL-Asica opened this issue Oct 19, 2024 · 4 comments · Fixed by #17
Closed

Add error handling for missing or malformed markdown files #10

ZL-Asica opened this issue Oct 19, 2024 · 4 comments · Fixed by #17
Labels
enhancement New feature or request

Comments

@ZL-Asica
Copy link
Owner

Ensure that the blog gracefully handles missing or improperly formatted markdown files without crashing the site.

@ZL-Asica ZL-Asica added the enhancement New feature or request label Oct 19, 2024
@ZL-Asica
Copy link
Owner Author

Added handling:

  1. md post use utf-8
  2. Remove comments but keep <!--more-->
  3. If the code block no language setting, use plaintext.
  4. If no title is set for the link, use text wrapped in or undefined link title.
  5. If no alt is set for the image, use the title or even undefined image alt.

@ZL-Asica
Copy link
Owner Author

Added handling for frontmatter:

  1. title slice 100 max, a default set file name as the title.
  2. author slice 30 max, default set to the author.
  3. Prevent date and time errors and provide default settings. Use the last edit info as default if the error setting is not set.

@ZL-Asica ZL-Asica linked a pull request Oct 19, 2024 that will close this issue
@ZL-Asica ZL-Asica reopened this Oct 19, 2024
@ZL-Asica
Copy link
Owner Author

TODO: Add default thumbnail

After the global YAML implemented.

Repository owner deleted a comment from github-actions bot Oct 19, 2024
ZL-Asica added a commit that referenced this issue Oct 20, 2024
- Add yaml package to parse config.yml.
- Introduce getConfig as a global utility to access config values.
- Replace hardcoded values across multiple files with config.yml settings.
- Fix issue #10: Default thumbnail now uses the background image from config.
- Extend footer with more social media links and optimize for mobile view.
- Improve SEO: Add custom titles to post pages and update site-wide layout.
- Enable custom JavaScript in <head> and before </body> as defined in config.yml.
- Allow users to define their own comment system with a reserved slot in config.yml.
ZL-Asica added a commit that referenced this issue Oct 20, 2024
- Add yaml package to parse config.yml.
  - Introduce getConfig as a global utility to access config values.
- Replace hardcoded values across multiple files with config.yml
settings.
- Fix issue #10 : Default thumbnail now uses the background image from
config.
- Enable custom JavaScript in <head> and before </body> as defined in
config.yml.
- Allow users to define their own comment system with a reserved slot in
config.yml.

- Improve SEO: Add custom titles to post pages and update the site-wide
layout.
  - Use roobots.ts to generate robots.txt instead of hardcoded. 

- Replace Google Font import with nextjs built in.
- Extend the footer with more social media links and optimize for mobile
view.
- Merge frontmatter process logic into 1 single function.
  - Add logic avoid parsing not md files.
@ZL-Asica
Copy link
Owner Author

Done

TODO: Add default thumbnail

#19

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

Successfully merging a pull request may close this issue.

1 participant