diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b641edf --- /dev/null +++ b/.drone.yml @@ -0,0 +1,106 @@ +--- +kind: pipeline +type: kubernetes +name: build + +trigger: + event: [ push ] + branch: [ master ] + +steps: +- name: build + image: plugins/docker + settings: + registry: https://gitea.home.jbrumond.me + username: drone + password: + from_secret: gitea-jbrumond-me-password + repo: gitea.home.jbrumond.me/doc-utils/docs + cache_from: gitea.home.jbrumond.me/doc-utils/docs:ci + tags: + - ci + +--- +kind: pipeline +type: kubernetes +name: deploy-stg + +trigger: + event: [ promote ] + target: [ stg ] + +steps: +- name: build-and-publish + image: plugins/docker + settings: + registry: https://gitea.home.jbrumond.me + username: drone + password: + from_secret: gitea-jbrumond-me-password + repo: gitea.home.jbrumond.me/doc-utils/docs + cache_from: gitea.home.jbrumond.me/doc-utils/docs:ci + tags: + - stg + +- name: deploy-stg + image: gitea.home.jbrumond.me/images/kubectl:1.24 + pull: always + environment: + KUBERNETES_SERVER: https://nephthys:6443 + KUBERNETES_TOKEN: + from_secret: kubernetes-web-ns-service-account-token + KUBERNETES_CERT: + from_secret: kubernetes-web-ns-service-account-cert + commands: + - /bin/kubectl-setup + - kubectl -n web set image "deployment/doc-utils-stg-deploy" "doc-utils-stg=gitea.home.jbrumond.me/doc-utils/docs:stg" + - kubectl -n web rollout restart "deployment/doc-utils-stg-deploy" + - kubectl -n web rollout status "deployment/doc-utils-stg-deploy" + +--- +kind: pipeline +type: kubernetes +name: deploy-prod + +trigger: + event: [ promote ] + target: [ prod ] + +steps: +- name: tag-image + image: gitea.home.jbrumond.me/images/docker + pull: always + volumes: + - name: dockersock + path: /var/run/ + environment: + DOCKER_REGISTRY: https://gitea.home.jbrumond.me + DOCKER_USER: drone + DOCKER_PASS: + from_secret: gitea-jbrumond-me-password + commands: + - /bin/docker-setup + - docker pull gitea.home.jbrumond.me/doc-utils/docs:stg + - docker tag gitea.home.jbrumond.me/doc-utils/docs:stg gitea.home.jbrumond.me/doc-utils/docs:prod + - docker push gitea.home.jbrumond.me/doc-utils/docs:prod + +- name: deploy-prod + image: gitea.home.jbrumond.me/images/kubectl:1.24 + pull: always + environment: + KUBERNETES_SERVER: https://nephthys:6443 + KUBERNETES_TOKEN: + from_secret: kubernetes-web-ns-service-account-token + KUBERNETES_CERT: + from_secret: kubernetes-web-ns-service-account-cert + commands: + - /bin/kubectl-setup + - kubectl -n web set image "deployment/doc-utils-prod-deploy" "doc-utils-prod=gitea.home.jbrumond.me/doc-utils/docs:prod" + - kubectl -n web rollout restart "deployment/doc-utils-prod-deploy" + - kubectl -n web rollout status "deployment/doc-utils-prod-deploy" + +volumes: +- name: dockersock + host: + path: /var/run/ + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a4487f0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ + +FROM --platform=arm64 nginx +EXPOSE 80 + +# actual web content +COPY www/ /usr/share/nginx/html + +# nginx config files +COPY conf/nginx.conf /etc/nginx/nginx.conf +COPY conf/default.conf /etc/nginx/conf.d/default.conf +COPY conf/mime.types /etc/nginx/mime.types diff --git a/conf/.editorconfig b/conf/.editorconfig new file mode 100644 index 0000000..777042a --- /dev/null +++ b/conf/.editorconfig @@ -0,0 +1,4 @@ + +[*] +indent_size = 2 +indent_style = space diff --git a/conf/default.conf b/conf/default.conf new file mode 100644 index 0000000..5fb85b1 --- /dev/null +++ b/conf/default.conf @@ -0,0 +1,44 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} \ No newline at end of file diff --git a/conf/mime.types b/conf/mime.types new file mode 100644 index 0000000..c187e6c --- /dev/null +++ b/conf/mime.types @@ -0,0 +1,110 @@ + +types { + +# Audio + audio/midi mid midi kar; + audio/mp4 aac f4a f4b m4a; + audio/mpeg mp3; + audio/ogg oga ogg; + audio/x-realaudio ra; + audio/x-wav wav; + +# Images + image/bmp bmp; + image/gif gif; + image/jpeg jpeg jpg; + image/png png; + image/tiff tif tiff; + image/vnd.wap.wbmp wbmp; + image/webp webp; + image/x-icon ico cur; + image/x-jng jng; + +# JavaScript + application/javascript js; + application/json json; + +# Manifest files + application/x-web-app-manifest+json webapp; + text/cache-manifest manifest appcache; + +# Microsoft Office + application/msword doc; + application/vnd.ms-excel xls; + application/vnd.ms-powerpoint ppt; + application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; + application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; + +# Video + video/3gpp 3gpp 3gp; + video/mp4 mp4 m4v f4v f4p; + video/mpeg mpeg mpg; + video/ogg ogv; + video/quicktime mov; + video/webm webm; + video/x-flv flv; + video/x-mng mng; + video/x-ms-asf asx asf; + video/x-ms-wmv wmv; + video/x-msvideo avi; + +# Web feeds + application/xml atom rdf rss xml; + +# Web fonts + application/font-woff woff; + application/vnd.ms-fontobject eot; + application/x-font-ttf ttc ttf; + font/opentype otf; + image/svg+xml svg svgz; + +# Other + application/pgp-keys key; + application/java-archive jar war ear; + application/mac-binhex40 hqx; + application/pdf pdf; + application/postscript ps eps ai; + application/rtf rtf; + application/vnd.wap.wmlc wmlc; + application/xhtml+xml xhtml; + application/vnd.google-earth.kml+xml kml; + application/vnd.google-earth.kmz kmz; + application/x-7z-compressed 7z; + application/x-chrome-extension crx; + application/x-opera-extension oex; + application/x-xpinstall xpi; + application/x-cocoa cco; + application/x-java-archive-diff jardiff; + application/x-java-jnlp-file jnlp; + application/x-makeself run; + application/x-perl pl pm; + application/x-pilot prc pdb; + application/x-rar-compressed rar; + application/x-redhat-package-manager rpm; + application/x-sea sea; + application/x-shockwave-flash swf; + application/x-stuffit sit; + application/x-tcl tcl tk; + application/x-x509-ca-cert der pem crt; + application/x-bittorrent torrent; + application/zip zip; + + application/octet-stream bin exe dll; + application/octet-stream deb; + application/octet-stream dmg; + application/octet-stream iso img; + application/octet-stream msi msp msm; + application/octet-stream safariextz; + + text/css css; + text/html html htm shtml; + text/mathml mml; + text/plain txt bnf ebnf abnf; + text/vnd.sun.j2me.app-descriptor jad; + text/vnd.wap.wml wml; + text/vtt vtt; + text/x-component htc; + text/x-vcard vcf; + +} \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..ed95f7b --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,73 @@ + +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 20; + + + + # Compression + + # Compression level (1-9). + gzip_comp_level 5; + + # Don't compress anything that's already small and unlikely to shrink much + # if at all (the default is 20 bytes, which is bad as that usually leads to + # larger files after gzipping). + gzip_min_length 256; + + # Compress data even for clients that are connecting to us via proxies, + # identified by the "Via" header + gzip_proxied any; + + # Tell proxies to cache both the gzipped and regular version of a resource + # whenever the client's Accept-Encoding capabilities header varies; + # Avoids the issue where a non-gzip capable client (which is extremely rare + # today) would display gibberish if their proxy gave them the gzipped version. + gzip_vary on; + + # Compress all output labeled with one of the following MIME-types. + gzip_types + application/atom+xml + application/javascript + application/json + application/rss+xml + application/vnd.ms-fontobject + application/x-font-ttf + application/x-web-app-manifest+json + application/xhtml+xml + application/xml + font/opentype + image/svg+xml + image/x-icon + text/css + text/plain + text/x-component; + # text/html is always compressed by HttpGzipModule + + + + include /etc/nginx/conf.d/*.conf; +} diff --git a/config.yaml b/config.yaml index b37d7dc..ed28b6c 100644 --- a/config.yaml +++ b/config.yaml @@ -54,9 +54,9 @@ templates: # (Optional) whitelist of environment variables to be made accessible # under `env` when processing templates - env: - - EXAMPLE_ENVIRONMENT_VARIABLE - - FOO_BAR_BAZ + env: [] + # - EXAMPLE_ENVIRONMENT_VARIABLE + # - FOO_BAR_BAZ # Output Configuration (where to put your website) output: @@ -92,7 +92,7 @@ output: # Markdown-to-HTML Configuration markdown: # - base_url: http://localhost:8000 + base_url: / # custom_elements: diff --git a/docs/_assets/base.css b/docs/_assets/base.css index 4479852..1fe74a0 100644 --- a/docs/_assets/base.css +++ b/docs/_assets/base.css @@ -257,8 +257,6 @@ body[data-color-transition-enabled] :is( padding: 1rem; padding-block-end: 5rem; z-index: 1; - max-width: 100rem; - margin-inline: auto; } @media screen and (min-width: 60rem) { @@ -273,6 +271,12 @@ body[data-color-transition-enabled] :is( } } +#root > nav, +#root > main { + max-width: 100rem; + margin-inline: auto; +} + @@ -1148,10 +1152,12 @@ figure[data-size='small'] svg { figure[data-size='medium'] svg { max-width: 60rem; max-height: min(40rem, 50vw); + margin-block-start: 4rem; } figure[data-size='large'] svg { max-height: min(60rem, 80vw); + margin-block-start: 6rem; } /* figure[data-lang].big { diff --git a/docs/_assets/colors.css b/docs/_assets/colors.css index a756c93..c0391a3 100644 --- a/docs/_assets/colors.css +++ b/docs/_assets/colors.css @@ -20,3 +20,19 @@ body[data-color-scheme='dark'] { {{> .themes/Minimal Light }} } } + + + +/* todo: switch from having 2 themes (above) to 4 themes (below) */ + +@media (prefers-contrast: no-preference) { + /* todo: default themes */ +} + +@media (prefers-contrast: more) { + /* todo: high contrast themes */ +} + +@media (prefers-contrast: less) { + /* todo: low contrast themes */ +} diff --git a/docs/color-themes/index.md b/docs/color-themes/index.md index 5dc9b2d..ffa0a1a 100644 --- a/docs/color-themes/index.md +++ b/docs/color-themes/index.md @@ -1,12 +1,10 @@ --- title: Color Themes | doc-utils layout: main.html +breadcrumb: +- '[doc-utils](index.html)' --- -/// -[doc-utils](index.html) -/// - # Color Themes {#/} _todo_ diff --git a/docs/docs2website/building-from-source.md b/docs/docs2website/building-from-source.md index da7f724..b16b455 100644 --- a/docs/docs2website/building-from-source.md +++ b/docs/docs2website/building-from-source.md @@ -1,13 +1,11 @@ --- title: Building From Source | docs2website layout: main.html +breadcrumb: +- '[doc-utils](index.html)' +- '[docs2website](docs2website/index.html)' --- -/// -[doc-utils](index.html) -[docs2website](docs2website/index.html) -/// - # Building From Source {#/} _todo_ diff --git a/docs/docs2website/command-line-use.md b/docs/docs2website/command-line-use.md index 01e8398..74658da 100644 --- a/docs/docs2website/command-line-use.md +++ b/docs/docs2website/command-line-use.md @@ -1,13 +1,11 @@ --- title: Command Line Use | docs2website layout: main.html +breadcrumb: +- '[doc-utils](index.html)' +- '[docs2website](docs2website/index.html)' --- -/// -[doc-utils](index.html) -[docs2website](docs2website/index.html) -/// - # Command Line Use {#/} Command line use is very straight-forward, as there is only one valid way to call the command: diff --git a/docs/docs2website/configuration.md b/docs/docs2website/configuration.md index a7d5b1b..023ed62 100644 --- a/docs/docs2website/configuration.md +++ b/docs/docs2website/configuration.md @@ -1,13 +1,11 @@ --- title: Configuration | docs2website layout: main.html +breadcrumb: +- '[doc-utils](index.html)' +- '[docs2website](docs2website/index.html)' --- -/// -[doc-utils](index.html) -[docs2website](docs2website/index.html) -/// - # Configuration {#/} diff --git a/docs/docs2website/index.md b/docs/docs2website/index.md index 8ae4ed6..14b1708 100644 --- a/docs/docs2website/index.md +++ b/docs/docs2website/index.md @@ -1,12 +1,10 @@ --- title: docs2website layout: main.html +breadcrumb: +- '[doc-utils](index.html)' --- -/// -[doc-utils](index.html) -/// - # docs2website {#/} The [docs2website] project is a static site generator primarily focused on technical writing and documentation. diff --git a/docs/docs2website/programatic-use.md b/docs/docs2website/programatic-use.md index 545dd68..ce27ff4 100644 --- a/docs/docs2website/programatic-use.md +++ b/docs/docs2website/programatic-use.md @@ -1,13 +1,11 @@ --- title: Programatic Use | docs2website layout: main.html +breadcrumb: +- '[doc-utils](index.html)' +- '[docs2website](docs2website/index.html)' --- -/// -[doc-utils](index.html) -[docs2website](docs2website/index.html) -/// - # Programatic Use {#/} _todo_ diff --git a/docs/index.md b/docs/index.md index 8241baa..906299c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,7 +3,7 @@ title: doc-utils layout: main.html --- -# doc-utils {#/} +# doc-utils {#-} Documentation for the doc-utils projects. @@ -57,7 +57,7 @@ ETC: box "Etc..." same \ dashed MD: box "Markdown" same as JSCH \ - at 2.5 east of CSBOM \ + at 3 east of CSBOM \ color yellow fill yellow HTML: box "HTML Fragments" same \ diff --git a/docs/markdown2html/building-from-source.md b/docs/markdown2html/building-from-source.md index a9a1391..2cb9d76 100644 --- a/docs/markdown2html/building-from-source.md +++ b/docs/markdown2html/building-from-source.md @@ -1,13 +1,11 @@ --- title: Building From Source | markdown2html layout: main.html +breadcrumb: +- '[doc-utils](index.html)' +- '[markdown2html](markdown2html/index.html)' --- -/// -[doc-utils](index.html) -[markdown2html](markdown2html/index.html) -/// - # Building From Source {#/} _todo_ diff --git a/docs/markdown2html/index.md b/docs/markdown2html/index.md index 5c4f5b5..1652f1a 100644 --- a/docs/markdown2html/index.md +++ b/docs/markdown2html/index.md @@ -1,12 +1,10 @@ --- title: markdown2html | doc-utils layout: main.html +breadcrumb: +- '[doc-utils](index.html)' --- -/// -[doc-utils](index.html) -/// - # markdown2html {#/} _todo_ diff --git a/docs/markdown2html/markdown-format.md b/docs/markdown2html/markdown-format.md index 72ef912..66e2faa 100644 --- a/docs/markdown2html/markdown-format.md +++ b/docs/markdown2html/markdown-format.md @@ -1,13 +1,11 @@ --- title: Markdown Format | markdown2html | doc-utils layout: main.html +breadcrumb: +- '[doc-utils](index.html)' +- '[markdown2html](markdown2html/index.html)' --- -/// -[doc-utils](index.html) -[markdown2html](markdown2html/index.html) -/// - # Markdown Format {#/} This document describes the extensions added on top of [Marked {:external-link:}](https://marked.js.org/) by [markdown2html]. @@ -211,30 +209,6 @@ _todo_ -## Breadcrumb Navigation - -_todo_ - -```md -/// -[Foo](#foo) -[Bar](#bar) -[Baz](#baz) -/// -``` - -!!! {.markdown-example-output} -/// -[Foo](#foo) -[Bar](#bar) -[Baz](#baz) -/// -!!! - - - - - ## Sample Output