ZL-Asica / Suzu-Blog

A minimalist Next.js blog template, using Markdown for content management and Tailwind CSS for styling.
https://suzu.zla.app
GNU General Public License v3.0
0 stars 0 forks source link

Add error handling for missing or malformed markdown files #10

Open ZL-Asica opened 3 hours ago

ZL-Asica commented 3 hours ago

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

ZL-Asica commented 2 hours ago

Added handling:

  1. md post use utf-8
  2. Remove comments but keep \
  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 commented 2 hours ago

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 commented 1 hour ago

TODO: Add default thumbnail

After the global YAML implemented.