Eleventy-Template/readme.md

2.0 KiB

Eleventy Template by Nexan

This is a template kit for me to potentially use for building barebones sites using Eleventy.

In terms of what functions this will have by default, I plan to have an auto-built Sitemap.xml file, a 404 Page, and a few other things to be determined later.

Files being worked on live in /src/, while output will live in /_site once built.

Pre-made scripts for NPM include start and build which run a development version of the site, and build the site for publishing, respectively. More scripts may be added later as I find them useful.

Templating is done in Liquid, pages can be made in any language available to Eleventy, though they will mostly be Markdown or HTML, or a combination of the two.

How to Use

To make a new page, create a new file in the /src/ directory, add Front Matter Data at the top of the file, and start editing.

Pages should, realistically, be either Markdown files ending with .md or HTML files ending with .html or .htm, and content should stay consistent between the two - that is, HTML should stay in HTML files, while Markdown should stay in Markdown files. However, sometimes you may need to put HTML in your Markdown file if you need something more advanced, and Eleventy does allow for that functionality if needed.

By default, pages will generate a folder of the same name containing a single index.html file upon building. If you want to change this, add a permalink: Front Matter to the page, pointing to a specific file (for an example, see the sitemap.md file, which outputs to an XML at the root of the site instead of in a folder)

Anything in the /assets/ directory will be copied through, including CSS in the /styles/ directory, and there are a few little bits in .eleventy.js that could help with development.

As mentioned above, the start script will run a local development server for semi-live code editing, and build will build the site for deployment.