aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2020-04-18 17:17:54 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2020-04-18 17:17:54 +0200
commit2ea473d3bd2d8bd8323c31f2355b5d427852e164 (patch)
tree648d9f212fe5badd061923524720f4c959578b11
parentef35a40059be533bfc66c39bfdfb6ba22c0a672f (diff)
downloadsite-2ea473d3bd2d8bd8323c31f2355b5d427852e164.tar.gz
site-2ea473d3bd2d8bd8323c31f2355b5d427852e164.zip
Rework website structure
-rw-r--r--.gitignore1
-rwxr-xr-x.webpull1
-rw-r--r--render.js62
-rw-r--r--src/Association/AG1.md (renamed from src/Documentation/Association/AG1/index.md)0
-rw-r--r--src/Association/AG2.md (renamed from src/Documentation/Association/AG2/index.md)0
-rw-r--r--src/Association/Statuts.md (renamed from src/Documentation/Association/Statuts/index.md)0
-rw-r--r--src/Association/index.md (renamed from src/Documentation/index.md)0
-rw-r--r--src/Documentation/Association/index.md11
-rw-r--r--src/Documentation/_markdown.pug14
-rw-r--r--src/Technique/Développement/Bottin.md (renamed from src/Documentation/Technique/Logiciels/Bottin/index.md)0
-rw-r--r--src/Technique/Développement/Diplonat.md (renamed from src/Documentation/Technique/Logiciels/Diplonat/index.md)0
-rw-r--r--src/Technique/Développement/Garage.md (renamed from src/Documentation/Technique/Logiciels/Garage/index.md)0
-rw-r--r--src/Technique/Développement/Guichet.md (renamed from src/Documentation/Technique/Logiciels/Guichet/index.md)0
-rw-r--r--src/Technique/Infra/Internet.md (renamed from src/Documentation/Technique/Infra/Internet/index.md)0
-rw-r--r--src/Technique/Operations/Assets/exemple_offre.txt (renamed from src/Documentation/Technique/Services/Jitsi/exemple_offre.txt)0
-rw-r--r--src/Technique/Operations/Assets/livebox_parefeu_personnalise.png (renamed from src/Documentation/Technique/Services/Jitsi/livebox_parefeu_personnalise.png)bin84154 -> 84154 bytes
-rw-r--r--src/Technique/Operations/Jitsi.md (renamed from src/Documentation/Technique/Services/Jitsi/index.md)4
-rw-r--r--src/Technique/index.md (renamed from src/Documentation/Technique/index.md)0
-rw-r--r--src/_layout.pug13
-rw-r--r--src/_markdown.pug7
-rw-r--r--src/_mixin/menu.pug10
-rw-r--r--src/css/main.css2
-rw-r--r--src/index.pug102
23 files changed, 136 insertions, 91 deletions
diff --git a/.gitignore b/.gitignore
index e5322a6..09c4aa8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
static/
node_modules/
+*.swp
diff --git a/.webpull b/.webpull
index 2d25330..4df1cf1 100755
--- a/.webpull
+++ b/.webpull
@@ -1,4 +1,3 @@
#!/bin/bash
-rm -rf static/
npm install
node render.js
diff --git a/render.js b/render.js
index 8fb7545..352fe7f 100644
--- a/render.js
+++ b/render.js
@@ -10,7 +10,7 @@ const log = process.env.VERBOSE ? console.log : unit
const walk = async (path, filename) => {
log('[walk]', path)
const type = await fs.lstat(path)
- if (type.isFile()) return {type: 'file', path: path, name: filename || path}
+ if (type.isFile()) return {type: 'file', path: path, name: filename || path, tags:[]}
if (!type.isDirectory()) return null
const files = await fs.readdir(path)
@@ -18,6 +18,7 @@ const walk = async (path, filename) => {
type: 'folder',
path: path,
name: filename || path,
+ tags: [],
children: await Promise.all(files.map(file => walk(`${path}/${file}`, file)))
}
}
@@ -32,6 +33,7 @@ const is_static = suffixl(...ext_static)
const is_md = suffixl(...ext_md)
const is_pug = suffixl(...ext_pug)
const is_templated = f => is_md(f) /* || is_rst(f) */
+const is_document = f => is_templated(f) || is_pug(f)
const prefix = file => ext => file.substring(0, ext.length) == ext ? ext : null
const prefixl = (...l) => file => l.find(prefix(file))
@@ -54,12 +56,41 @@ const propagate_md_layout = (tree, markdown_template) => {
const elagate = tree => {
if (tree.type != 'folder') return tree
- const lh = e => log('[elegate]', e.path) && false
+ const lh = e => log('[elagate]', e.path) && false
tree.children = tree.children.filter(e => !(e.name[0] == '_') || lh(e))
tree.children.forEach(elagate)
return tree
}
+const tag_document = tree => {
+ if (tree.type == 'file' && is_document(tree.name)) {
+ tree.tags.push('document_leaf', 'document')
+ log('[tag_document]', tree.path, 'document_leaf')
+ } else if (tree.type == 'folder') {
+ tree.children.forEach(tag_document)
+ if(tree.children.some(c => c.tags.includes('document'))) {
+ tree.tags.push('document_branch', 'document')
+ log('[tag_document]', tree.path, 'document_branch')
+ }
+ }
+ return tree
+}
+
+const reference_index = indexes => tree => {
+ if (tree.type != 'folder') return tree;
+
+ const index = tree.children.find(e => indexes.includes(e.name))
+ if (index) {
+ tree.index = index
+ tree.tags.push('has_index')
+ log('[reference_index]', tree.path, index.name)
+ index.tags.push('is_index')
+ }
+ tree.children.forEach(reference_index(indexes))
+
+ return tree;
+}
+
const propagate_nice_name = prefix => tree => {
const without_prefix = tree.path.substring(prefix.length)
const splitted = without_prefix.split('/').filter(v => v.length > 0)
@@ -90,10 +121,12 @@ const prepare_copy = (old_prefix, new_prefix, exts) => tree => {
const prepare_pug = (old_prefix, new_prefix) => tree => {
if (tree.type == 'file' && is_pug(tree.name)) {
+ tree.old_url = tree.url
+ tree.url = rm_prefix(old_prefix)(rm_suffix(...ext_pug)(tree.path)) + '.html'
tree.generate = {
cmd: 'pug',
src: tree.path,
- out: new_prefix + rm_prefix(old_prefix)(rm_suffix(...ext_pug)(tree.path)) + '.html'
+ out: new_prefix + tree.url
}
log('[prepare_pug]',tree.generate.src,'->',tree.generate.out)
}
@@ -106,11 +139,13 @@ const prepare_pug = (old_prefix, new_prefix) => tree => {
const prepare_md = (old_prefix, new_prefix) => tree => {
if (tree.type == 'file' && is_md(tree.name)) {
+ tree.old_url = tree.url
+ tree.url = rm_prefix(old_prefix)(rm_suffix(...ext_md)(tree.path)) + '.html'
tree.generate = {
cmd: 'pug',
src: tree.template.path,
markdown: tree.path,
- out: new_prefix + rm_prefix(old_prefix)(rm_suffix(...ext_md)(tree.path)) + '.html'
+ out: new_prefix + tree.url
}
log('[prepare_md]',tree.generate.markdown,'+',tree.generate.src,'->',tree.generate.out)
}
@@ -170,16 +205,35 @@ const do_pug = (prt, root) => async tree => {
return tree
}
+const rm_tree = t => {
+ if (t.type == 'file') {
+ log('[do_clean] file', t.path)
+ return fs.unlink(t.path)
+ }
+
+ return Promise
+ .all(t.children.map(rm_tree))
+ .then(_ => {
+ log('[do_clean] path', t.path)
+ return fs.rmdir(t.path)
+ })
+}
+
+const do_clean = path => tree => walk(path).then(rm_tree).then(_ => tree)
const conf = { src: './src', dest: './static'}
walk(conf.src)
.then(propagate_md_layout)
.then(elagate)
+ .then(tag_document)
+ .then(reference_index(['index.md', 'index.pug']))
.then(propagate_nice_name(conf.src))
.then(prepare_copy(conf.src, conf.dest))
.then(prepare_pug(conf.src, conf.dest))
.then(prepare_md(conf.src, conf.dest))
.then(prepare_folder(conf.src, conf.dest))
+ //.then(v => {log(v) ; return v})
+ .then(do_clean(conf.dest))
.then(do_folder)
.then(do_copy)
.then(do_pug())
diff --git a/src/Documentation/Association/AG1/index.md b/src/Association/AG1.md
index 9d89540..9d89540 100644
--- a/src/Documentation/Association/AG1/index.md
+++ b/src/Association/AG1.md
diff --git a/src/Documentation/Association/AG2/index.md b/src/Association/AG2.md
index 4a27429..4a27429 100644
--- a/src/Documentation/Association/AG2/index.md
+++ b/src/Association/AG2.md
diff --git a/src/Documentation/Association/Statuts/index.md b/src/Association/Statuts.md
index caa3978..caa3978 100644
--- a/src/Documentation/Association/Statuts/index.md
+++ b/src/Association/Statuts.md
diff --git a/src/Documentation/index.md b/src/Association/index.md
index 57ee2cc..57ee2cc 100644
--- a/src/Documentation/index.md
+++ b/src/Association/index.md
diff --git a/src/Documentation/Association/index.md b/src/Documentation/Association/index.md
deleted file mode 100644
index 3821b1d..0000000
--- a/src/Documentation/Association/index.md
+++ /dev/null
@@ -1,11 +0,0 @@
-### Statuts de l'association
-
-Depuis janvier 2020, Deuxfleurs est constitué en association loi 1901.
-Vous trouverez [ici](/Documentation/Association/Statuts/) les statuts de l'association.
-
-### Comptes rendus d'AG
-
-Les comptes-rendus d'AG sont disponibles aux liens suivants:
-
- - [13 janvier 2020 (AG constitutive)](/Documentation/Association/AG1/)
-
diff --git a/src/Documentation/_markdown.pug b/src/Documentation/_markdown.pug
deleted file mode 100644
index b5dcdf4..0000000
--- a/src/Documentation/_markdown.pug
+++ /dev/null
@@ -1,14 +0,0 @@
-extends ../_layout.pug
-
-prepend root
- - title = element.nice_path[element.nice_path.length - 1]
-
-block content
- .container.spacing
- nav
- strong
- a(href="/Documentation") Documentation
- +menu(root.children.find(e => e.nice_name == "Documentation"))
-
- main.spacing
- != markdown
diff --git a/src/Documentation/Technique/Logiciels/Bottin/index.md b/src/Technique/Développement/Bottin.md
index 0cf67ed..0cf67ed 100644
--- a/src/Documentation/Technique/Logiciels/Bottin/index.md
+++ b/src/Technique/Développement/Bottin.md
diff --git a/src/Documentation/Technique/Logiciels/Diplonat/index.md b/src/Technique/Développement/Diplonat.md
index 47bb620..47bb620 100644
--- a/src/Documentation/Technique/Logiciels/Diplonat/index.md
+++ b/src/Technique/Développement/Diplonat.md
diff --git a/src/Documentation/Technique/Logiciels/Garage/index.md b/src/Technique/Développement/Garage.md
index 16fa635..16fa635 100644
--- a/src/Documentation/Technique/Logiciels/Garage/index.md
+++ b/src/Technique/Développement/Garage.md
diff --git a/src/Documentation/Technique/Logiciels/Guichet/index.md b/src/Technique/Développement/Guichet.md
index 3e67c44..3e67c44 100644
--- a/src/Documentation/Technique/Logiciels/Guichet/index.md
+++ b/src/Technique/Développement/Guichet.md
diff --git a/src/Documentation/Technique/Infra/Internet/index.md b/src/Technique/Infra/Internet.md
index b7ba6b4..b7ba6b4 100644
--- a/src/Documentation/Technique/Infra/Internet/index.md
+++ b/src/Technique/Infra/Internet.md
diff --git a/src/Documentation/Technique/Services/Jitsi/exemple_offre.txt b/src/Technique/Operations/Assets/exemple_offre.txt
index 3af76ec..3af76ec 100644
--- a/src/Documentation/Technique/Services/Jitsi/exemple_offre.txt
+++ b/src/Technique/Operations/Assets/exemple_offre.txt
diff --git a/src/Documentation/Technique/Services/Jitsi/livebox_parefeu_personnalise.png b/src/Technique/Operations/Assets/livebox_parefeu_personnalise.png
index 16c922a..16c922a 100644
--- a/src/Documentation/Technique/Services/Jitsi/livebox_parefeu_personnalise.png
+++ b/src/Technique/Operations/Assets/livebox_parefeu_personnalise.png
Binary files differ
diff --git a/src/Documentation/Technique/Services/Jitsi/index.md b/src/Technique/Operations/Jitsi.md
index dee7b53..8e87d8f 100644
--- a/src/Documentation/Technique/Services/Jitsi/index.md
+++ b/src/Technique/Operations/Jitsi.md
@@ -37,7 +37,7 @@ Voilà les conclusions que nous avons tirées de nos tests :
Nous avons donc demandé à Adrien quels étaient les ports ouverts par défaut dans le mode élevé de sa box :
-![Livebox Parefeu Personnalisé](livebox_parefeu_personnalise.png)
+![Livebox Parefeu Personnalisé](Assets/livebox_parefeu_personnalise.png)
Nous avons dans un premier temps retenu le port `995/tcp` pour Jitsi, le port UDP ne pouvant être changé (limitation de Jitsi).
Cependant, pour des raisons de sécurité, les navigateurs ne peuvent pas utiliser les ports en dessous de `1024/*`, à l'exception des ports `80/tcp` et `443/tcp` comme l'indique ;'issue [#3583](https://bugs.chromium.org/p/webrtc/issues/detail?id=3583) de Chromium.
@@ -76,7 +76,7 @@ WebRTC fonctionne en deux étapes :
Le serveur de signaling Jitsi n'est autre que le serveur de chat prosody.
Pour ça, prosody est exposé à travers HTTP grâce au protocole BOSH (XMPP overs HTTPS).
-Une fois l'offre reçue ([exemple](exemple_offre.txt)), elle est enregistrée dans le navigateur à l'aide de `setRemoteDescription` pour initialiser le data plane.
+Une fois l'offre reçue ([exemple](Assets/exemple_offre.txt)), elle est enregistrée dans le navigateur à l'aide de `setRemoteDescription` pour initialiser le data plane.
On peut débugger le signaling WebRTC sous Chromium avec [chrome://webrtc-internarls](chrome://webrtc-internals/).
Quand plus de deux participants sont connectés dans la conversation, Jitsi n'envoie pas les offres de chaque participant aux autres participants. À la place, elle envoie qu'une seule offre, celle de son VideoBridge.
diff --git a/src/Documentation/Technique/index.md b/src/Technique/index.md
index 8aea90f..8aea90f 100644
--- a/src/Documentation/Technique/index.md
+++ b/src/Technique/index.md
diff --git a/src/_layout.pug b/src/_layout.pug
index 0a7f697..9bd186b 100644
--- a/src/_layout.pug
+++ b/src/_layout.pug
@@ -16,9 +16,12 @@ block root
.menu-item
a(href='https://guichet.deuxfleurs.fr') compte
span &nbsp;|&nbsp;
- .menu-item
- a(href='/Documentation') doc
- span &nbsp;|&nbsp;
h1 #{title}
- main
- block content
+ block main
+ main
+ .container.spacing
+ nav
+ strong
+ a(href="/") Accueil
+ +menu(root)
+ block content
diff --git a/src/_markdown.pug b/src/_markdown.pug
new file mode 100644
index 0000000..b92c4e9
--- /dev/null
+++ b/src/_markdown.pug
@@ -0,0 +1,7 @@
+extends ./_layout.pug
+
+prepend root
+ - title = element.nice_path[element.nice_path.length - 1]
+
+block content
+ != markdown
diff --git a/src/_mixin/menu.pug b/src/_mixin/menu.pug
index 09794c6..462d06f 100644
--- a/src/_mixin/menu.pug
+++ b/src/_mixin/menu.pug
@@ -1,7 +1,13 @@
mixin menu(o)
ul
each val in o.children
- - if (val.type == 'folder')
+ - if (val.type == 'folder' && val.tags.includes('document'))
li
- a(href=val.url)= val.nice_name
+ - if (val.tags.includes('has_index'))
+ a(href=val.url)= val.nice_name
+ - else
+ span= val.nice_name
+menu(val)
+ - else if (val.type == 'file' && val.tags.includes('document') && !val.tags.includes('is_index'))
+ li
+ a(href=val.url)= val.nice_name
diff --git a/src/css/main.css b/src/css/main.css
index 37e3b4d..3cee741 100644
--- a/src/css/main.css
+++ b/src/css/main.css
@@ -67,7 +67,7 @@ header > .container > .menu-item > img {
vertical-align: -9px;
}
-header > .container > .menu-item > a,span {
+header > .container > .menu-item > a, header > .container > .menu-item > span {
font-size: 30px;
color: white;
text-decoration: none;
diff --git a/src/index.pug b/src/index.pug
index 00a8afc..a02ebb9 100644
--- a/src/index.pug
+++ b/src/index.pug
@@ -4,55 +4,55 @@ prepend root
- title = "deuxfleurs"
block content
- .container.spacing
- .chapeau ⇨ protège votre vie privée
- .chapeau ⇨ défend vos libertés et vos droits
- .chapeau ⇨ ne vous manipule pas
- .chapeau ⇨ promeut la sobriété numérique
-
- section.spacing
- h2 nos services permettent de
- .list
- a.service-box.spacing(href='https://riot.deuxfleurs.fr')
- div(style='font-size: 80px; height: 120px') 💬
- h3 discuter
- a.service-box.spacing(href='https://jitsi.deuxfleurs.fr')
- div(style='font-size: 80px; height: 120px') 📞
- h3 s'appeler
- a.service-box.spacing(href='https://cloud.deuxfleurs.fr')
- div(style='font-size: 80px; height: 120px') 🔒
- h3 sauvegarder vos documents
- a.service-box.spacing(href='https://sogo.deuxfleurs.fr')
- div(style='font-size: 80px; height: 120px') 📨
- h3 envoyer des emails
- a.service-box.spacing(href='https://p.adnab.me')
- div(style='font-size: 80px; height: 120px') 📄
- h3 collaborer
- a.service-box.spacing(href='documentation.html#site')
- div(style='font-size: 80px; height: 120px') 🌐
- h3 créer votre site
- a.service-box.spacing(href='https://git.deuxfleurs.fr')
- div(style='font-size: 80px; height: 120px') 💻
- h3 coder
- br
-
- p.spacing ⚠️ Vous devez être membre pour utiliser ces services.&nbsp;
- a(href="#nous-rejoindre") Nous rejoindre.
-
- section.spacing
- h2 internet est politique
- :markdown-it(linkify)
- L'IETF, l'organisme en charge de la standardisation d'internet, reconnait que les choix technologiques ont un impact sur les droits de l'homme [[RFC8280]](https://trac.tools.ietf.org/html/rfc8280).
-
- section.spacing
- h2 notre réponse
- em à venir
-
- section.spacing
- h2(id="nous-rejoindre") nous rejoindre
- p.spacing Nous fonctionnons actuellement selon un mode de cooptation qui nous permet d'une part de mieux contrôler l'utilisation des ressources et éviter les abus, et d'autre part de créer et garder un contact humain avec nos utilisateurs.
- p.spacing
- | Si vous connaissez un membre de l'association, contactez le directement pour qu'il vous créer un compte.
- br
- | Sinon, vous pouvez nous écrire à coucou<img src="img/arobase.png" height="15"/>deuxfleurs.fr.
+ .chapeau ⇨ protège votre vie privée
+ .chapeau ⇨ défend vos libertés et vos droits
+ .chapeau ⇨ ne vous manipule pas
+ .chapeau ⇨ promeut la sobriété numérique
+
+
+ section.spacing
+ h2 nos services permettent de
+ .list
+ a.service-box.spacing(href='https://riot.deuxfleurs.fr')
+ div(style='font-size: 80px; height: 120px') 💬
+ h3 discuter
+ a.service-box.spacing(href='https://jitsi.deuxfleurs.fr')
+ div(style='font-size: 80px; height: 120px') 📞
+ h3 s'appeler
+ a.service-box.spacing(href='https://cloud.deuxfleurs.fr')
+ div(style='font-size: 80px; height: 120px') 🔒
+ h3 sauvegarder vos documents
+ a.service-box.spacing(href='https://sogo.deuxfleurs.fr')
+ div(style='font-size: 80px; height: 120px') 📨
+ h3 envoyer des emails
+ a.service-box.spacing(href='https://p.adnab.me')
+ div(style='font-size: 80px; height: 120px') 📄
+ h3 collaborer
+ a.service-box.spacing(href='documentation.html#site')
+ div(style='font-size: 80px; height: 120px') 🌐
+ h3 créer votre site
+ a.service-box.spacing(href='https://git.deuxfleurs.fr')
+ div(style='font-size: 80px; height: 120px') 💻
+ h3 coder
+ br
+
+ p.spacing ⚠️ Vous devez être membre pour utiliser ces services.&nbsp;
+ a(href="#nous-rejoindre") Nous rejoindre.
+
+ section.spacing
+ h2 internet est politique
+ :markdown-it(linkify)
+ L'IETF, l'organisme en charge de la standardisation d'internet, reconnait que les choix technologiques ont un impact sur les droits de l'homme [[RFC8280]](https://trac.tools.ietf.org/html/rfc8280).
+
+ section.spacing
+ h2 notre réponse
+ em à venir
+
+ section.spacing
+ h2(id="nous-rejoindre") nous rejoindre
+ p.spacing Nous fonctionnons actuellement selon un mode de cooptation qui nous permet d'une part de mieux contrôler l'utilisation des ressources et éviter les abus, et d'autre part de créer et garder un contact humain avec nos utilisateurs.
+ p.spacing
+ | Si vous connaissez un membre de l'association, contactez le directement pour qu'il vous créer un compte.
+ br
+ | Sinon, vous pouvez nous écrire à coucou<img src="img/arobase.png" height="15"/>deuxfleurs.fr.