Code Monkey home page Code Monkey logo

smix-eleventy-starter's Introduction

๐ŸŒป Smix

A standards-respecting starter kit for Eleventy. Go Indie.

โš ๏ธ This project is now considered more-or-less complete for the author's needs. Any further enhancements will require a pull request to come from the community.

Reading.

For nice text, there's Typeset. While it adds to the build time, it makes for a more polished reading experience.

It seems people do rely on RSS feeds even in 2022! Cheers to that; there's an Atom feed that is standards-compliant. It understands the published and updated datetime stamps on posts, and uses the RFC822 date format.

Dark mode is included out of the box using a custom media query. (More in future-ready section below).

Date filters such as for friendly dates (10 March 2020) and machine-parseable dates (ISO8601) are available to use via filters.

Discoverability/SEO.

Meta tags for social networks (Open Graph as well as Twitter). This allows for a nice card display when you (or someone else) shares a link to your post or site. Support for content-description meta tag -- this helps decide what text to show for a page/post when shared on social media, as well as in search engines.

Sitemap with changeFrequency -- so bots only come back when they need to. (please also see issue #7). robots.txt is a cherry on the top -- I would also recommend using it to hide your personal picture if so desired.

Writing

Write in Markdown, much loved among developers. If you don't already know it, it's easy to get started. You can also use separate apps and then copy-paste your content into a new file. This allows for focusing on content first, before messing with any technicals. I recommend Bear.

Linking to pages or posts.

postUrl shortcode similar to Jekyll's post_url and link liquid tags:

{% postUrl collections.primary 'on-burnout' %}

Code blocks.

Code blocks are made possible via an Eleventy plugin. Many Prism themes are available to use.

IndieWeb

For those pushing #IndieWeb, some basic Microformats2 support is included. From h-card to understand authorship, h-entry to understand a post, and h-feed to have Microformat feeds. This allows following a website in Microsub readers.

The following post-types are supported:

  • ๐Ÿ“„ Article
  • ๐Ÿ“” Note
  • โ†ช Reply
  • ๐Ÿ“ท Photo

A single microformats2 feeds is offered via h-feed. This includes articles, notes, replies (with or without context), and image(s). These post types also seamlessly work in the Atom feed.

Future-ready.

The CSS is written with upcoming CSS standards in mind. This is made possible thanks to PostCSS. Inclusions: imports, nesting, purge, minification, autoprefixer, custom properties, custom media queries (this makes a dark mode easy to build!), custom selectors, and LCH color coding.

JavaScript is transpiled and bundled via esbuild.

Accessible.

Atkinson font by The Braille Institute is included if you wish to use it. If not, there's a sans, serif, and mono fallback to system fonts.

Care is taken to have good contrast all around.

Should you choose to include some animations, do make use of a custom media query for those who prefer less motion:

/* Prefers reduced motion. */
@media screen and (--rm) {
  .fancy {
    /* Disable animations. */
  }
}

Under The Hood.

Handling JavaScript.

ES Modules are now well supported and you should move to them. In that spirit, we use esbuild.

If you want to bundle a single file and that is the default index.js source, running npm run dev:js is enough.

To allow for page-specific JavaScript files, we have a convenience command to put together a new JS bundle.

npm run dev:jsb --in=portfolio.js --out=portfolio.js

This will create a JS bunlde (hence jsb), entering at src/assets/js/portfolio.js and outputting at dist/assets/js/portfolio.js

Include them in the required page by using the pageJavaScript block:

{% block pageJavascript %}
<script type="module" src="/assets/js/portfolio.js">
{% endblock}

My content here.

Misc Features

  • Prettier and editorconfig for consistent formatting of the codebase.

To-Do

  • Feed per tag (this could easily go into 10s or 100s, but you know, choice is important!)
  • Scheduled blog posts.
  • Re-do development and production docs as needed.

Built off of

Sites that took Smix Eleventy Starter and made something of their own:

  • [Add your site here]

smix-eleventy-starter's People

Contributors

arpitbatra123 avatar dependabot[bot] avatar dirtyf avatar drnic avatar maybethisisru avatar olets avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

smix-eleventy-starter's Issues

asdf-nodejs friendly nvmrc

asdf-nodejs needs a full version specification, not just a major version. So for example

# .nvmc
lts/erbium
v12.x.y

I'd be happy to open a pull request for this change. If that sounds good to you, do you have a preferred version? Latest 12.x is 12.20.0

netlify config to keep draft posts out of live site

It took me a minute to understand how the env vars were set up, so that I could configure a Netlify build to ignore draft Forestry posts in the production environment. Is supporting that behavior out of the box of interest to you? If so I'll PR the netlify.toml!

Setup lazy-loading for images

Only native lazy loading to be implemented. This would be similar to the setup on my personal site. We add loading="lazy" to all images as well as height and width parameters -- all at build time.

Major upgrades for root dependencies

npm outdated currently returns the following after handling minor and patch upgrades:

Package             Current   Wanted   Latest  Location                         Depended by
@11ty/eleventy-img    1.1.0    1.1.0    2.0.1  node_modules/@11ty/eleventy-img  smix-eleventy-starter
cssnano              4.1.11   4.1.11   5.1.14  node_modules/cssnano             smix-eleventy-starter
esbuild             0.14.54  0.14.54  0.15.13  node_modules/esbuild             smix-eleventy-starter
husky                 4.3.8    4.3.8    8.0.1  node_modules/husky               smix-eleventy-starter
postcss-cli           9.1.0    9.1.0   10.0.0  node_modules/postcss-cli         smix-eleventy-starter
postcss-import       12.0.1   12.0.1   15.0.0  node_modules/postcss-import      smix-eleventy-starter
prettier             1.19.1   1.19.1    2.7.1  node_modules/prettier            smix-eleventy-starter
pretty-quick          2.0.2    2.0.2    3.1.3  node_modules/pretty-quick        smix-eleventy-starter
  • @11ty/eleventy-img
  • cssnano
  • esbuild
  • husky
  • postcss-cli
  • postcss-import
  • prettier
  • pretty-quick

Worth going over the changelogs and upgrading these.

Use JavaScript modules in the browser

https://caniuse.com/es6-module

Browser support is fairy good. We can reduce complexity by using ES6 modules directly instead of bundling them up with Browserify. I'd be interested in hearing what the community thinks! Is it too soon for such a change?


  • Remove gulp's js task.
  • Use another transpiler directly (babel/snowpack/rollup/esbuild)
  • Ensure there's a nice way to include JS files in templates on a per-page and a global basis.

Comply with microformats2

We are going to comply with the following:

  • h-card for author info
  • h-feed meta tag for articles page on index page
  • h-feed and h-entry for articles on article index page
  • h-entry for articles on article page

List to be kept updated in this comment.

Update dependencies

Tailwind has several new releases since August. The rest of the deps could use an update too -- two have a security issue.

RFC: Update project structure to be suitable for a submodule

I would like to separate content from the framework and its configuration. This would mean you can add Smix as a submodule on your own project and continue to receive updates past the initial fork/clone by running a simple(-ish) git command.

The very first question of course is if this is technically possible with Eleventy.

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.