diff --git a/.eleventy.js b/.eleventy.js index 12543f7c..f6d95fa1 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 e8fbbae4..c1e20f03 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ https://torsion.org/borgmatic/ * #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 * #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 b2c6a064..4391aa10 100644 --- a/docs/_includes/layouts/main.njk +++ b/docs/_includes/layouts/main.njk @@ -10,7 +10,7 @@ headerClass: elv-header-default {% if page.url != '/search/' %}
🔍 -
+ @@ -21,7 +21,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 34fc841f..442ff32e 100644 --- a/docs/how-to/develop-on-borgmatic.md +++ b/docs/how-to/develop-on-borgmatic.md @@ -215,7 +215,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/docs/search.md b/docs/search.md index b704b2af..3d476a38 100644 --- a/docs/search.md +++ b/docs/search.md @@ -2,8 +2,8 @@ title: Search documentation eleventyExcludeFromCollections: true --- - - + +