Skip to content

Commit

Permalink
Update mkdocs-material to 9.5.2.
Browse files Browse the repository at this point in the history
Include generating social cards, lots of minor bug fixes, a smaller docker image, faster build times, and using a new emoji extension.
  • Loading branch information
jholdstock committed Dec 14, 2023
1 parent cf067a9 commit 292c8a6
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build the Docker image
run: docker build -t decred/dcrdevdocs:$(date +%s) .
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
python-version: [3.11]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM python:3.11

LABEL description="dcrdevdocs build"
LABEL version="1.0"
LABEL maintainer "[email protected]"
LABEL maintainer "[email protected]"

USER root
WORKDIR /root
Expand All @@ -15,14 +15,22 @@ COPY ./ /root/
RUN pip install mkdocs && \
pip install --user -r requirements.txt

# Install dependencies for generating social cards.
# https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards
RUN apt update && \
apt install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev && \
pip install pillow cairosvg

ENV DCRDEVDOCS_CARDS true

RUN ./bin/build_docs.sh

# Serve image (stable nginx version)
FROM nginx:1.22-alpine
FROM nginx:1.24-alpine

LABEL description="dcrdevdocs serve"
LABEL version="1.0"
LABEL maintainer "[email protected]"
LABEL maintainer "[email protected]"

COPY conf/nginx.conf /etc/nginx/conf.d/default.conf

Expand Down
20 changes: 18 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
site_name: Decred Developer Documentation
site_url: https://devdocs.decred.org
use_directory_urls: true
validation:
# Increase severity of validation rules to trigger build failures on common mistakes.
absolute_links: warn
unrecognized_links: warn
nav:
omitted_files: warn
absolute_links: warn
watch:
- "docs"
theme:
name: material
favicon: 'img/favicon.ico?v=s3ss'
Expand Down Expand Up @@ -68,14 +78,20 @@ markdown_extensions:
- attr_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
extra_css:
- css/fonts.css
- css/style.css
plugins:
- markdownextradata
- search
- social:
enabled: !ENV [DCRDEVDOCS_CARDS, false]
cards_layout_options:
font_family: 'Source Sans 3'
background_color: '#091440'
color: '#FFFFFF'
nav:
- 'Home': 'index.md'
- 'Projects': 'projects.md'
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mkdocs-material==9.0.6
mkdocs-markdownextradata-plugin==0.2.4
mkdocs-material==9.5.2
mkdocs-markdownextradata-plugin==0.2.5

0 comments on commit 292c8a6

Please sign in to comment.