This is a simple static site generator that converts markdown files into HTML pages. It processes markdown content, applies a template, and generates HTML files to serve a static website.
- Recursively processes markdown files from the
contentdirectory. - Converts markdown to HTML and inserts it into a template.
- Generates HTML files in the
publicdirectory. - Automatically serves the site on
localhost:8888.
- content/: This is where you place your markdown files. You can organize them in subdirectories as needed.
- public/: This is the output directory where the generated HTML files will be stored. It is automatically created and updated by the script.
- static/: Any static assets such as images, stylesheets, or scripts go here. These files will be copied to the
public/folder during generation. - template.html: This is the HTML template used for all pages.
{{ Title }}will be replaced with the page title from your markdown and{{ Content }}with the converted markdown content.
Add your markdown files to the content/ directory. These files can be nested in subdirectories if desired.
To generate the static site, run the following command:
./main.shThis will generate HTML files from your markdown content and copy them into the public/ directory.
After running the script, the site will automatically be served at http://localhost:8888.
- You can refer to the content directory in the repository and the MD files inside it as an example.
- If there are errors during the generation process, check the console for file not found or other error messages.