Skip to content

Commit

Permalink
Theme updates, includes workflow for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jodygarnett committed Mar 27, 2024
1 parent 0ddd895 commit 0a7f84b
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 102 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Documentation

on:
push:
branches:
- 2.10.x
paths:
- "docs/manual/**"
pull_request:
branches:
- 2.10.x
paths:
- "docs/manual/**"
workflow_dispatch:

jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout GeoNetwork
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: mkdocs install
run: pip install --upgrade pip && pip install -r docs/manual/requirements.txt
- name: git configuration
run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: build docs without publishing them
if: ${{ github.event_name == 'pull_request' }}
working-directory: docs/manual
run: |
mike deploy --title "2.10" 2.10
- name: deploy docs to gh-pages branch
if: ${{ github.event_name != 'pull_request' }}
working-directory: docs/manual
run: |
mike deploy --push --title "2.10" 2.10
43 changes: 7 additions & 36 deletions docs/manual/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,56 +75,27 @@ If you are not familiar with python the mkdocs-material website has instructions
```

2. Preview: http://localhost:8000

## Maven Integration

1. Build documentation with ``compile`` phase:
```
mvn compile
```

2. Assemble ``zip`` with ``package`` phase:
```bash
mvn compile
```

3. Both ``install`` and ``deploy`` are skipped (so ``mvn clean install`` is fine).

4. Use default profile to only build the default english docs:

```
mvn install -Pdefault
```

## Publish
## Publish 2.10.x Archive Docs

We use ``mike`` for publishing (from the `gh-pages` branch):
We use ``mike`` for publishing (from the `gh-pages` branch). Docs are published by the ``.github/workflows/docs.yml`` automation each time pull-request is merged.

1. To publish development docs from the `main` branch:
If you wish to preview using your own `gh-pages` branch:

```bash
mike deploy --update-aliases 4.4.x latest
```

1. To publish documentation for a new release:
1. To update publish documentation:

```bash
mike deploy --push --update-aliases 4.2.5 stable
```

2. To publish documentation for a maintenance release:

```bash
mike deploy --push --update-aliases 3.12.10 maintenance
mike deploy --push 2.10
```

3. To show published versions:
2. To show published versions:

```bash
mike list
```

4. To preview things locally (uses your local ``gh-pages`` branch):
3. To preview things locally (uses your local ``gh-pages`` branch):

```bash
mike serve
Expand Down
19 changes: 11 additions & 8 deletions docs/manual/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ Welcome to GeoNetwork. this documentation is organized into specific guides targ

<div class="grid cards" markdown>

:fontawesome-solid-person-circle-question: [User Guide](users/index.md)

: Operational user-guide describing the editing, review and management of records (requires-login).

:fontawesome-regular-file-code: [Developer Guide](developer/index.md)

: Development information on customizing GeoNetwork and taking part in the GeoNetwork project.

- :fontawesome-solid-person-circle-question: [User Guide](users/index.md)

---

Operational user-guide describing the editing, review and management of records (requires-login).

- :fontawesome-regular-file-code: [Developer Guide](developer/index.md)

---

Development information on customizing GeoNetwork and taking part in the GeoNetwork project.

</div>
34 changes: 22 additions & 12 deletions docs/manual/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
site_name: GeoNetwork opensource
site_description: GeoNetwork catalogue for listing, searching and reviewing records.
site_dir: target/html
site_url: http://jodygarnett.github.io/core-geonetwork/
site_url: https://docs.geonetwork-opensource.org/

# Repository
repo_name: geonetwork/core-geonetwork
Expand All @@ -13,15 +13,15 @@ edit_uri: edit/mkdocs/docs/manual/docs
copyright: Copyright &copy; 2001 - 2023 FAO-UN and others

extra_css:
- stylesheets/extra.css
- assets/stylesheets/extra.css

# Configuration
theme:
name: material
language: en
custom_dir: overrides
logo: assets/geonetwork-logo.svg
favicon: assets/geonetwork-logo.png
logo: assets/images/geonetwork-logo.svg
favicon: assets/images/geonetwork-logo.png
icon:
repo: fontawesome/brands/github
palette:
Expand Down Expand Up @@ -54,7 +54,10 @@ theme:

# Plugins - install using: pip3 install -r requirements.txt
plugins:
- search
- exclude:
glob:
# ignore, used with include-markdown below
- users/managing_metadata/import/importActions.md
- i18n:
docs_structure: suffix
reconfigure_material: true
Expand All @@ -74,11 +77,8 @@ plugins:
Search: Search
Record: Record
Map: Map
- exclude:
glob:
# ignore, used with include-markdown below
- users/managing_metadata/import/importActions.md
- include-markdown
- search

# Customizations
extra:
Expand All @@ -95,6 +95,17 @@ extra:
link: https://geonetwork-opensource.org/
name: GeoNetwork Website

# To quite warnings on this older branch
validation:
nav:
omitted_files: warn
not_found: warn
absolute_links: warn
links:
not_found: warn
absolute_links: warn
unrecognized_links: warn

# Extensions
# - These are carefully chosen to work with pandoc markdown support for whole document translation
markdown_extensions:
Expand All @@ -103,8 +114,8 @@ markdown_extensions:
- def_list
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
options:
custom_icons:
- overrides/.icons
Expand Down Expand Up @@ -132,7 +143,6 @@ nav:
- index.md
- 'User':
- users/index.md

- 'Preface':
- users/preface.md
- 'Quick Start Guide':
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
dt {
font-weight: bold;
}

img + em, .browser-border + em, .browser-mockup + em {
display: block;
text-align: left;
Expand All @@ -11,48 +9,6 @@ img + em, .browser-border + em, .browser-mockup + em {
font-size: 0.75rem;
}

/* grid */
.md-typeset .grid {
column-count: 2;
column-gap: 2em;
margin-bottom: 20px;
}
.md-typeset .grid dl {
display: grid;
grid-template-columns: repeat(auto-fit,minmax(16rem,1fr));
margin: 0;
}
.md-typeset .grid.cards dt, .md-typeset .grid.cards dd {
border: 0.05rem solid var(--md-default-fg-color--lightest);
border-radius: 0.1rem;
display: block;
margin: 0;
padding: 0.8rem;
transition: border .25s,box-shadow .25s;
}
.md-typeset .grid.cards dt {
font-weight: bold;
}
.md-typeset .grid.cards dt .twemoji {
margin-right: 5px;
}
.md-typeset .grid.cards dd {
margin-bottom: 0.8rem;
margin-top: -1px;
}
.md-typeset .grid.cards dd p {
margin: 0;
}
@media (max-width: 768px) {
.md-typeset .grid dl {
display: inline-block;
margin-bottom: 20px;
}
.md-typeset .grid.cards dt, .md-typeset .grid.cards dd {
width: calc(100vw - 1.2rem - 1.2rem);
}
}

/* definition list used to display general inputs */
.md-typeset dl dd {
margin: 10px 0;
Expand Down Expand Up @@ -120,4 +76,4 @@ img + em, .browser-border + em, .browser-mockup + em {

.browser-mockup > * {
display: block;
}
}

0 comments on commit 0a7f84b

Please sign in to comment.