~sircmpwn/pages.sr.ht-examples

d1bb90aa738c8d19396db745f66cb3104b471829 — Noelle Leigh 2 months ago 13a0d2f
add eleventy example

This patch adds an Eleventy (https://www.11ty.dev/) sample manifest.

Due to the nature of Node.js development, this example is somewhat more
opinionated than the Hugo example:

* A version of Node.js must be specified, so I chose the current LTS
  version.
* The environment variable `CI` is necessary to avoid flooding the
  console with a fancy progress bar during `npm install`.
* This example assumes the repository already contains a `package.json`
  file with `@11ty/eleventy` in its dependencies.

I've also tweaked the style in the following ways:

* De-mystify some of the workings of this manifest by linking to
  documentation where appropriate.
1 files changed, 24 insertions(+), 0 deletions(-)

A eleventy.yml
A eleventy.yml => eleventy.yml +24 -0
@@ 0,0 1,24 @@
# Eleventy: https://www.11ty.dev/
image: debian/buster
packages:
  - nodejs
repositories:
  # https://github.com/nodesource/distributions/blob/master/README.md#debmanual
  nodesource.com: >-
    https://deb.nodesource.com/node_14.x buster main
    9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280
oauth: pages.sr.ht/PAGES:RW
environment:
  site: example.org
  # https://docs.npmjs.com/cli/v6/using-npm/config#progress
  CI: "TRUE"
tasks:
- install: |
    cd $site
    npm install
- package: |
    cd $site
    npx eleventy
    tar -C _site -cvz . > ../site.tar.gz
- upload: |
    acurl -f https://pages.sr.ht/publish/$site -Fcontent=@site.tar.gz