Skip to content

Commit b2c65f5

Browse files
committed
Use hugo-ext. Setup. Tests.
1 parent e26c0fb commit b2c65f5

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ In DDEV addons can be installed from the command line using the `ddev get` comma
1616
## Getting started
1717

1818
1. Create your ddev project with `ddev config --omit-containers=db`
19-
2. Run `ddev get https://github.com/penyaskito/ddev-hugo/tarball/main`
20-
3. Run `ddev hugo`
21-
4. Run `ddev launch hugo`
19+
2. Run `ddev get https://github.com/penyaskito/ddev-hugo`
20+
3. Run `ddev hugo -b public`
21+
4. Run `ddev launch public`
2222

2323
**Contributed and maintained by [@penyaskito](https://github.com/penyaskito)**

tests/test.bats

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,22 @@ setup() {
77
export DDEV_NON_INTERACTIVE=true
88
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true
99
cd "${TESTDIR}"
10-
ddev config --project-name=${PROJNAME}
10+
ddev config --project-name=${PROJNAME} --omit-containers=db
1111
ddev start -y >/dev/null
1212
}
1313

1414
health_checks() {
1515
# Do something useful here that verifies the add-on
1616
# ddev exec "curl -s elasticsearch:9200" | grep "${PROJNAME}-elasticsearch"
17-
ddev exec "curl -s https://localhost:443/"
17+
ddev exec hugo new site quickstart
18+
cp -r quickstart/* .
19+
ddev exec hugo new theme testtheme
20+
echo "{{.Site.Home.Content}}" >> themes/testtheme/layouts/index.html
21+
echo "theme = 'testtheme'" >> config.toml
22+
ddev exec hugo new _index.md
23+
echo "# Welcome to Hugo!" >> content/_index.md
24+
ddev exec hugo -b public
25+
ddev exec "curl -s https://localhost/public" | grep "Welcome to Hugo"
1826
}
1927

2028
teardown() {
@@ -37,7 +45,7 @@ teardown() {
3745
set -eu -o pipefail
3846
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
3947
echo "# ddev get ddev/ddev-hugo with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
40-
ddev get ddev/ddev-hugo
48+
ddev get penyaskito/ddev-hugo
4149
ddev restart >/dev/null
4250
health_checks
4351
}

web-build/Dockerfile.ddev-hugo

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#ddev-generated
2-
ENV HUGO_BIND="0.0.0.0" \
3-
HUGO_DESTINATION="hugo" \
2+
ENV HUGO_EDITION="extended" \
3+
HUGO_BIND="0.0.0.0" \
4+
HUGO_DESTINATION="public" \
45
HUGO_ENV="DEV" \
56
HUGO_DIR="." \
6-
HUGO_CMD="-b /hugo" \
77
HOME="/tmp"
88

9-
COPY --from=klakegg/hugo:debian /usr/bin/hugo /usr/bin/hugo
10-
COPY --from=klakegg/hugo:debian /usr/bin/hugo-official /usr/bin/hugo-official
11-
COPY --from=klakegg/hugo:debian /etc/profile.d/hugo.sh /etc/profile.d/hugo.sh
12-
COPY --from=klakegg/hugo:debian /etc/profile.d/hugo_shell.sh /etc/profile.d/hugo_shell.sh
13-
COPY --from=klakegg/hugo:debian /usr/lib/hugo /usr/lib/hugo
9+
COPY --from=klakegg/hugo:ext-debian /usr/bin/hugo /usr/bin/hugo
10+
COPY --from=klakegg/hugo:ext-debian /usr/bin/hugo-official /usr/bin/hugo-official
11+
COPY --from=klakegg/hugo:ext-debian /etc/profile.d/hugo.sh /etc/profile.d/hugo.sh
12+
COPY --from=klakegg/hugo:ext-debian /etc/profile.d/hugo_shell.sh /etc/profile.d/hugo_shell.sh
13+
COPY --from=klakegg/hugo:ext-debian /usr/lib/hugo /usr/lib/hugo

0 commit comments

Comments
 (0)