Rewrite documentation navigation URLs when being run locally.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
196a226a7e
commit
5b991b88dd
5
docs/_data/borgmatic.js
Normal file
5
docs/_data/borgmatic.js
Normal file
@ -0,0 +1,5 @@
|
||||
module.exports = function() {
|
||||
return {
|
||||
environment: process.env.NODE_ENV || "development"
|
||||
};
|
||||
};
|
@ -11,7 +11,7 @@ headerClass: elv-header-default
|
||||
{% set navPages = collections.all | eleventyNavigation %}
|
||||
{% macro renderNavListItem(entry) -%}
|
||||
<li{% if entry.url == page.url %} class="elv-toc-active"{% endif %}>
|
||||
<a {% if entry.url %}href="https://torsion.org/borgmatic/docs{{ entry.url | url }}"{% endif %}>{{ entry.title }}</a>
|
||||
<a {% if entry.url %}href="{% if borgmatic.environment == "production" %}https://torsion.org/borgmatic/docs{% else %}http://localhost:8080/docs{% endif %}{{ entry.url | url }}"{% endif %}>{{ entry.title }}</a>
|
||||
{%- if entry.children.length -%}
|
||||
<ul>
|
||||
{%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
|
||||
|
@ -9,7 +9,7 @@ services:
|
||||
dockerfile: docs/Dockerfile
|
||||
context: ..
|
||||
args:
|
||||
ENVIRONMENT: dev
|
||||
ENVIRONMENT: development
|
||||
message:
|
||||
image: alpine
|
||||
container_name: message
|
||||
|
Loading…
Reference in New Issue
Block a user