From f45258b6b7b11a29e3a3ce47979cf19e8e701f7f Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 12 Oct 2025 11:18:41 -0700 Subject: [PATCH 1/3] Revert "Add documentation search." This reverts commit 6d7dc378a9c91062fee31305024761bcc4975206. --- NEWS | 1 - README.md | 3 +++ docs/Dockerfile | 1 - docs/_includes/header.njk | 1 - docs/_includes/index.css | 12 ------------ docs/_includes/layouts/base.njk | 3 ++- docs/_includes/layouts/main.njk | 10 ---------- docs/search.md | 14 -------------- 8 files changed, 5 insertions(+), 40 deletions(-) delete mode 100644 docs/search.md diff --git a/NEWS b/NEWS index 8c2b997c..83494dbb 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,5 @@ 2.0.10.dev0 * #1161: Fix a traceback (TypeError) in the "check" action with Python 3.14. - * Add documentation search. 2.0.9 * #1105: More accurately collect Btrfs subvolumes to snapshot. As part of this, the Btrfs hook no diff --git a/README.md b/README.md index 54cb4e1f..f58b3ce9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ title: borgmatic permalink: index.html --- + +## It's your data. Keep it that way. + borgmatic logo borgmatic is simple, configuration-driven backup software for servers and diff --git a/docs/Dockerfile b/docs/Dockerfile index d0f20028..cfa1b828 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -29,7 +29,6 @@ COPY --from=borgmatic /contributors.html /source/docs/_includes/borgmatic/contri COPY . /source RUN NODE_ENV=${ENVIRONMENT} npx eleventy --input=/source/docs --output=/output/docs \ && mv /output/docs/index.html /output/index.html -RUN npx -y pagefind --site /output FROM docker.io/nginx:1.26.1-alpine diff --git a/docs/_includes/header.njk b/docs/_includes/header.njk index 16b5b691..f511e012 100644 --- a/docs/_includes/header.njk +++ b/docs/_includes/header.njk @@ -1,5 +1,4 @@
{% if page.url != '/' %}

borgmatic

{% endif %}

{{ title | safe }}

- {% if page.url == '/' %}

It's your data. Keep it that way.

