Skip to content

Commit cf067a9

Browse files
authored
Use mkdocs-material 9. (#108)
* Use mkdocs-material 9. Bumping major version of mkdocs to 9. It includes some nice improvements to search but nothing else relevant to our docs. Also picking up python 3.11 and nginx 1.22. * build: Docker cleanup/update. - Use Alpine version of nginx image (23MB instead of 142MB) - Fix MIME type for rss feeds. - Clean up .gitignore and .dockerignore. - Ensure scripts fail on error.
1 parent 753796c commit cf067a9

File tree

10 files changed

+39
-24
lines changed

10 files changed

+39
-24
lines changed

.dockerignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
bin/build.sh
2-
Dockerfile
3-
README.md
4-
.git
51
.gitignore
2+
.git
3+
.github
4+
LICENSE
5+
README.md
66

7-
site/
7+
bin/build.sh
8+
site
9+
.cache

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
python-version: [3.9]
9+
python-version: [3.11]
1010

1111
steps:
1212
- uses: actions/checkout@v2

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build image
2-
FROM python:3.9
2+
FROM python:3.11
33

44
LABEL description="dcrdevdocs build"
55
LABEL version="1.0"
@@ -18,7 +18,7 @@ RUN pip install mkdocs && \
1818
RUN ./bin/build_docs.sh
1919

2020
# Serve image (stable nginx version)
21-
FROM nginx:1.20
21+
FROM nginx:1.22-alpine
2222

2323
LABEL description="dcrdevdocs serve"
2424
LABEL version="1.0"

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ISC License
22

3-
Copyright (c) 2018-2021 The Decred developers
3+
Copyright (c) 2018-2023 The Decred developers
44

55
Permission to use, copy, modify, and distribute this software for any
66
purpose with or without fee is hereby granted, provided that the above

bin/build.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
#!/bin/bash -e
1+
#!/usr/bin/env bash
22
# Requires docker 17.05 or higher
33

4+
set -e
5+
46
echo ""
5-
echo "================================="
7+
echo "===================================="
68
echo " Building dcrdevdocs docker image "
7-
echo "================================="
9+
echo "===================================="
810
echo ""
911

10-
docker build -t decred/dcrdevdocs .
12+
IMAGE_NAME=decred/dcrdevdocs
13+
14+
if [ "$1" != "" ]; then
15+
IMAGE_NAME=$1
16+
fi
17+
18+
docker build -t $IMAGE_NAME .
1119

1220
echo ""
1321
echo "==================="
1422
echo " Build complete"
1523
echo "==================="
1624
echo ""
1725
echo "You can now run dcrdevdocs with the following command:"
18-
echo " docker run -d --rm -p <local port>:80 decred/dcrdevdocs:latest"
26+
echo " docker run -d --rm -p <local port>:80 $IMAGE_NAME:latest"
1927
echo ""

bin/build_docs.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/bin/bash -e
1+
#!/usr/bin/env bash
2+
3+
set -e
24

35
echo ""
46
echo "========================================="

conf/nginx.conf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ server {
1313
server_name localhost;
1414

1515
charset utf-8;
16+
17+
# Hide Version
1618
server_tokens off;
1719

18-
#Security Headers
19-
add_header X-Content-Type-Options "nosniff" always;
20-
add_header X-Frame-Options "DENY" always;
21-
add_header X-XSS-Protection "1; mode=block" always;
22-
add_header Referrer-Policy "no-referrer" always;
20+
# Security Headers
21+
add_header X-Content-Type-Options "nosniff" always;
22+
add_header X-Frame-Options "DENY" always;
23+
add_header X-XSS-Protection "1; mode=block" always;
24+
add_header Referrer-Policy "no-referrer" always;
2325

2426
location / {
2527
root /usr/share/nginx/html;
@@ -38,6 +40,6 @@ server {
3840
gzip_comp_level 6;
3941
gzip_buffers 16 8k;
4042
gzip_http_version 1.1;
41-
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss image/svg+xml text/javascript;
43+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/rss+xml image/svg+xml text/javascript;
4244

4345
}

docs/css/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ details .md-typeset__table code{
153153
font-size: 13px;
154154
}
155155

156-
.md-typeset .admonition p{
156+
.md-typeset .admonition p,
157+
.md-typeset .admonition li {
157158
font-size: 14px;
158159
}
159160

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ nav:
116116
- 'Regnet': 'environments/regnet.md'
117117
- Contributing:
118118
- 'Contributor Guidelines': 'contributing/contributor-guidelines.md'
119-
copyright: If you wish to improve this site, please <a href="https://github.com/decred/dcrdevdocs/issues/new">open an issue</a> or <a href="https://github.com/decred/dcrdevdocs/compare">send a pull request</a>.<br />dcrdevdocs v0.0.1. Decred Project 2020.
119+
copyright: If you wish to improve this site, please <a href="https://github.com/decred/dcrdevdocs/issues/new">open an issue</a> or <a href="https://github.com/decred/dcrdevdocs/compare">send a pull request</a>.<br />dcrdevdocs v0.0.1. Decred Project 2020-2023.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
mkdocs-material==8.2.8
1+
mkdocs-material==9.0.6
22
mkdocs-markdownextradata-plugin==0.2.4

0 commit comments

Comments
 (0)