From ef5a6cda263f262285221081a877fceec8d25b44 Mon Sep 17 00:00:00 2001 From: Bill Maxwell Date: Fri, 15 Jul 2022 17:21:52 -0700 Subject: [PATCH] initial commit --- README.md | 1 + hugo-example/README.md | 5 +++++ hugo-example/acorn-demo/Dockerfile | 13 ++++++++++++ hugo-example/acorn-demo/acorn.cue.complete | 20 +++++++++++++++++++ hugo-example/acorn-demo/archetypes/default.md | 6 ++++++ hugo-example/acorn-demo/config.toml | 4 ++++ hugo-example/acorn-demo/themes/ananke | 1 + 7 files changed, 50 insertions(+) create mode 100644 README.md create mode 100644 hugo-example/README.md create mode 100644 hugo-example/acorn-demo/Dockerfile create mode 100644 hugo-example/acorn-demo/acorn.cue.complete create mode 100644 hugo-example/acorn-demo/archetypes/default.md create mode 100644 hugo-example/acorn-demo/config.toml create mode 160000 hugo-example/acorn-demo/themes/ananke diff --git a/README.md b/README.md new file mode 100644 index 0000000..3cf8945 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Examples from the [Acorn docs](https://docs.acorn.io) diff --git a/hugo-example/README.md b/hugo-example/README.md new file mode 100644 index 0000000..863741e --- /dev/null +++ b/hugo-example/README.md @@ -0,0 +1,5 @@ +# Hugo Example + +## Using this demo + +This is a bare bones Hugo application. It is meant to have the Acornfile built as part of the [Docs exercise](https://docs.acorn.io/Develop%20with%20Acorn/Develop%20with%20Acorn). If you would like to skip that, you can copy the `Acorn.cue.complete` to `acorn.cue`. diff --git a/hugo-example/acorn-demo/Dockerfile b/hugo-example/acorn-demo/Dockerfile new file mode 100644 index 0000000..6a90817 --- /dev/null +++ b/hugo-example/acorn-demo/Dockerfile @@ -0,0 +1,13 @@ +FROM klakegg/hugo:0.101.0-alpine AS hugo + +ADD . /src +WORKDIR /src +RUN mkdir -p /target && \ + hugo -d /target/ --minify + +FROM nginx AS prod +COPY --from=hugo /target /usr/share/nginx/html + +FROM hugo AS dev +EXPOSE 1313 +CMD [ "server", "--bind", "0.0.0.0", "-D" ] diff --git a/hugo-example/acorn-demo/acorn.cue.complete b/hugo-example/acorn-demo/acorn.cue.complete new file mode 100644 index 0000000..0f79141 --- /dev/null +++ b/hugo-example/acorn-demo/acorn.cue.complete @@ -0,0 +1,20 @@ +containers: { + app: { + build: { + context: "." + } + + if args.dev { + build: target: "dev" + expose: "1313/http" + dirs: { + "/src": "./" + } + } + + if !args.dev { + build: target: "prod" + expose: "80/http" + } + } +} diff --git a/hugo-example/acorn-demo/archetypes/default.md b/hugo-example/acorn-demo/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/hugo-example/acorn-demo/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/hugo-example/acorn-demo/config.toml b/hugo-example/acorn-demo/config.toml new file mode 100644 index 0000000..4c1a064 --- /dev/null +++ b/hugo-example/acorn-demo/config.toml @@ -0,0 +1,4 @@ +baseURL = 'http://example.org/' +languageCode = 'en-us' +title = 'My New Hugo Site' +theme = "ananke" diff --git a/hugo-example/acorn-demo/themes/ananke b/hugo-example/acorn-demo/themes/ananke new file mode 160000 index 0000000..470ea40 --- /dev/null +++ b/hugo-example/acorn-demo/themes/ananke @@ -0,0 +1 @@ +Subproject commit 470ea40982f5036554819253c3ac6ed4a34193f4