A lightweight static blog template built with HTML, CSS, and JavaScript.
index.html— home page with a list of postspost.html— detail page for individual postsstyles.css— responsive blog stylesscript.js— renders posts and loads the detail pageposts.js— sample blog post data
Important: This blog requires a local static server to work properly. Opening index.html directly in your browser won't load the Markdown posts due to browser security restrictions.
-
Use a static server:
python3 -m http.server 8000(Python 3)python -m SimpleHTTPServer 8000(Python 2)- Or use any static file server (nginx, Apache, etc.)
-
Visit
http://localhost:8000in your browser.
- Add new posts as markdown files inside
_posts/using_templates/post-template.mdas a starting point - Run
node generate-posts.jsto rebuildposts.jsfrom your markdown files - Write post content in markdown files inside
_posts/ - Add frontmatter metadata to each markdown post using the
---block at the top - Add or update
excerpt:in post frontmatter to automatically generate preview text - Generate the RSS feed with
node generate-rss.jsafter updating posts- optionally set
BASE_URLbefore running, for exampleBASE_URL=https://example.com/ node generate-rss.js
- optionally set
- Update the layout in
styles.css - Use the dark mode toggle in the header to switch themes
- Add new pages by copying the existing templates
## RSS Feeds BASE_URL=https://your-site.com/ node generate-rss.js