Skip to content

Commit

Permalink
Merge pull request #107 from microbiomedata/87-customize-favicon-of-r…
Browse files Browse the repository at this point in the history
…untime-docs-subsite

Customize Runtime docs site favicon to be colorful NMDC "M" logo
  • Loading branch information
eecavanna authored Dec 15, 2024
2 parents 808f97c + cd8e0fd commit be83db5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/fetch-and-compile-runtime-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,26 @@ jobs:
mkdocs-jupyter \
pymdown-extensions
# Note: The `mkdocs.yml` file we pull from the `nmdc-runtime` repo sets the overrides directory to `mkdocs_overrides`.
- name: Copy files that override parts of theme
run: cp pullers/runtime_docs/mkdocs_overrides/main.html _clones/microbiomedata/nmdc-runtime/mkdocs_overrides/main.html
# Docs: https://www.mkdocs.org/user-guide/cli/
# Docs: https://www.mkdocs.org/user-guide/configuration/#configuration-inheritance
# TODO: Make the `site_url` configurable (e.g. via an environment variable).
- name: Copy files that override or customize parts of theme
run: |
cp pullers/runtime_docs/mkdocs_overrides/main.html _clones/microbiomedata/nmdc-runtime/mkdocs_overrides/main.html
cp pullers/runtime_docs/assets/images/favicon.ico _clones/microbiomedata/nmdc-runtime/assets/images/favicon.ico
- name: Compile source documents into HTML
#
# References:
# - https://www.mkdocs.org/user-guide/cli/
# - https://www.mkdocs.org/user-guide/configuration/#configuration-inheritance
# - https://squidfunk.github.io/mkdocs-material/setup/changing-the-logo-and-icons/#favicon
#
# TODO: Make the `site_url` configurable (e.g. via an environment variable).
#
working-directory: _clones/microbiomedata/nmdc-runtime
run: |
echo '{
"INHERIT": "mkdocs.yml",
"site_dir": "${{ github.workspace }}/_dist",
"site_url": "https://docs.microbiomedata.org/runtime/"
"site_url": "https://docs.microbiomedata.org/runtime/",
"theme": {"favicon": "assets/images/favicon.ico"}
}' | mkdocs build -f -
# Upload the result as an "artifact" so it can then be downloaded and used by another job.
- name: Save the HTML for publishing later # Docs: https://github.com/actions/upload-artifact
Expand Down
10 changes: 9 additions & 1 deletion pullers/runtime_docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@ RUN git clone --no-checkout --depth=1 --single-branch --branch=main --filter=tre
# Copy files we can use to override parts of the Material for MkDocs theme.
# Note: The `mkdocs.yml` file we pull from the `nmdc-runtime` repo sets the overrides directory to `mkdocs_overrides`.
COPY mkdocs_overrides/main.html nmdc-runtime/mkdocs_overrides/main.html
COPY assets/images/favicon.ico nmdc-runtime/docs/assets/images/favicon.ico

# Compile source documents into HTML.
#
# References:
# - https://www.mkdocs.org/user-guide/cli/
# - https://www.mkdocs.org/user-guide/configuration/#configuration-inheritance
# - https://squidfunk.github.io/mkdocs-material/setup/changing-the-logo-and-icons/#favicon
#
RUN cd nmdc-runtime && \
echo '{\
"INHERIT": "mkdocs.yml",\
"site_dir": "/html",\
"site_url": "http://localhost:8000/"\
"site_url": "http://localhost:8000/",\
"theme": {"favicon": "assets/images/favicon.ico"}\
}' | mkdocs build -f -

EXPOSE 8000
Expand Down
Binary file added pullers/runtime_docs/assets/images/favicon.ico
Binary file not shown.

0 comments on commit be83db5

Please sign in to comment.