Skip to content

Commit dbc248a

Browse files
committed
refactor: use docsy as hugo module
docsy now recommends that it be used as a Hugo Module instead of as a git submodule: https://www.docsy.dev/docs/updating/convert-site-to-module/
1 parent c158177 commit dbc248a

File tree

5 files changed

+31
-10
lines changed

5 files changed

+31
-10
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "themes/docsy"]
2-
path = themes/docsy
3-
url = https://github.com/google/docsy.git

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ ARG HUGO_VERSION=0.101.0
22
ARG DIST_TAG=-ext-ubuntu
33
FROM klakegg/hugo:${HUGO_VERSION}${DIST_TAG}
44

5+
ARG DOCSY_VERSION=v0.4.0
6+
57
LABEL maintainer="CoMSES Net <support@comses.net>"
68

79
WORKDIR /src
8-
COPY ./package.json ./yarn.lock /src/
10+
COPY . /src/
911

10-
RUN yarn install
12+
RUN git config --global --add safe.directory /src \
13+
&& hugo mod init github.com/openmodelingfoundation/openmodelingfoundation.github.io \
14+
&& hugo mod get github.com/google/docsy@${DOCSY_VERSION}
1115

1216
CMD ["server"]

config.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ title = "The Open Modeling Foundation"
44
enableRobotsTXT = true
55

66
# Hugo allows theme composition (and inheritance). The precedence is from left to right.
7-
theme = ["docsy"]
7+
# NB: disabled in favor of module settings https://www.docsy.dev/docs/updating/convert-site-to-module/
8+
# theme = ["github.com/google/docsy", "github.com/google/docsy/dependencies"]
89

910
# Will give values to .Lastmod etc.
1011
enableGitInfo = true
@@ -33,6 +34,19 @@ pygmentsUseClassic = false
3334
# See https://help.farbox.com/pygments.html
3435
pygmentsStyle = "tango"
3536

37+
# module settings
38+
[module]
39+
proxy = "direct"
40+
[module.hugoVersion]
41+
extended = true
42+
min = "0.101.0"
43+
[[module.imports]]
44+
path = "github.com/google/docsy"
45+
disable = false
46+
[[module.imports]]
47+
path = "github.com/google/docsy/dependencies"
48+
disable = false
49+
3650
# Configure how URLs look like per section.
3751
[permalinks]
3852
blog = "/:section/:year/:month/:day/:slug/"

docker-compose.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
version: '3.8'
21
services:
32
hugo:
4-
image: openmodelingfoundation/omf.io:latest
3+
image: openmodelingfoundation/omf:latest
54
build:
65
context: .
76
args:
87
HUGO_VERSION: ${HUGO_VERSION}
98
ports:
109
- "127.0.0.1:1313:1313"
1110
volumes:
12-
- .:/src
11+
- ./archetypes:/src/archetypes
12+
- ./assets:/src/assets
13+
- ./content:/src/content
14+
- ./i18n:/src/i18n
15+
- ./layouts:/src/layouts
16+
- ./resources:/src/resources
17+
- ./static:/src/static
18+
- ./.git:/src/.git
19+
- /src/themes
1320
- /src/node_modules

themes/docsy

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)