improve docs

This commit is contained in:
les 2021-06-04 15:52:35 +02:00
parent 3b041df157
commit 4907f53dc2
No known key found for this signature in database
GPG key ID: 352918250B012177
9 changed files with 88 additions and 63 deletions

View file

@ -106,7 +106,7 @@ DEPENDENCIES
jekyll-default-layout
jekyll-feed
jemoji
just-the-docs (~> 0.3.3)
just-the-docs
mini_magick
premonition
tzinfo (~> 1.2)

View file

@ -17,7 +17,7 @@ title: Gancio
email: lesion@autistici.org
description: >- # this means to ignore newlines until "baseurl:"
A shared agenda for local communities with AP support
baseurl: "/" # the subpath of your site, e.g. /blog
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://gancio.org" # the base hostname & protocol for your site, e.g. http://example.com
#twitter_username: jekyllrb
#github_username: jekyll

View file

@ -0,0 +1,72 @@
---
permalink: /assets/js/search-data.json
---
{
{%- assign i = 0 -%}
{%- assign pages_array = | split: -%}
{%- assign pages_array = pages_array | push: site.html_pages -%}
{%- if site.just_the_docs.collections -%}
{%- for collection_entry in site.just_the_docs.collections -%}
{%- assign collection_key = collection_entry[0] -%}
{%- assign collection_value = collection_entry[1] -%}
{%- assign collection = site[collection_key] -%}
{%- if collection_value.search_exclude != true -%}
{%- assign pages_array = pages_array | push: collection -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- for pages in pages_array -%}
{%- for page in pages -%}
{%- if page.title and page.search_exclude != true -%}
{%- assign page_content = page.content -%}
{%- assign heading_level = site.search.heading_level | default: 2 -%}
{%- for j in (2..heading_level) -%}
{%- assign tag = '<h' | append: j -%}
{%- assign closing_tag = '</h' | append: j -%}
{%- assign page_content = page_content | replace: tag, '<h1' | replace: closing_tag, '</h1' -%}
{%- endfor -%}
{%- assign parts = page_content | split: '<h1' -%}
{%- assign title_found = false -%}
{%- for part in parts offset: 1 -%}
{%- assign titleAndContent = part | split: '</h1>' -%}
{%- assign title = titleAndContent[0] | replace_first: '>', '<h1>' | split: '<h1>' -%}
{%- assign title = title[1] | strip_html -%}
{%- assign content = titleAndContent[1] -%}
{%- assign url = page.url -%}
{%- if title == page.title and parts[0] == '' -%}
{%- assign title_found = true -%}
{%- else -%}
{%- assign id = titleAndContent[0] -%}
{%- assign id = id | split: 'id="' -%}
{%- if id.size == 2 -%}
{%- assign id = id[1] -%}
{%- assign id = id | split: '"' -%}
{%- assign id = id[0] -%}
{%- capture url -%}{{ url | append: '#' | append: id }}{%- endcapture -%}
{%- endif -%}
{%- endif -%}
{%- unless i == 0 -%},{%- endunless -%}
"{{ i }}": {
"doc": {{ page.title | jsonify }},
"title": {{ title | jsonify }},
"content": {{ content | replace: '</h', ' . </h' | replace: '<hr', ' . <hr' | replace: '</p', ' . </p' | replace: '<ul', ' . <ul' | replace: '</ul', ' . </ul' | replace: '<ol', ' . <ol' | replace: '</ol', ' . </ol' | replace: '</tr', ' . </tr' | replace: '<li', ' | <li' | replace: '</li', ' | </li' | replace: '</td', ' | </td' | replace: '<td', ' | <td' | replace: '</th', ' | </th' | replace: '<th', ' | <th' | strip_html | remove: 'Table of contents' | normalize_whitespace | replace: '. . .', '.' | replace: '. .', '.' | replace: '| |', '|' | append: ' ' | jsonify }},
"url": "{{ url | relative_url }}",
"relUrl": "{{ url }}"
}
{%- assign i = i | plus: 1 -%}
{%- endfor -%}
{%- unless title_found -%}
{%- unless i == 0 -%},{%- endunless -%}
"{{ i }}": {
"doc": {{ page.title | jsonify }},
"title": {{ page.title | jsonify }},
"content": {{ parts[0] | replace: '</h', ' . </h' | replace: '<hr', ' . <hr' | replace: '</p', ' . </p' | replace: '<ul', ' . <ul' | replace: '</ul', ' . </ul' | replace: '<ol', ' . <ol' | replace: '</ol', ' . </ol' | replace: '</tr', ' . </tr' | replace: '<li', ' | <li' | replace: '</li', ' | </li' | replace: '</td', ' | </td' | replace: '<td', ' | <td' | replace: '</th', ' | </th' | replace: '<th', ' | <th' | strip_html | remove: 'Table of contents' | normalize_whitespace | replace: '. . .', '.' | replace: '. .', '.' | replace: '| |', '|' | append: ' ' | jsonify }},
"url": "{{ page.url | relative_url }}",
"relUrl": "{{ page.url }}"
}
{%- assign i = i | plus: 1 -%}
{%- endunless -%}
{%- endif -%}
{%- endfor -%}
{%- endfor %}
}

