doc
This commit is contained in:
176
docs/_site/assets/js/just-the-docs.js
Normal file
176
docs/_site/assets/js/just-the-docs.js
Normal file
@@ -0,0 +1,176 @@
|
||||
// Event handling
|
||||
|
||||
function addEvent(el, type, handler) {
|
||||
if (el.attachEvent) el.attachEvent('on'+type, handler); else el.addEventListener(type, handler);
|
||||
}
|
||||
function removeEvent(el, type, handler) {
|
||||
if (el.detachEvent) el.detachEvent('on'+type, handler); else el.removeEventListener(type, handler);
|
||||
}
|
||||
|
||||
// Show/hide mobile menu
|
||||
|
||||
function toggleNav(){
|
||||
const nav = document.querySelector('.js-main-nav');
|
||||
const auxNav = document.querySelector('.js-aux-nav');
|
||||
const navTrigger = document.querySelector('.js-main-nav-trigger');
|
||||
const search = document.querySelector('.js-search');
|
||||
|
||||
addEvent(navTrigger, 'click', function(){
|
||||
var text = navTrigger.innerText;
|
||||
var textToggle = navTrigger.getAttribute('data-text-toggle');
|
||||
|
||||
nav.classList.toggle('nav-open');
|
||||
auxNav.classList.toggle('nav-open');
|
||||
navTrigger.classList.toggle('nav-open');
|
||||
search.classList.toggle('nav-open');
|
||||
navTrigger.innerText = textToggle;
|
||||
navTrigger.setAttribute('data-text-toggle', text);
|
||||
textToggle = text;
|
||||
})
|
||||
}
|
||||
|
||||
// Site search
|
||||
|
||||
function initSearch() {
|
||||
var index = lunr(function () {
|
||||
this.ref('id');
|
||||
this.field('title', { boost: 20 });
|
||||
this.field('content', { boost: 10 });
|
||||
this.field('url');
|
||||
});
|
||||
|
||||
// Get the generated search_data.json file so lunr.js can search it locally.
|
||||
|
||||
sc = document.getElementsByTagName("script");
|
||||
source = '';
|
||||
|
||||
for(idx = 0; idx < sc.length; idx++)
|
||||
{
|
||||
s = sc.item(idx);
|
||||
|
||||
if(s.src && s.src.match(/just-the-docs\.js$/))
|
||||
{ source = s.src; }
|
||||
}
|
||||
|
||||
jsPath = source.replace('just-the-docs.js', '');
|
||||
|
||||
jsonPath = jsPath + 'search-data.json';
|
||||
|
||||
var request = new XMLHttpRequest();
|
||||
request.open('GET', jsonPath, true);
|
||||
|
||||
request.onload = function() {
|
||||
if (request.status >= 200 && request.status < 400) {
|
||||
// Success!
|
||||
var data = JSON.parse(request.responseText);
|
||||
var keys = Object.keys(data);
|
||||
|
||||
for(var i in data) {
|
||||
index.add({
|
||||
id: data[i].id,
|
||||
title: data[i].title,
|
||||
content: data[i].content,
|
||||
url: data[i].url
|
||||
});
|
||||
}
|
||||
searchResults(data);
|
||||
} else {
|
||||
// We reached our target server, but it returned an error
|
||||
console.log('Error loading ajax request. Request status:' + request.status);
|
||||
}
|
||||
};
|
||||
|
||||
request.onerror = function() {
|
||||
// There was a connection error of some sort
|
||||
console.log('There was a connection error');
|
||||
};
|
||||
|
||||
request.send();
|
||||
|
||||
function searchResults(dataStore) {
|
||||
var searchInput = document.querySelector('.js-search-input');
|
||||
var searchResults = document.querySelector('.js-search-results');
|
||||
var store = dataStore;
|
||||
|
||||
function hideResults() {
|
||||
searchResults.innerHTML = '';
|
||||
searchResults.classList.remove('active');
|
||||
}
|
||||
|
||||
addEvent(searchInput, 'keyup', function(e){
|
||||
var query = this.value;
|
||||
|
||||
searchResults.innerHTML = '';
|
||||
searchResults.classList.remove('active');
|
||||
|
||||
if (query === '') {
|
||||
hideResults();
|
||||
} else {
|
||||
var results = index.search(query);
|
||||
|
||||
if (results.length > 0) {
|
||||
searchResults.classList.add('active');
|
||||
var resultsList = document.createElement('ul');
|
||||
searchResults.appendChild(resultsList);
|
||||
|
||||
for (var i in results) {
|
||||
var resultsListItem = document.createElement('li');
|
||||
var resultsLink = document.createElement('a');
|
||||
var resultsUrlDesc = document.createElement('span');
|
||||
var resultsUrl = store[results[i].ref].url;
|
||||
var resultsRelUrl = store[results[i].ref].relUrl;
|
||||
var resultsTitle = store[results[i].ref].title;
|
||||
|
||||
resultsLink.setAttribute('href', resultsUrl);
|
||||
resultsLink.innerText = resultsTitle;
|
||||
resultsUrlDesc.innerText = resultsRelUrl;
|
||||
|
||||
resultsList.classList.add('search-results-list');
|
||||
resultsListItem.classList.add('search-results-list-item');
|
||||
resultsLink.classList.add('search-results-link');
|
||||
resultsUrlDesc.classList.add('fs-2','text-grey-dk-000','d-block');
|
||||
|
||||
resultsList.appendChild(resultsListItem);
|
||||
resultsListItem.appendChild(resultsLink);
|
||||
resultsLink.appendChild(resultsUrlDesc);
|
||||
}
|
||||
}
|
||||
|
||||
// When esc key is pressed, hide the results and clear the field
|
||||
if (e.keyCode == 27) {
|
||||
hideResults();
|
||||
searchInput.value = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
addEvent(searchInput, 'blur', function(){
|
||||
setTimeout(function(){ hideResults() }, 300);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function pageFocus() {
|
||||
var mainContent = document.querySelector('.js-main-content');
|
||||
mainContent.focus();
|
||||
}
|
||||
|
||||
|
||||
// Document ready
|
||||
|
||||
function ready(){
|
||||
toggleNav();
|
||||
pageFocus();
|
||||
if (typeof lunr !== 'undefined') {
|
||||
initSearch();
|
||||
}
|
||||
}
|
||||
|
||||
// in case the document is already rendered
|
||||
if (document.readyState!='loading') ready();
|
||||
// modern browsers
|
||||
else if (document.addEventListener) document.addEventListener('DOMContentLoaded', ready);
|
||||
// IE <= 8
|
||||
else document.attachEvent('onreadystatechange', function(){
|
||||
if (document.readyState=='complete') ready();
|
||||
});
|
||||
80
docs/_site/assets/js/search-data.json
Normal file
80
docs/_site/assets/js/search-data.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"0": {
|
||||
"id": "0",
|
||||
"title": "",
|
||||
"content": "404 Page not found :( The requested page could not be found.",
|
||||
"url": "https://gancio.org/404.html",
|
||||
"relUrl": "/404.html"
|
||||
},
|
||||
"1": {
|
||||
"id": "1",
|
||||
"title": "Admin",
|
||||
"content": "Admin Basics Add user Enable registration Confirm registration Confirm event Basics Add user Enable registration Confirm registration Confirm event",
|
||||
"url": "https://gancio.org/admin",
|
||||
"relUrl": "/admin"
|
||||
},
|
||||
"2": {
|
||||
"id": "2",
|
||||
"title": "Classic",
|
||||
"content": "Classic setup Install Node.js and postgreSQL curl -sL https://deb.nodesource.com/setup_12.x | bash - apt-get install -y nodejs postgresql source Install Gancio npm install --global gancio Create a database (optional as you can use sqlite, but recommended) sudo -u postgres psql postgres=# create database gancio; postgres=# create user gancio with encrypted password 'gancio'; postgres=# grant all privileges on database gancio to gancio; Create a user to run gancio from adduser gancio su gancio Test & launch interactive setup gancio --help gancio setup --config config.json Start gancio --help gancio start --config config.json Point your web browser to http://localhost:13120 or where you selected during setup. Setup nginx as a proxy Deploy in production If you don’t use the docker way, in production you should use something like pm2: sudo npm install --global pm2 pm2 gancio start --config config.json",
|
||||
"url": "https://gancio.org/setup/classic",
|
||||
"relUrl": "/setup/classic"
|
||||
},
|
||||
"3": {
|
||||
"id": "3",
|
||||
"title": "Configuration",
|
||||
"content": "Configuration Main gancio configuration is done with a configuration file. This shoud be a .json or a .js file and could be specified using the --config flag. eg. gancio start --config ./config.json eg. pm2 start gancio start -- --config ~/config.json Title Description BaseURL Server Database Upload path SMTP Admin Favicon Secret Default settings Title The title will be in rss feed, in html head and in emails: "title": "Gancio" Description "description": "a shared agenda for local communities" BaseURL URL where your site will be accessible (include http or https): "baseurl": "https://gancio.cisti.org" Server This probably support unix socket too :D "server": { "host": "localhost", "port": 13120 } Database "db": { "dialect": "sqlite", "storage": "/tmp/db.sqlite" } Upload path Where to save images "upload_path": "./uploads" SMTP Admin Favicon You could specify another favicon "favicon": "./favicon.ico" Secret Default settings { "title": "Gancio", "description": "A shared agenda for local communities", "baseurl": "http://localhost:13120", "server": { "host": "0.0.0.0", "port": 13120 }, "db": { "dialect": "sqlite", "storage": "/tmp/db.sqlite" }, "upload_path": "./", "favicon": "../dist/favicon.ico", "smtp": { "auth": { "user": "", "pass": "" }, "secure": true, "host": "" }, "admin": "", "secret": "notsosecret" }",
|
||||
"url": "https://gancio.org/config",
|
||||
"relUrl": "/config"
|
||||
},
|
||||
"4": {
|
||||
"id": "4",
|
||||
"title": "Contribute",
|
||||
"content": "Contribute If you want to contribute, take a look at the issues Code Translate Design Documentation Share Code Translate Design Documentation Share",
|
||||
"url": "https://gancio.org/contribute",
|
||||
"relUrl": "/contribute"
|
||||
},
|
||||
"5": {
|
||||
"id": "5",
|
||||
"title": "Develop",
|
||||
"content": "Development Stack Gancio is built with following technologies: Nuxt.js Vue.js Express Sequelize Element.ui Testing on your own machine Download source git clone https://git.lattuga.net/cisti/gancio Install dependencies yarn Hacking yarn dev",
|
||||
"url": "https://gancio.org/dev",
|
||||
"relUrl": "/dev"
|
||||
},
|
||||
"6": {
|
||||
"id": "6",
|
||||
"title": "Docker",
|
||||
"content": "Install with docker You do not need to clone the full repo as we distribute gancio via npm. Dockerfile and docker-compose.yml are the only needed files. Create a directory where everything related to gancio is stored (db, images, config) mkdir /opt/gancio cd /opt/gancio :information_source: you can choose a different directory of course Download docker-compose.yml and Dockerfile wget https://git.lattuga.net/cisti/gancio/raw/docker/docker/Dockerfile wget https://git.lattuga.net/cisti/gancio/raw/docker/docker/docker-compose.yml Create an empty configuration file touch config.json After first setup, you can modify this file and restart the container on your needs. Build docker image and launch interactive setup in one step docker-compose run --rm gancio gancio setup Run your container docker-compose up -d Setup nginx as a proxy Point your web browser to http://localhost:13120 or where you specified during setup and enjoy :tada:",
|
||||
"url": "https://gancio.org/setup/docker",
|
||||
"relUrl": "/setup/docker"
|
||||
},
|
||||
"7": {
|
||||
"id": "7",
|
||||
"title": "Home",
|
||||
"content": "Gancio A shared agenda for local communities. Get started now Demo Source About the project Gancio is made with :heart: by hacklab underscore License Gancio is distributed by an AGPL-3.0 Licence.",
|
||||
"url": "https://gancio.org/",
|
||||
"relUrl": "/"
|
||||
},
|
||||
"8": {
|
||||
"id": "8",
|
||||
"title": "Nginx",
|
||||
"content": "Nginx proxy configuration This is the default nginx configuration for gancio, please modify at least the server_name and ssl_certificate’s path server { listen 80; listen [::]:80; server_name gancio.cisti.org; root /var/www/letsencrypt; location /.well-known/acme-challenge/ { allow all; } location / { return 301 https://$host$request_uri; } } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name gancio.cisti.org; ssl_protocols TLSv1.2; ssl_ciphers HIGH:!MEDIUM:!LOW:!aNULL:!NULL:!SHA; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; # Uncomment these lines once you acquire a certificate: # ssl_certificate /etc/letsencrypt/live/gancio.cisti.org/fullchain.pem; # ssl_certificate_key /etc/letsencrypt/live/gancio.cisti.org/privkey.pem; keepalive_timeout 70; sendfile on; client_max_body_size 80m; gzip on; gzip_disable "msie6"; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; add_header Strict-Transport-Security "max-age=31536000"; location / { try_files $uri @proxy; } location @proxy { proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto https; proxy_set_header Proxy ""; proxy_pass_header Server; proxy_pass http://127.0.0.1:13120; proxy_buffering on; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; tcp_nodelay on; } }",
|
||||
"url": "https://gancio.org/setup/nginx",
|
||||
"relUrl": "/setup/nginx"
|
||||
},
|
||||
"9": {
|
||||
"id": "9",
|
||||
"title": "Setup",
|
||||
"content": "Setup Setup with docker Classic setup Nginx as a proxy Hacking & contribute",
|
||||
"url": "https://gancio.org/setup",
|
||||
"relUrl": "/setup"
|
||||
},
|
||||
"10": {
|
||||
"id": "10",
|
||||
"title": "Usage",
|
||||
"content": "Usage Add event Normal Multidate Recurrent",
|
||||
"url": "https://gancio.org/usage",
|
||||
"relUrl": "/usage"
|
||||
}
|
||||
|
||||
}
|
||||
6
docs/_site/assets/js/vendor/lunr.min.js
vendored
Normal file
6
docs/_site/assets/js/vendor/lunr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user