update docs nav definition
This commit is contained in:
+1
-3
@@ -1,6 +1,5 @@
|
||||
const { format } = require('date-fns')
|
||||
const htmlmin = require('html-minifier')
|
||||
const navigationPlugin = require('@11ty/eleventy-navigation')
|
||||
const syntaxHighlightPlugin = require('@11ty/eleventy-plugin-syntaxhighlight')
|
||||
|
||||
function noteContainer() {
|
||||
@@ -68,7 +67,7 @@ module.exports = function (eleventyConfig) {
|
||||
|
||||
eleventyConfig.addFilter(
|
||||
'debug',
|
||||
(content) => `<pre>${JSON.stringify(content, null, 2)}</pre>`
|
||||
(content = {}) => `<pre>${JSON.stringify(content, null, 2)}</pre>`
|
||||
)
|
||||
|
||||
// Minify HTML output
|
||||
@@ -85,7 +84,6 @@ module.exports = function (eleventyConfig) {
|
||||
|
||||
eleventyConfig.setLibrary('md', getMarkdownLib())
|
||||
eleventyConfig.addPlugin(syntaxHighlightPlugin)
|
||||
eleventyConfig.addPlugin(navigationPlugin)
|
||||
|
||||
eleventyConfig.addCollection('docs', (collection) =>
|
||||
collection.getFilteredByGlob('src/docs/**/*.md')
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "^0.12.1",
|
||||
"@11ty/eleventy-navigation": "^0.2.0",
|
||||
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.1",
|
||||
"@tailwindcss/typography": "^0.4.1",
|
||||
"autoprefixer": "^10.2.6",
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
module.exports = 'docs.njk'
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: Automatic Backup
|
||||
menuTitle: Automatic
|
||||
parent: Backup
|
||||
order: 400
|
||||
---
|
||||
|
||||
Remark42 by default makes daily backup files under `${BACKUP_PATH}` (default `./var/backup`). Backups kept up to `${MAX_BACKUP_FILES}` (default 10). Each backup file contains exported and gzipped content, i.e. all comments. At any point, the user can restore such backup and revert all comments to the desired state.
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
---
|
||||
layout: redirect.njk
|
||||
destination: /docs/backup/automatic/
|
||||
title: Backup
|
||||
order: 300
|
||||
---
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: Manual Backup
|
||||
menuTitle: Manual
|
||||
parent: Backup
|
||||
order: 300
|
||||
---
|
||||
|
||||
You can make a backup manually whenever you want. Run command:
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Migration
|
||||
parent: Backup
|
||||
order: 300
|
||||
---
|
||||
|
||||
Remark42 supports importing comments from Disqus, WordPress, or native backup format. All imported comments have an `Imported` field set to `true`.
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: Restore Backup
|
||||
menuTitle: Restore
|
||||
parent: Backup
|
||||
order: 300
|
||||
---
|
||||
|
||||
Restore will clean all comments first and then will process with complete import from a given file.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Site URL migration
|
||||
parent: Backup
|
||||
order: 400
|
||||
---
|
||||
|
||||
Here is an example on how to move your comments after your posts are moved, from `https://example.org/blog/<slug>` to `https://example.org/post/<slug>` in that example.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Authorization
|
||||
parent: Configuration
|
||||
order: 200
|
||||
---
|
||||
|
||||
## OAuth Providers
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: Email Settings
|
||||
menuTitle: Email
|
||||
parent: Configuration
|
||||
order: 300
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: Frontend Configuration
|
||||
menuTitle: Frontend
|
||||
parent: Configuration
|
||||
order: 100
|
||||
---
|
||||
|
||||
## Comments
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
---
|
||||
layout: redirect.njk
|
||||
destination: /docs/configuration/frontend/
|
||||
title: Configuration
|
||||
order: 200
|
||||
---
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: Deploy with Kubernetes
|
||||
menuTitle: Kubernetes
|
||||
parent: Configuration
|
||||
order: 700
|
||||
---
|
||||
|
||||
## Using Helm
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: Configure with Nginx
|
||||
menuTitle: Nginx
|
||||
parent: Configuration
|
||||
order: 500
|
||||
---
|
||||
|
||||
## How to configure remark42 with nginx reverse proxy
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Notification
|
||||
parent: Configuration
|
||||
order: 400
|
||||
---
|
||||
|
||||
## Email
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Reproxy
|
||||
parent: Configuration
|
||||
order: 600
|
||||
title: Configure with Reproxy
|
||||
---
|
||||
|
||||
## How to configure remark42 with [Reproxy](https://reproxy.io)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: Configure Instance on Subdomain
|
||||
menuTitle: Subdomain
|
||||
parent: Configuration
|
||||
order: 600
|
||||
---
|
||||
|
||||
## How to configure remark42 without a subdomain
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: API
|
||||
parent: Contributing
|
||||
order: 400
|
||||
---
|
||||
|
||||
## Authorization
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
---
|
||||
title: Backend Development Guidelines
|
||||
menuTitle: Backend
|
||||
key: Backend Guidelines
|
||||
parent: Development
|
||||
order: 100
|
||||
---
|
||||
|
||||
In Progress...
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
---
|
||||
title: Frontend Development Guidelines
|
||||
menuTitle: Frontend
|
||||
key: Frontend Guidelines
|
||||
parent: Development
|
||||
order: 100
|
||||
---
|
||||
|
||||
### Code Style
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Development
|
||||
parent: Contributing
|
||||
order: 200
|
||||
---
|
||||
|
||||
You can use a fully functional local version to develop and test both frontend and backend. It requires at least 2GB RAM or swap enabled.
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
---
|
||||
layout: redirect.njk
|
||||
destination: /docs/contributing/code-of-conduct/
|
||||
title: Contributing
|
||||
order: 500
|
||||
destination: /docs/contributing/development/
|
||||
---
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Technical Details
|
||||
order: 600
|
||||
parent: Contributing
|
||||
---
|
||||
|
||||
Remark42 uses boltdb (embedded key/value database) files under `STORE_BOLT_PATH` for storing data. Each site stored in a separate boltbd file.
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
---
|
||||
title: Interface Translations
|
||||
menuTitle: Translations
|
||||
parent: Contributing
|
||||
order: 300
|
||||
---
|
||||
|
||||
## Add a New Language to Remark42
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
module.exports = {
|
||||
eleventyComputed: {
|
||||
eleventyNavigation: {
|
||||
key: (data) => data.key || data.menuTitle || data.title,
|
||||
title: (data) => data.menuTitle || data.title,
|
||||
parent: (data) => data.parent,
|
||||
order: (data) => data.order,
|
||||
},
|
||||
},
|
||||
nav: require('./nav.json'),
|
||||
layout: 'docs.njk',
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
---
|
||||
title: Getting Started
|
||||
layout: redirect.njk
|
||||
destination: /docs/getting-started/installation/
|
||||
order: 100
|
||||
---
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Installation
|
||||
parent: Getting Started
|
||||
order: 100
|
||||
---
|
||||
|
||||
## Setup Remark42 Instance on Your Server
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: System Requirements
|
||||
parent: Getting Started
|
||||
order: 200
|
||||
---
|
||||
|
||||
In progress...
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
[
|
||||
{
|
||||
"section": "Getting Started",
|
||||
"children": [
|
||||
{ "title": "Installation", "href": "/getting-started/installation/" },
|
||||
{
|
||||
"title": "System Requirements",
|
||||
"href": "/getting-started/system-requirements/"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"section": "Configuration",
|
||||
"children": [
|
||||
{ "title": "Frontend", "href": "/configuration/frontend/" },
|
||||
{ "title": "Authorization", "href": "/configuration/authorization/" },
|
||||
{ "title": "Email", "href": "/configuration/email/" },
|
||||
{ "title": "Notifications", "href": "/configuration/notifications/" },
|
||||
{ "title": "Nginx", "href": "/configuration/nginx/" },
|
||||
{ "title": "Reproxy", "href": "/configuration/reproxy/" },
|
||||
{ "title": "Subdomain", "href": "/configuration/subdomain/" },
|
||||
{ "title": "Kubernetes", "href": "/configuration/kubernetes/" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"section": "Backup",
|
||||
"children": [
|
||||
{ "title": "Manual", "href": "/backup/manual/" },
|
||||
{ "title": "Migration", "href": "/backup/migration/" },
|
||||
{ "title": "Restore", "href": "/backup/restore/" },
|
||||
{ "title": "Site URL migration", "href": "/backup/url-migration/" },
|
||||
{ "title": "Automatic", "href": "/backup/automatic/" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"section": "Contrubuting",
|
||||
"children": [
|
||||
{
|
||||
"title": "Development",
|
||||
"href": "/contributing/development/",
|
||||
"children": [
|
||||
{ "title": "Backend", "href": "/contributing/development/backend/" },
|
||||
{ "title": "Frontend", "href": "/contributing/development/frontend/" }
|
||||
]
|
||||
},
|
||||
{ "title": "Translations", "href": "/contributing/translations/" },
|
||||
{ "title": "API", "href": "/contributing/api/" },
|
||||
{
|
||||
"title": "Technical Details",
|
||||
"href": "/contributing/technical-details/"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -1,21 +1,16 @@
|
||||
{% macro renderList(entry, level) %}
|
||||
{% if level === 1 %}
|
||||
<h5 class="uppercase font-semibold text-sm text-gray-400 mb-2">{{ entry.title }}</h5>
|
||||
{% else %}
|
||||
{% macro navItem(entry) %}
|
||||
<li class="my-1">
|
||||
<a class="py-1 px-2 -mx-2 block rounded text-gray-600 dark:text-gray-300 {% if entry.url === page.url %} bg-brand-100 dark:bg-brand-900 text-brand-600 dark:text-brand-400 hover:text-brand-600{% else %} hover:text-gray-900 dark:hover:text-gray-400{% endif %}" href="{{ entry.url | url }}">{{ entry.title }}</a>
|
||||
{% endif %}
|
||||
{% if entry.children and level < 2 %}
|
||||
<ul class="mb-8 font-medium">
|
||||
{% for child in entry.children %}
|
||||
{{renderList(child, level + 1)}}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if entry.children and level >= 2 and page.url.startsWith(entry.url) %}
|
||||
<a class="py-1 px-2 -mx-2 block rounded text-gray-600 dark:text-gray-300 {% if page.url === '/docs' + entry.href %} bg-brand-100 dark:bg-brand-900 text-brand-600 dark:text-brand-400 hover:text-brand-600{% else %} hover:text-gray-900 dark:hover:text-gray-400{% endif %}" href="/docs{{ entry.href | url }}">
|
||||
{{ entry.title }}
|
||||
</a>
|
||||
{% if entry.children and page.url.startsWith('/docs' + entry.href) %}
|
||||
<ul class="ml-4 font-normal">
|
||||
{% for child in entry.children %}
|
||||
{{renderList(child, level + 1)}}
|
||||
{% for entry in entry.children %}
|
||||
<li class="my-1">
|
||||
<a class="py-1 px-2 -mx-2 block rounded text-gray-600 dark:text-gray-300 {% if page.url === '/docs' + entry.href %} bg-brand-100 dark:bg-brand-900 text-brand-600 dark:text-brand-400 hover:text-brand-600{% else %} hover:text-gray-900 dark:hover:text-gray-400{% endif %}" href="/docs{{ entry.href | url }}">
|
||||
{{ entry.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
@@ -33,8 +28,15 @@
|
||||
Open Menu
|
||||
</label>
|
||||
<nav class="hidden md:block mr-10">
|
||||
{% for entry in collections.docs | eleventyNavigation %}
|
||||
{{renderList(entry, 1)}}
|
||||
{% for entry in nav %}
|
||||
{% if entry.section %}
|
||||
<h5 class="uppercase font-semibold text-sm text-gray-400 mb-2">{{ entry.section }}</h5>
|
||||
{% endif %}
|
||||
<ul class="mb-8 font-medium">
|
||||
{% for entry in entry.children %}
|
||||
{{ navItem(entry) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
@@ -14,7 +14,7 @@ layout: base.njk
|
||||
</aside>
|
||||
#}
|
||||
<div class="order-1 max-w-full flex-grow">
|
||||
<h1 class="text-2xl md:text-4xl font-bold mb-6 md:mb-8 text-brand-900 dark:text-brand-100">{{ title }}</h1>
|
||||
<h1 class="text-2xl md:text-4xl font-bold mb-6 md:mb-8 text-brand-900 dark:text-brand-100">{{ title }}</h1>
|
||||
<div class="prose dark:prose-dark">{{ layoutContent | safe }}</div>
|
||||
</div>
|
||||
<footer class="order-3 min-w-full flex mt-4 justify-end mr-1 text-sm text-gray-500 dark:text-gray-300 space-x-3 leading-5">
|
||||
@@ -24,7 +24,7 @@ layout: base.njk
|
||||
<a class="border-b border-transparent transition-colors hover:border-current" target="_blank" rel="noopener noreferrer" href="{{ site.githubUrl }}/edit/{{ site.githubBranch }}/site/{{ page.inputPath }}">Edit</a>
|
||||
</footer>
|
||||
</article>
|
||||
{# TODO: implement navigation to next page of the docs
|
||||
{# TODO: implement navigation to next page of the docs
|
||||
<nav class="flex justify-between mt-10 mb-8 p-2 border-t dark:border-gray-700 text-gray-800 dark:text-gray-200">
|
||||
<a>Prev page</a>
|
||||
<a>Next page</a>
|
||||
|
||||
@@ -7,13 +7,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@11ty/dependency-tree/-/dependency-tree-1.0.0.tgz#b1fa53da49aafe0ab3fe38bc6b6058b704aa59a1"
|
||||
integrity sha512-2FWYlkphQ/83MG7b9qqBJfJJ0K9zupNz/6n4EdDuNLw6hQHGp4Sp4UMDRyBvA/xCTYDBaPSuSjHuu45tSujegg==
|
||||
|
||||
"@11ty/eleventy-navigation@^0.2.0":
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@11ty/eleventy-navigation/-/eleventy-navigation-0.2.0.tgz#fd610a4a3d52934b54832be5268dddf4b2fd22f4"
|
||||
integrity sha512-mkFoNpL32FosMTuZwxcY3KXVVYLRt7zBqVWP9X+0GMufnRNGpLZd+BYwD0vmYHLAxz1ol/RLlL2Hmkgp/YJ4TQ==
|
||||
dependencies:
|
||||
dependency-graph "^0.11.0"
|
||||
|
||||
"@11ty/eleventy-plugin-syntaxhighlight@^3.1.1":
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@11ty/eleventy-plugin-syntaxhighlight/-/eleventy-plugin-syntaxhighlight-3.1.1.tgz#0abfd8f0b2902629bd90aea69e8c8a0236d03ca4"
|
||||
|
||||
Reference in New Issue
Block a user