Website template for structured, accessible static websites with a Markdown blog, RSS feed and prerendered blog pages. blog-template.liberacode.dev
README.md

blog template #

A starter for multi-route websites of small businesses and personal projects, with a Markdown blog. One HTML shell holds the header and footer, a client-side router renders the pages, and the build prerenders every route as static HTML. Blog posts are Markdown files in content/posts/; a generator turns them into post pages, tag and category pages, pagination and an RSS feed at build time. The template uses semantic HTML, design tokens, modular CSS and small TypeScript modules without a frontend framework. An optional PHP backend handles the contact form.

All layout, styling, behavior and blog generation is code in the repository. The site does not depend on a CMS or on external services. Vite, Biome, marked and gray-matter run only during development and build. The demo includes a home page, a blog with demo posts and categories, layout blocks, interactive patterns, a contact form, media patterns and sample legal pages. The light/dark palette and the [bt] mark are the demo identity of the template.

Requirements #

  • Node.js >=22.18.0 (.nvmrc selects Node 26) and npm
  • Optional, for the contact form: PHP 8.1 or newer on the server, Composer
  • Optional, for new images: ImageMagick 7 with AVIF and WebP support

Setup and commands #

npm ci
npm run dev      # Generate the blog, dev server at http://localhost:5173
npm test         # Unit tests
npm run check    # Lint and format check
npm run build    # Generate the blog, production build in dist/

For production, upload the contents of dist/ to an Apache server; see Deployment.

Documentation #

File Content
Getting started Set up a new project: identity, settings, theme, posts, images, contact
Technical documentation Router, pages, blog generator, CSS, contact backend, build, deployment
Cheat sheet Recipes: remove features, add pages and components, posts and categories

Changes per version are listed in CHANGELOG.md.

Third-party components #

The template code is MIT-licensed. The following parts have their own licenses:

  • Inter and JetBrains Mono: fonts in src/assets/fonts/, SIL Open Font License 1.1. The license texts are next to the font files.
  • Demo images: from Pexels, used under the Pexels license. Replace them with the project's own images. Sources:
    • smiling-brunette-at-office-desk-19747894 (Aathif Aarifeen)
    • code-on-computer-screen-14553730 (Bibek Ghosh)
    • woman-sitting-in-front-laptop-1181677 (Christina Morillo)
    • focused-coding-session-with-laptop-and-coffee-34803969 (Daniil Komov)
    • minimalist-workspace-with-laptop-and-headphones-34803981 (Daniil Komov)
    • home-office-workspace-with-laptop-and-coffee-34803978 (Daniil Komov)
    • photo-of-turned-on-laptop-computer-943096 (Danny Meneses)
    • modern-workspace-with-laptop-and-headphones-36781594 (Jakub Zerdzicki)
    • man-sitting-in-an-office-19805878 (Naboth Otieno)
    • a-modern-home-desk-setup-with-a-computer-and-a-tablet-20694725 (Pew Nguyen)
  • ALTCHA: proof-of-work CAPTCHA of the optional contact form (browser widget and PHP verification), MIT License.
  • PHPMailer: SMTP sending of the optional contact form, installed with Composer, LGPL-2.1 License.
  • marked: Markdown to HTML at build time, MIT License.
  • gray-matter: frontmatter parsing at build time, MIT License.

A site without the contact form does not use the PHP parts of ALTCHA and PHPMailer. marked and gray-matter are not part of the code in the browser.

License #

MIT © liberacode