11ty / eleventy-base-blog

A starter repository for a blog web site using the Eleventy static site generator.
https://eleventy-base-blog.netlify.app/
MIT License
1.19k stars 609 forks source link
blog eleventy eleventy-sample

eleventy-base-blog v8

A starter repository showing how to build a blog with the Eleventy site generator (using the v2.0 release).

Getting Started

  1. Make a directory and navigate to it:
mkdir my-blog-name
cd my-blog-name
  1. Clone this Repository
git clone https://github.com/11ty/eleventy-base-blog.git .

Optional: Review eleventy.config.js and _data/metadata.js to configure the site’s options and data.

  1. Install dependencies
npm install
  1. Run Eleventy

Generate a production-ready build to the _site folder:

npx @11ty/eleventy

Or build and host on a local development server:

npx @11ty/eleventy --serve

Or you can run debug mode to see all the internals.

Features

Demos

Deploy this to your own site

Deploy this Eleventy site in just a few clicks on these services:

Implementation Notes

Content Security Policy

If your site enforces a Content Security Policy (as public-facing sites should), you have a few choices (pick one):

  1. In base.njk, remove <style>{% getBundle "css" %}</style> and uncomment <link rel="stylesheet" href="https://github.com/11ty/eleventy-base-blog/blob/main/{% getBundleFileUrl "css" %}">
  2. Configure the server with the CSP directive style-src: 'unsafe-inline' (less secure).