Hugo Dark Theme Site Generator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long. 5.1KB

+++ title = “Quick Install” description = “One command is all you need to start a new website.” categories = [“core”] tags = [“setup”, “installation”, “scripts”] features = [“code highlighter”, “snippets”, “related content”] notes = [ “review ‘module-system’ when adding or removing installed add-ons”, “also review selection of pre-installed modules (see front matter)” ] aliases = [ “/feature/quick-installer/” ] copyright owner = “Josh Habdas” date = “2019” license = “agpl-3.0-or-later” +++

After Dark includes a portable installation script for quick set-up:

{{< hackcss-card header=“themes/after-dark/bin/install” >}}

Expand to view script {{< highlight sh “linenos=inline” >}} {{< include “themes/after-dark/bin/install” >}} {{< /highlight >}}
{{< /hackcss-card >}}

Please install {{< external href=“” text=“Hugo” />}} 0.44 or greater before running the script.

Script has been tested on Debian, BusyBox and Darwin, and should also work under Alpine, Ubuntu, Docker and Windows via {{< external href=“” text=“Cmder” />}} without additional dependencies.

{{% hackcss-alert type=“warning” %}}Warning: Always examine scripts downloaded from the internet before running them locally. If you’d prefer not to run the script Download Manually.{{% /hackcss-alert %}}

Run the script however you like. Here are three possible methods:

  1. Download and pipe to sh directly:

    {{< hackcss-alert >}} {{< highlight shell >}}wget -qO - | sh{{< /highlight >}} {{< /hackcss-alert >}}

    (Cojones not included.)

  2. Download into new file, chmod and execute:

    {{< hackcss-alert >}} {{< highlight shell >}}curl -O && \ chmod +x install && ./install{{< /highlight >}} {{< /hackcss-alert >}}

    (It’s safe if it comes from a CDN, amirite?)

  3. From canonical git clone:

    {{< hackcss-alert >}} {{< highlight shell >}}# clone source and change to source directory git clone && cd “$_”

use npm cli to get the release hash

echo “${$(npm run integrity)#*sha512-}”

run quick install after validating

./bin/install {{< /highlight >}}

{{< /hackcss-alert >}}

<i>(<a href="/feature/release-hashes/">Release Hashes</a> may be used for code validation.)</i>

Script should complete in 5-10 seconds resulting in a sample site and help docs:

{{< figure alt=“After Dark screenshots” src=“/images/quick-install.png” lqipsrc=“/images/quick-install-fs8.png” caption=“After Dark Quick Install running to completion in Terminal on macOS Mojave.”


Multi-site Configuration

After Dark enables multi-site management from a single installation. To manage multiple websites use the -c and -d flags to specify the content and destination directories, respectively

For example, to generate an audio site using the current After Dark installation create an executable script to generate the site:

{{< hackcss-card header=“flying-toasters/bin/gen-audio-site” >}} {{< highlight shell >}}#!/bin/sh hugo -c sites/audio -d public/static.domain.example{{< /highlight >}} {{< /hackcss-card >}}

Where audio contains the content for that site:

├── layouts
├── sites
│   └── audio
│       ├── audiobooks
│       │   ├──
│       │   └──
│       └── clips
│           └──
├── static

And public contains a folder for each site:

└── static.domain.example
    ├── categories
    │   └── index.xml
    ├── audiobooks
    │   └── index.html
    ├── clips
    │   └── index.html
    ├── css
    ├── index.html
    ├── index.xml
    ├── js
    ├── sitemap.xml
    └── tags
        └── index.xml

And create another script to serve the content for editing:

{{< hackcss-card header=“flying-toasters/bin/serve-audio-site” >}} {{< highlight shell >}}#!/bin/sh hugo -c sites/audio{{< /highlight >}} {{< /hackcss-card >}}

Each subdirectory of public then becomes an independent, deployable website and exact copy save for destination content generated.

{{% hackcss-alert type=“info” %}}Tip: For additional flexibility type hugo --help and modify your scripts using the --theme and --config flags.{{% /hackcss-alert %}}

Multi-site is perfect for maintaining a consistent look-and-feel across multiple domain origins while limiting the need to run the Upgrade Script for each site.