Bootstrap 5 Blog Template with Responsive Navbar and Badges - Blog Post
A simple blog post page built with Bootstrap 5, featuring a dark navbar, responsive layout, and category badges. Ideal for quick blog demos.
By StartBootstrap startbootstrap/startbootstrap-blog-post 255 stars
Introduction
Blog Post is a simple starter template that shows a single blog‑post page built with Bootstrap 5. It includes a dark navigation bar, responsive layout, category badges, a placeholder image and a comment card. The project is intended for beginners who want a ready‑made HTML page that can be customized and extended.
What this project offers
- A ready‑to‑use blog‑post page with modern Bootstrap components.
- Dark navigation bar and responsive grid that works on all screen sizes.
- Category badges and a comment card for a realistic blog look.
- Build system that compiles Pug, SCSS and JavaScript into a ready‑to‑publish
distfolder.
Main features
- Dark navbar – Bootstrap’s
navbar-dark bg-darkclass. - Responsive layout – Uses Bootstrap’s grid system to adapt to mobile, tablet and desktop.
- Category badges – Styled with Bootstrap badge utilities.
- Placeholder image – Simple image placeholder that can be replaced.
- Comment card – Styled card component for showing comments.
- Live preview –
npm startruns Browser‑Sync for automatic reload while editing source files.
Technology stack
- Bootstrap 5 (v5.2.3) – core CSS framework.
- Sass – for SCSS source files.
- PostCSS – for processing compiled CSS.
- Pug – template language for the HTML source.
- Node.js & npm – build tooling.
- Browser‑Sync – development server with live‑reload.
Requirements
- Node.js installed on your machine.
- npm (comes with Node.js).
Installation
- Download the ZIP file
# Download the prepared archive
curl -L -o bootstrap5-blog-post.zip https://github.com/startbootstrap/startbootstrap-blog-post/archive/refs/heads/master.zip
- Extract the archive
unzip bootstrap5-blog-post.zip -d blog-post
cd blog-post/startbootstrap-blog-post-*
- Install dependencies
npm install
- Build the project
npm run build
The build script runs the following steps:
clean– removes the existingdistfolder.build:pug– compilessrc/pug/*.pugto HTML.build:scss– compilessrc/scss/*.scssto CSS.build:scripts– copies JavaScript fromsrc/js.build:assets– copies static assets (e.g., favicon) todist/assets.After the build finishes, the ready‑to‑publish files are in the
distdirectory, with the main page atdist/index.html.
- View the result locally
Open
dist/index.htmlin any web browser:
open dist/index.html # macOS
# or
start dist\index.html # Windows
For a live‑reload development experience, run:
npm start
This launches Browser‑Sync, watches the src folder, rebuilds on changes, and opens the page in your default browser.
Configuration
The project does not require additional configuration files. All build options are defined in the scripts/ folder and invoked through the npm scripts listed in package.json. If you need to change the output paths, edit the corresponding build scripts (build-pug.js, build-scss.js, etc.).
Customizing the project
- HTML – Edit
src/pug/index.pug. After saving, runnpm startornpm run buildto regeneratedist/index.html. - Styles – Modify
src/scss/styles.scss. The SCSS is compiled todist/css/styles.css. - JavaScript – Update
src/js/scripts.js. The file is copied todist/js/scripts.js. - Assets – Replace files in
src/assets(e.g.,favicon.ico). They are copied todist/assetsduring the build.
Because the template uses standard Bootstrap classes, you can add or remove components by following Bootstrap’s documentation.
Project structure
LICENSE
README.md
package.json
package-lock.json
dist/
assets/
favicon.ico
css/
styles.css
js/
scripts.js
index.html
src/
assets/
favicon.ico
pug/
index.pug
scss/
styles.scss
js/
scripts.js
scripts/
build-assets.js
build-pug.js
build-scripts.js
build-scss.js
clean.js
start.js
start-debug.js
…
Tips
- Run
npm startwhile editing source files to see changes instantly in the browser. - Use
npm run build:scssornpm run build:pugindividually if you only need to recompile one type of file. - The
distfolder contains only the files needed for deployment; you can upload its contents to any static‑hosting service (GitHub Pages, Netlify, etc.).
License and attribution
The project is released under the MIT License. See the full license file at the original repository: https://github.com/startbootstrap/startbootstrap-blog-post/blob/master/LICENSE.
When using the template, keep the LICENSE file in your distribution and retain the attribution to the original author as required by the MIT license.
Use this prompt with an AI coding assistant (Claude Code, Cursor, Copilot, ChatGPT and similar).
- Download the ZIP and extract it where your new project will live.
- Download the ZIP and extract it next to your project, so the assistant can read both.
- Fill in the bracketed parts under “About my project”.
- Paste the prompt into your assistant and review each change it proposes.
# Start a new project with Blog Post ## Your task You are a senior frontend engineer. We are building a new project using Blog Post, a starter template built with Bootstrap 5, as the starting point. Keep its design and turn the demo into a clean, real codebase that I can maintain. ## About my project - What I'm building and for whom: [describe it] - Pages I need: [list them] - Stack: [keep it as it is, with its own build, or name one: Vite / Laravel / Next.js / Astro] - Brand: [name, colours, fonts, logo] # Blog Post — project brief ## Source project Blog Post is a starter template that provides a single‑page blog layout built with Bootstrap 5. It includes a dark navigation bar, responsive grid, and badge components. The project is hosted at https://github.com/startbootstrap/startbootstrap-blog-post and is released under the MIT license (see LICENSE). ## Files that matter - **Entry page:** `dist/index.html` – the compiled HTML that loads the stylesheet and script. - **Pages:** only the single page `dist/index.html` (the blog post view). - **Stylesheets:** `dist/css/styles.css` (compiled from `src/scss/styles.scss`). - **Scripts:** `dist/js/scripts.js` (compiled from `src/js/scripts.js`). - **Assets:** `dist/assets/favicon.ico` (copied from `src/assets/`). - **Source templates:** `src/pug/index.pug`, `src/scss/styles.scss`, `src/js/scripts.js`. - **Build configuration:** `package.json` (scripts, dependencies), `scripts/` folder containing the Node build scripts, and the `src/` folder with the source files. ## Setup and build The template requires a build step. Run the following commands in a terminal at the project root: ```bash npm install # install dependencies npm run build # clean, compile Pug, SCSS, JS and copy assets into dist/ npm start # build then launch a local server with live‑reload ``` The production files are placed in the `dist/` directory (`dist/index.html`, `dist/css/styles.css`, `dist/js/scripts.js`, `dist/assets/`). ## How it is put together The layout consists of a dark Bootstrap navbar followed by a container that holds the blog article and a comment card. The same navbar markup is present on the single page; the rest of the page is static HTML generated from the Pug template. - **Bootstrap 5.2.3** provides the grid, navbar, badges, and utility classes. - No additional JavaScript libraries are required; the only custom script is `scripts.js`, which currently contains placeholder code and does not initialise components. - Theme values such as colours and fonts are defined in `src/scss/styles.scss` and compiled into `dist/css/styles.css`. - The project does not include dark‑mode toggles, RTL support, or dynamic component initialisation. ## Watch out for 1. **Bootstrap version mismatch:** The template uses Bootstrap 5 classes (`data-bs-toggle`, `navbar-dark`, etc.). Using a different major version will break the navbar and responsive behaviour. 2. **Global CSS:** `styles.css` is loaded after Bootstrap and may override core Bootstrap styles; custom selectors could affect other elements unintentionally. 3. **CDN vs local assets:** All required assets (Bootstrap CSS/JS) are bundled via the compiled CSS; no external CDN links are present, so ensure the `dist` folder is served correctly. 4. **Script expectations:** `scripts.js` runs after the DOM is loaded but does not check for element existence; adding code that references missing IDs will cause errors. 5. **Asset paths:** The HTML references `assets/favicon.ico` relative to the `dist` folder; moving files without updating the path will break the favicon. ## Verify - [ ] `dist/index.html` loads and displays the navbar, blog header, badge links, image, and article content. - [ ] No console errors appear when the page is opened in a browser. - [ ] The responsive grid collapses correctly at small viewport widths (navbar toggler works). - [ ] Styles from `dist/css/styles.css` are applied and do not override Bootstrap unintentionally. - [ ] The favicon appears from `dist/assets/favicon.ico`. - [ ] Running `npm start` launches a local server that serves the built files and reloads on source changes. - [ ] The MIT license file is present and unchanged. - [ ] No duplicate copies of Bootstrap or other libraries are included in the final `dist` output. # How to work ## Step 1 — Get it running as it is Start from the downloaded ZIP or a clone of the repository. Install the dependencies and start the dev server with the exact commands in "Setup and build" above. Confirm it runs without console errors before changing anything. ## Step 2 — Plan the project with me List the pages and sections of Blog Post to keep, rename or remove for my project, the folder structure you propose for my stack, and where the repeated parts will live. Wait for my OK. ## Step 3 — Build it - Keep the pages I need, remove the rest, and replace the sample content with real content. - Extract repeated parts (header, navigation, footer) into shared partials or components. - Put my brand name, colours and fonts where Blog Post defines its theme (see "How it is put together" above), not as one-off overrides. - Keep Bootstrap's markup patterns and class conventions so the design stays consistent, and don't change its major version unless I ask. ## Step 4 — Polish and launch - Remove demo content and every CSS/JS file nothing uses any more; optimise images. - Check phone, tablet and desktop widths, labels, alt text, keyboard focus and colour contrast. - Run the production build and tell me which folder to deploy. - Keep the license file and credit the author of Blog Post. ## Ground rules Work in small steps and show me each change. Use only the libraries already in the project unless I agree to add one.