View file

@ -1,30 +0,0 @@
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>{{ page.title }} - {{ site.title }}</title>
{% if page.description %}
<meta name="Description" content="{{ page.description }}">
{% endif %}
<link rel="shortcut icon" href="{{ "favicon.ico" | absolute_url }}" type="image/x-icon">
<link rel="stylesheet" href="{{ "/assets/css/just-the-docs.css" | absolute_url }}">
<link rel="stylesheet" href="{{ "/assets/css/style.css" | absolute_url }}">
<link rel="stylesheet" href="{{ "/assets/css/premonition.css" | absolute_url }}">
<link rel="stylesheet" href="{{ "/assets/css/fa.min.css" | absolute_url }}">
{% if site.search_enabled != nil %}
<script type="text/javascript" src="{{ "/assets/js/vendor/lunr.min.js" | absolute_url }}"></script>
{% endif %}
<script type="text/javascript" src="{{ "/assets/js/just-the-docs.js" | absolute_url }}"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{{ "/assets/js/jquery-3.3.1.min.js" | absolute_url }}"></script>
<link rel="stylesheet" href="{{ "/assets/css/jquery.fancybox.min.css" | absolute_url }}"/>
<script src="{{ "/assets/js/jquery.fancybox.min.js" | absolute_url }}"></script>
{% seo %}
</head>

View file

@ -1,16 +0,0 @@
/* .navigation-list-item {
font-size: 18px !important;
padding: 4px;
}
html, body {
font-family: sans-serif;
}
.page-content h1:first-of-type {
font-weight: 500;
}
li {
margin-left: 10px;
} */

View file

@ -1,7 +1,7 @@
---
layout: default
title: Backup
permalink: /backup
permalink: /install/backup
nav_order: 5
parent: Install
---
@ -9,7 +9,7 @@ parent: Install
## Backup
The following commands should be valid for every setup (docker/debian/sqlite/postgres) but check your installation directory first.
This includes database, configuration, custom user locales, images and thumbnails for every release.
This includes database, configuration, custom user locales, logs, images and thumbnails.
```bash
cd /opt/gancio/ # or /home/gancio or where your installation is

View file

@ -1,7 +1,6 @@
---
layout: default
title: Configuration
permalink: /config
permalink: /install/config
nav_order: 6
parent: Install
---

View file

@ -5,8 +5,8 @@ permalink: /install/docker
parent: Install
nav_order: 2
---
## Table of contents
{: .no_toc .text-delta }
## Docker installation
{: .no_toc }
1. TOC
{:toc}
@ -83,14 +83,14 @@ tail -f data/logs/gancio.log
> error "Upgrade from a version < 1.0"
> Since v1.0 our docker setup is changed and a new container has to be built:
>
> - `cd /opt/gancio`
> - [Backup your data](/backup)
> - Download new `Dockerfile` => `wget https://gancio.org/docker/Dockerfile`
> - Download new `docker-compose.yml` (modify DB to sqlite or postgres)-> `wget https://gancio.org/docker/<DB>/docker-compose.yml`
> - Build the new container `docker-compose build`
> - Extract your backup into `./data` => `mkdir data; tar xvzf gancio-<yourLastBackup>-backup.tgz -C data`
> - Stop your old container `docker-compose stop`
> - Start your new container `docker-compose up`
> 1. `cd /opt/gancio`
> 1. [Backup your data](/backup)
> 1. Download new `Dockerfile` <br/> `wget https://gancio.org/docker/Dockerfile`
> 1. Download new `docker-compose.yml` (substitute \<DB\> to sqlite or postgres): <br/>`wget https://gancio.org/docker/<DB>/docker-compose.yml`
> 1. Build the new container `docker-compose build`
> 1. Extract your backup into `./data` <br/>`mkdir data; tar xvzf gancio-<yourLastBackup>-backup.tgz -C data`
> 1. Stop your old container `docker-compose stop`
> 1. Start your new container `docker-compose up`
```bash

View file

@ -1,6 +1,6 @@
---
layout: default
title: Nginx
title: Nginx setup
permalink: /install/nginx
parent: Install
---