homebrew-ec-foss / hackerspace-ec-website

11ty starter.
https://hsp-ec.xyz
MIT License
0 stars 6 forks source link

11ty-starter

This is eleventy starter.

It uses sass, nunjucks, rollup.

It also has i18n support.

DEMO on github pages

Installation

You can init repo with this template.

How to create project from a template

Or just clone this repo, remove .git directory and init with your own git repo.

File stucture

src/en - put your pages here. For other language create directory named {lang}.json for example and add {lang}.json file.

{
    "locale": "lang"
}

src/posts/en - your posts

src/_includes/pages - pages layouts. Create your pages here and export them in src/en directory files.

src/_inlcudes/layouts - layouts.

src/assets - your css and js

src/assets/css

src/assets/js - example index.js file. You can remove it, if you don't need js. Don't forget to remove rollup, rollup-plugin-terser and @rollup/plugin-node-resolve dependencies. Also remove <script> tag from _includes/layouts/base.njk

static - static files are copied directly to /_site.

_data - data files with translations for each page, metadata and other stuff.

Deploy

Github pages

Edit build:eleventy:pathPrefix in package.json.

change path prefix option --pathprefix=your-repo-name

Caddy

domainname.com {
    root * ~/_site # or whatever site directory
    file_server

    handle_errors {
        rewrite * /{http.error.status_code}.html
        file_server
    }

    log {
        output file /var/log/caddy/caddy.log
    }
}