Skip to content

Commit 50f0a53

Browse files
authored
Merge pull request #428 from mlange-42/nav-sub-pages
upgrade to docsy v0.4.0 - switch docsy to Hugo Module usage instead of a git submodule - remove unnecessary docsy template overrides; use "docs" default template for most pages, though the page-meta-links no longer show up on the left sidebar when shrunk now - show sub-pages in sidebar navigation when top-level page is selected
2 parents ae547c0 + 36b5640 commit 50f0a53

File tree

39 files changed

+144
-374
lines changed

39 files changed

+144
-374
lines changed

.github/workflows/gh-pages.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,37 @@ on:
1010

1111
jobs:
1212
deploy:
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-22.04
1414
steps:
15-
- uses: actions/checkout@v2
16-
with:
17-
submodules: 'recursive'
18-
fetch-depth: 0
19-
20-
- name: Setup Yarn
21-
uses: actions/setup-node@v2
22-
- run: yarn install
15+
- uses: actions/checkout@v3
2316

2417
- name: Read .env hugo version
2518
id: hugo-version
2619
run: |
2720
. ./.env
2821
echo "::set-output name=HUGO_VERSION::${HUGO_VERSION}"
2922
30-
- name: Setup Hugo
23+
- name: Add hugo nodejs dependencies
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: "16"
27+
28+
- name: Setup Hugo
3129
uses: peaceiris/actions-hugo@v2
3230
with:
33-
# sync versions with docker-compose .env ala
31+
# sync versions with docker-compose .env ala
3432
# https://github.com/marketplace/actions/hugo-setup#%EF%B8%8F-read-hugo-version-from-file
35-
hugo-version: '${{ steps.hugo-version.outputs.HUGO_VERSION }}'
33+
hugo-version: "${{ steps.hugo-version.outputs.HUGO_VERSION }}"
3634
extended: true
3735

38-
- name: Build
36+
- name: Build Hugo site
3937
env:
4038
HUGO_ENV: "production"
41-
run: hugo --minify
39+
run: |
40+
yarn install
41+
hugo mod init github.com/openmodelingfoundation/openmodelingfoundation.github.io
42+
hugo mod get github.com/google/docsy@v0.4.0
43+
hugo --minify
4244
4345
- name: Deploy
4446
if: github.event_name == 'push'

.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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@ 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 config.toml package.json /src/
11+
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}
915

10-
RUN yarn install
16+
COPY . /src/
1117

1218
CMD ["server"]

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ commands :
1818

1919
## build : build files but do not run a server.
2020
build :
21-
git submodule update --init --recursive
2221
docker-compose build --pull
2322

2423
## serve : start and run a local server.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.td-sidebar-nav {
2-
32
.td-page-meta {
43
a {
54
display: block;
@@ -8,4 +7,4 @@
87
font-weight: $font-weight-medium;
98
}
109
}
11-
}
10+
}

assets/scss/main.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,16 @@
3333
}
3434

3535
footer {
36-
min-height: 150px;
36+
min-height: 160px;
37+
38+
.logo {
39+
max-width: 100%;
40+
height: 60%;
41+
}
42+
43+
a {
44+
color: orange !important;
45+
}
3746

3847
a:hover {
3948
color: white !important;
@@ -63,4 +72,4 @@ footer {
6372
}
6473
}
6574

66-
@import "styles_project";
75+
@import "styles_project";

config.toml

Lines changed: 21 additions & 4 deletions
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/"
@@ -59,7 +73,7 @@ anchor = "smart"
5973

6074
[languages]
6175
[languages.en]
62-
title = ""
76+
title = "The Open Modeling Foundation"
6377
description = "The Open Modeling Foundation is an alliance of modeling organizations that coordinates and administers a common, community developed body of standards and best practices among diverse communities of modeling scientists."
6478
languageName ="English"
6579
# Weight used for sorting.
@@ -74,6 +88,9 @@ time_format_blog = "02.01.2006"
7488

7589
# Everything below this are Site Params
7690

91+
[outputs]
92+
section = [ "HTML", "RSS" ]
93+
7794
[params]
7895

7996
working_group_request_form = "https://asu.questionpro.com/omf-wg-joinrequest"
@@ -96,7 +113,7 @@ archived_version = false
96113
# The version number for the version of the docs represented in this doc set.
97114
# Used in the "version-banner" partial to display a version number for the
98115
# current doc set.
99-
version = "0.1"
116+
version = "0.4"
100117

101118
# A link to latest version of the docs. Used in the "version-banner" partial to
102119
# point people to the main doc site.
@@ -128,7 +145,7 @@ offlineSearch = true
128145
# User interface configuration
129146
[params.ui]
130147
# Enable to show the side bar menu in its compact state.
131-
sidebar_menu_compact = false
148+
sidebar_menu_compact = true
132149
# Set to true to disable breadcrumb navigation.
133150
breadcrumb_disable = false
134151
# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled)

content/en/_index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ <h3 class="mb-3 pt-3 font-weight-light">Enabling next generation modeling of hum
1717
<a class="btn btn-lg btn-outline-light mb-4" href="{{< relref "/standards" >}}">
1818
Standards <i class="fas fa-lightbulb ml-2"></i>
1919
</a>
20+
<div class="mx-auto mt-5">
21+
{{< blocks/link-down color="info" >}}
22+
</div>
2023
</div>
2124

22-
{{< blocks/link-down color="primary-light" >}}
2325

2426
{{< /blocks/cover >}}
2527

content/en/about/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
title: About
33
linkTitle: About
4+
cascade:
5+
- type: "docs"
46
menu:
57
main:
68
weight: 20

content/en/contribute/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: "How to Contribute"
33
linkTitle: Contribute
44
date: 2020-05-04T10:03:13-07:00
55
cascade:
6-
github_issue_filter: label:"OMF site info"
6+
- type: "docs"
7+
- github_issue_filter: label:"OMF site info"
78
menu:
89
main:
910
weight: 20

0 commit comments

Comments
 (0)