{% endif %}
diff --git a/docs/_includes/index.css b/docs/_includes/index.css index 27289591..c798f2e9 100644 --- a/docs/_includes/index.css +++ b/docs/_includes/index.css @@ -548,15 +548,3 @@ main .elv-toc + h1 .direct-link { .mdi.mdi-content-copy { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z'/%3E%3C/svg%3E"); } - -#search-entrance { - padding-bottom: 1em; -} - -#search-entrance form { - display: inline-block; -} - -#search { - padding-top: 1em; -} diff --git a/docs/_includes/layouts/base.njk b/docs/_includes/layouts/base.njk index 9c32cf4e..0807f5f0 100644 --- a/docs/_includes/layouts/base.njk +++ b/docs/_includes/layouts/base.njk @@ -4,7 +4,8 @@ - borgmatic{% if subtitle or title %} - {% endif %}{{ subtitle + ' - ' if subtitle}}{{ title }} + + {{ subtitle + ' - ' if subtitle}}{{ title }} {%- set css %} {% include 'index.css' %} {% include 'components/lists.css' %} diff --git a/docs/_includes/layouts/main.njk b/docs/_includes/layouts/main.njk index fa653a9e..81300bae 100644 --- a/docs/_includes/layouts/main.njk +++ b/docs/_includes/layouts/main.njk @@ -7,16 +7,6 @@ headerClass: elv-header-default
- {% if page.url != '/search/' %} -
- 🔍 -
- -
-
- {% endif %}
{% set navPages = collections.all | eleventyNavigation %} {% macro renderNavListItem(entry) -%} diff --git a/docs/search.md b/docs/search.md deleted file mode 100644 index b704b2af..00000000 --- a/docs/search.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Search documentation -eleventyExcludeFromCollections: true ---- - - - - From 8ea9a7cb5530a990ae26266355c54d978cea7284 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 12 Oct 2025 15:16:25 -0700 Subject: [PATCH 2/3] Change the URL of the local documentation development server to be more like the production URL. --- .eleventy.js | 2 +- NEWS | 1 + docs/_includes/layouts/main.njk | 2 +- docs/docker-compose.yaml | 35 ++++++++++++++++++++++++++--- docs/how-to/develop-on-borgmatic.md | 2 +- scripts/dev-docs | 1 + 6 files changed, 37 insertions(+), 6 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index 30057a4a..4ed8c195 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -21,7 +21,7 @@ module.exports = function(eleventyConfig) { if (process.env.NODE_ENV == "production") { return link; } - return link.replace('https://torsion.org/borgmatic/', 'http://localhost:8080/'); + return link.replace('https://torsion.org/', 'http://localhost:8080/'); } }; let markdownItAnchorOptions = { diff --git a/NEWS b/NEWS index 83494dbb..bde39c25 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ 2.0.10.dev0 * #1161: Fix a traceback (TypeError) in the "check" action with Python 3.14. + * Change the URL of the local documentation development server to be more like the production URL. 2.0.9 * #1105: More accurately collect Btrfs subvolumes to snapshot. As part of this, the Btrfs hook no diff --git a/docs/_includes/layouts/main.njk b/docs/_includes/layouts/main.njk index 81300bae..82b4e32b 100644 --- a/docs/_includes/layouts/main.njk +++ b/docs/_includes/layouts/main.njk @@ -11,7 +11,7 @@ headerClass: elv-header-default {% set navPages = collections.all | eleventyNavigation %} {% macro renderNavListItem(entry) -%} - {{ entry.title }} + {{ entry.title }} {%- if entry.children.length -%}
    {%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%} diff --git a/docs/docker-compose.yaml b/docs/docker-compose.yaml index f6934ce0..cbf2eda7 100644 --- a/docs/docker-compose.yaml +++ b/docs/docker-compose.yaml @@ -1,9 +1,38 @@ services: + traefik: + image: public.ecr.aws/docker/library/traefik:3.5.3 + container_name: borgmatic-docs-traefik + command: + - "--global.checkNewVersion=false" + - "--global.sendAnonymousUsage=false" + - "--entrypoints.web.address=:8080" + - "--accesslog" + - "--accesslog.fields.headers.defaultmode=keep" + - "--providers.docker" + - "--providers.docker.exposedbydefault=false" + - "--api.insecure=false" + - "--api.dashboard=false" + - "--log.level=WARN" + ports: + - "127.0.0.1:8080:8080" + volumes: + - ${CONTAINER_SOCKET_PATH:-/run/user/docker.sock}:/var/run/docker.sock:ro docs: image: borgmatic-docs container_name: borgmatic-docs - ports: - - 8080:80 + labels: + - "traefik.enable=true" + - "traefik.http.routers.borgmatic-docs.rule=PathPrefix(`/borgmatic`)" +# - "traefik.http.routers.borgmatic-docs.middlewares=borgmatic-trailing-slash-redirectregex,borgmatic-docs-redirectregex,borgmatic-stripprefix" + - "traefik.http.routers.borgmatic-docs.middlewares=borgmatic-trailing-slash-redirectregex,borgmatic-stripprefix" + - "traefik.http.middlewares.borgmatic-trailing-slash-redirectregex.redirectregex.regex=^(.*)/borgmatic$$" + - "traefik.http.middlewares.borgmatic-trailing-slash-redirectregex.redirectregex.replacement=$${1}/borgmatic/" + - "traefik.http.middlewares.borgmatic-trailing-slash-redirectregex.redirectregex.permanent=true" +# - "traefik.http.middlewares.borgmatic-docs-redirectregex.redirectregex.regex=^(.*)/borgmatic/docs/(.*)$$" +# - "traefik.http.middlewares.borgmatic-docs-redirectregex.redirectregex.replacement=$${1}/borgmatic/$${2}" +# - "traefik.http.middlewares.borgmatic-docs-redirectregex.redirectregex.permanent=true" + - "traefik.http.middlewares.borgmatic-stripprefix.stripprefix.prefixes=/borgmatic" + - "traefik.http.routers.borgmatic-docs.entrypoints=web" build: dockerfile: docs/Dockerfile context: .. @@ -16,6 +45,6 @@ services: - sh - -c - | - echo; echo "You can view dev docs at http://localhost:8080"; echo + echo; echo "You can view dev docs at http://localhost:8080/borgmatic/"; echo depends_on: - docs diff --git a/docs/how-to/develop-on-borgmatic.md b/docs/how-to/develop-on-borgmatic.md index 084be6cd..aac59903 100644 --- a/docs/how-to/develop-on-borgmatic.md +++ b/docs/how-to/develop-on-borgmatic.md @@ -217,7 +217,7 @@ This script assumes you have permission to run `docker`. If you don't, then you may need to run with `sudo`. After you run the script, you can point your web browser at -http://localhost:8080 to view the documentation with your changes. +http://localhost:8080/borgmatic/ to view the documentation with your changes. To close the documentation server, ctrl-C the script. Note that it does not currently auto-reload, so you'll need to stop it and re-run it for any diff --git a/scripts/dev-docs b/scripts/dev-docs index 7443802c..f1ac6139 100755 --- a/scripts/dev-docs +++ b/scripts/dev-docs @@ -6,6 +6,7 @@ USER_PODMAN_SOCKET_PATH=/run/user/$UID/podman/podman.sock if [ -e "$USER_PODMAN_SOCKET_PATH" ]; then export DOCKER_HOST="unix://$USER_PODMAN_SOCKET_PATH" + export CONTAINER_SOCKET_PATH="$USER_PODMAN_SOCKET_PATH" fi BUILDKIT_PROGRESS=plain docker-compose --file docs/docker-compose.yaml up --build --force-recreate From a1acf1e0dde9fd370a05f38dc086ea7a5668e798 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 12 Oct 2025 15:37:28 -0700 Subject: [PATCH 3/3] Add documentation search. --- NEWS | 1 + README.md | 3 --- docs/Dockerfile | 1 + docs/_includes/header.njk | 1 + docs/_includes/index.css | 12 ++++++++++++ docs/_includes/layouts/base.njk | 3 +-- docs/_includes/layouts/main.njk | 10 ++++++++++ docs/search.md | 14 ++++++++++++++ 8 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 docs/search.md diff --git a/NEWS b/NEWS index bde39c25..355f7700 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ 2.0.10.dev0 * #1161: Fix a traceback (TypeError) in the "check" action with Python 3.14. + * Add documentation search. * Change the URL of the local documentation development server to be more like the production URL. 2.0.9 diff --git a/README.md b/README.md index f58b3ce9..54cb4e1f 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ title: borgmatic permalink: index.html --- - -## It's your data. Keep it that way. - borgmatic logo borgmatic is simple, configuration-driven backup software for servers and diff --git a/docs/Dockerfile b/docs/Dockerfile index cfa1b828..d0f20028 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -29,6 +29,7 @@ COPY --from=borgmatic /contributors.html /source/docs/_includes/borgmatic/contri COPY . /source RUN NODE_ENV=${ENVIRONMENT} npx eleventy --input=/source/docs --output=/output/docs \ && mv /output/docs/index.html /output/index.html +RUN npx -y pagefind --site /output FROM docker.io/nginx:1.26.1-alpine diff --git a/docs/_includes/header.njk b/docs/_includes/header.njk index f511e012..16b5b691 100644 --- a/docs/_includes/header.njk +++ b/docs/_includes/header.njk @@ -1,4 +1,5 @@
    {% if page.url != '/' %}

    borgmatic

    {% endif %}

    {{ title | safe }}

    + {% if page.url == '/' %}

    It's your data. Keep it that way.

    {% endif %}
    diff --git a/docs/_includes/index.css b/docs/_includes/index.css index c798f2e9..27289591 100644 --- a/docs/_includes/index.css +++ b/docs/_includes/index.css @@ -548,3 +548,15 @@ main .elv-toc + h1 .direct-link { .mdi.mdi-content-copy { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z'/%3E%3C/svg%3E"); } + +#search-entrance { + padding-bottom: 1em; +} + +#search-entrance form { + display: inline-block; +} + +#search { + padding-top: 1em; +} diff --git a/docs/_includes/layouts/base.njk b/docs/_includes/layouts/base.njk index 0807f5f0..9c32cf4e 100644 --- a/docs/_includes/layouts/base.njk +++ b/docs/_includes/layouts/base.njk @@ -4,8 +4,7 @@ - - {{ subtitle + ' - ' if subtitle}}{{ title }} + borgmatic{% if subtitle or title %} - {% endif %}{{ subtitle + ' - ' if subtitle}}{{ title }} {%- set css %} {% include 'index.css' %} {% include 'components/lists.css' %} diff --git a/docs/_includes/layouts/main.njk b/docs/_includes/layouts/main.njk index 82b4e32b..4f06cdf8 100644 --- a/docs/_includes/layouts/main.njk +++ b/docs/_includes/layouts/main.njk @@ -7,6 +7,16 @@ headerClass: elv-header-default
    + {% if page.url != '/search/' %} +
    + 🔍 +
    + +
    +
    + {% endif %}
    {% set navPages = collections.all | eleventyNavigation %} {% macro renderNavListItem(entry) -%} diff --git a/docs/search.md b/docs/search.md new file mode 100644 index 00000000..3d476a38 --- /dev/null +++ b/docs/search.md @@ -0,0 +1,14 @@ +--- +title: Search documentation +eleventyExcludeFromCollections: true +--- + + + +