Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

an11ty

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

an11ty

Easiest way to start using an 11ty site.

  • 0.0.27
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

An11ty: An Eleventy Site

Easiest way to start using an 11ty site.

An11ty is an opinionated merge tool, which merges one or more 11ty structured template folders together, with an 11ty structured site, and then builds the site using the 11ty CLI tooling.

How to Use

The fastest way to get started is probably to use degit to fetch an11ty/starter, which is a simple starter website, using a single template:

npx degit an11ty/starter my-site
cd my-site
npm install

You'll notice that this starter project only has a very few files in it:

.gitignore
package.json
README.md
site
  |- index.md
  |- _data
      |- metadata.js

Your site content (and any template/setting overrides) live inside the site folder.

Like a normal 11ty site, the metadata about the site (such as title and author name) live inside the site/_data/metadata.js file.

To start development, simply run:

npm run dev

This will merge the template (from the node_modules folder) and the site into _merge, and then build the site into _site and launch a local server to view your new site!

(It will also watch the site folder and all template folders for any changes, and then re-merge and re-build.)

Commands

Because an11ty is meant to be a little more opinionated, it only supportes a limited set of 11ty commands:

  • an11ty build - Build the whole site into the output folder.
  • an11ty dev - Build the whole site into the output folder, watch for changes (rebuild on change), and launch an HTTP server.

Flags available for all commands:

  • --help - Get help on any of the commands.
  • --input, -i - The input folder, this would be your site content. (Default: site)
  • --template, -t - (Required) The path to your installed template. You can specify multiple of these, and they will be merged one on top of the other, first to last.
  • --merged, -m - The folder where the merged content goes. (Default: _merged)
  • --output, -o - The folder where the built 11ty conten goes. (Default: _site)

Flags available for dev command:

  • --port - The port to run the HTTP server. (Default: the 11ty default, 8080)

Templates

Check out an11ty-template for a great example template specially made for an11ty.

The an11ty command does a blind merge, copying the template folders into a temporary folder and then copying anything in your site on top of it, overwriting anything named the same.

Making an extensible template requires careful strategy, but you will likely find that other existing templates will work with little extra effort.

For more notes on building a good template, have a look at an11ty-template.

License

This software is published and released under the Very Open License.

Keywords

FAQs

Package last updated on 02 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc