Git Product home page Git Product logo

11ty-sia-blog's Introduction

11ty-sia-blog

An Eleventy blog starter forked from eleventy-base-blog but with Sia's opinions.

Preview the starter site here: 11ty-sia-blog.netlify.app/.

A partial list of Sia's changes (opinions):

  • Move all source code to the /src/ directory
  • Move most filters to a separate /src/_11ty/filters.js file to clean up the .eleventy.js config file a bit
  • Adds more filters commonly used by Sia
  • Inline and minify CSS by default (Note: if you have a lot of CSS, you should probably undo this)

Styling changes:

  • More accessible color scheme for code blocks. Uses CSS variables so it's easier to switch it up.
  • Adds RSS link to navigation
  • A responsive font size and flow system that is more readable, partially based on Improve the readability of the content on your website by Andy Bell
  • A footer at the bottom of the viewport
  • Centers post article column with a set max-width of 780px (you should reduce this if you reduce the base font size), with wider image and code blocks, similar to the Hylia starter

Auto-Deploy to Netlify and Vercel

These builders are amazing—in just a few clicks, you'll have your repo and a build set up!

Getting Started

  1. Clone this Repository (or your own if you used one of the auto-deploy links above)
  2. Navigate to the directory and install dependencies
cd my-blog-name
npm install
  1. Look at .eleventy.js to see if you want to configure any Eleventy options differently.
  2. Edit _data/metadata.json
  3. Run Eleventy locally on a dev server:
npm start
  1. Generate a production build:
npm run build

To run in debug mode:

DEBUG=* npx eleventy

Implementation Notes

Prepend all of these file paths with src/:

  • about/index.md shows how to add a content page.
  • posts/ has the blog posts but really they can live in any directory. They need only the post tag to be added to this collection.
  • Add the nav tag to add a template to the top level site navigation. For example, this is in use on index.njk and about/index.md.
  • Content can be any template format (blog posts needn’t be markdown, for example). Configure your supported templates in .eleventy.js -> templateFormats.
    • Because css and png are listed in templateFormats but are not supported template types, any files with these extensions will be copied without modification to the output (while keeping the same directory structure).
  • The blog post feed template is in feed/feed.njk. This is also a good example of using a global data files in that it uses _data/metadata.json.
  • This example uses three layouts:
    • _includes/layouts/base.njk: the top level HTML structure
    • _includes/layouts/home.njk: the home page template (wrapped into base.njk)
    • _includes/layouts/post.njk: the blog post template (wrapped into base.njk)
  • _includes/postlist.njk is a Nunjucks include and is a reusable component used to display a list of all the posts. index.njk has an example of how to use it.

Learning Resources

Still new to Eleventy? Try out these learning resources:

Also, get familiar with the 11ty docs!

Once you understand the fundamentals a bit more, dive into data with Architecting data in Eleventy. Then you can start building some more complex features like:

11ty-sia-blog's People

Contributors

aboutdavid avatar andersk avatar atlas48 avatar benedfit avatar benjifs avatar clottman avatar davidakennedy avatar denmch avatar dhoman avatar fschoenfeldt avatar j9t avatar kitt avatar krzychukula avatar lonekorean avatar mathiasbynens avatar nhoizey avatar nick-novak avatar nilsmielke avatar onezerodigits avatar plug-n-play avatar shwilliam avatar siakaramalegos avatar styfle avatar thedamon avatar verlok avatar zachleat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.