m2h is a Markdown to HTML converter built with Bun and Tailwind CSS. It's designed to generate a static blog from Markdown files.
To install dependencies:
bun installTo run the application, use:
bun run index.tsThis will start the server and serve your blog at localhost:8000.
To generate an index and append it to your index.md post, use:
bun run generator.tsGenerate an RSS feed for all posts with:
bun run feed.tsindex.ts: The main entry point of the application. It sets up the server and handles requests.router.ts: Configures the file system router for serving Markdown files from thepostsdirectory.parser.ts: Contains the logic for converting Markdown to HTML.generator.ts: Generates an index page for the blog by scanning thepostsdirectory for Markdown files.feed.ts: Produces an RSS feed from the posts.styles.css: Contains the Tailwind CSS imports.posts/: This directory should contain your blog posts written in Markdown.
Write your blog posts in Markdown and save them in the posts/ directory. The filename (without the .md extension) will be used as the URL path for the post.
For example, a file named hello-world.md will be accessible at http://localhost:8000/hello-world.
You can customize the appearance of your blog by modifying the Tailwind CSS configuration in tailwind.config.js and the styles in styles.css.
Contributions are welcome. Please open an issue or submit a pull request on GitHub.