From ac3e7e494669f6f923cb240f03d974efc6c84899 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 2 Mar 2020 23:54:46 +0100 Subject: Migrate website to my own static site generator --- .gitignore | 3 +- .webpull | 3 +- README.md | 2 - package-lock.json | 528 ++++++++++++++++++++++++++++++++ package.json | 21 ++ render.js | 172 +++++++++++ src/.well-known/matrix/client | 9 + src/.well-known/matrix/server | 0 src/Documentation/Association/index.md | 0 src/Documentation/Technique/index.md | 0 src/Documentation/_markdown.pug | 22 ++ src/Documentation/index.md | 1 + src/_layout.pug | 10 +- src/css/main.css | 78 +++++ src/documentation.pug | 9 - src/fonts/texgyreheros-bold.otf | Bin 0 -> 144464 bytes src/fonts/texgyreheros-bolditalic.otf | Bin 0 -> 146012 bytes src/fonts/texgyreheros-italic.otf | Bin 0 -> 150164 bytes src/fonts/texgyreheros-regular.otf | Bin 0 -> 143912 bytes src/fonts/texgyreheroscn-bold.otf | Bin 0 -> 140124 bytes src/fonts/texgyreheroscn-bolditalic.otf | Bin 0 -> 147024 bytes src/fonts/texgyreheroscn-italic.otf | Bin 0 -> 146948 bytes src/fonts/texgyreheroscn-regular.otf | Bin 0 -> 139992 bytes src/img/arobase.png | Bin 0 -> 1326 bytes src/img/flower.svg | 1 + src/robots.txt | 2 + 26 files changed, 843 insertions(+), 18 deletions(-) create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 render.js create mode 100644 src/.well-known/matrix/client create mode 100644 src/.well-known/matrix/server create mode 100644 src/Documentation/Association/index.md create mode 100644 src/Documentation/Technique/index.md create mode 100644 src/Documentation/_markdown.pug create mode 100644 src/Documentation/index.md create mode 100644 src/css/main.css delete mode 100644 src/documentation.pug create mode 100644 src/fonts/texgyreheros-bold.otf create mode 100644 src/fonts/texgyreheros-bolditalic.otf create mode 100644 src/fonts/texgyreheros-italic.otf create mode 100644 src/fonts/texgyreheros-regular.otf create mode 100644 src/fonts/texgyreheroscn-bold.otf create mode 100644 src/fonts/texgyreheroscn-bolditalic.otf create mode 100644 src/fonts/texgyreheroscn-italic.otf create mode 100644 src/fonts/texgyreheroscn-regular.otf create mode 100644 src/img/arobase.png create mode 100644 src/img/flower.svg create mode 100644 src/robots.txt diff --git a/.gitignore b/.gitignore index 2d19fc7..e5322a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*.html +static/ +node_modules/ diff --git a/.webpull b/.webpull index f381d82..4df1cf1 100755 --- a/.webpull +++ b/.webpull @@ -1,2 +1,3 @@ #!/bin/bash -pug ./src --out ./static +npm install +node render.js diff --git a/README.md b/README.md index ce4de99..ddf68ab 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,5 @@ deuxfleurs.fr ## Building ``` -sudo npm install -g pug-cli -sudo npm install -g jstransformer-markdown-it ./.webpull ``` diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6ab16d6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,528 @@ +{ + "name": "site", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/babel-types": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.7.tgz", + "integrity": "sha512-dBtBbrc+qTHy1WdfHYjBwRln4+LWqASWakLHsWHR2NWHIFkv4W3O070IGoGLEBrJBvct3r0L1BUPuvURi7kYUQ==" + }, + "@types/babylon": { + "version": "6.16.5", + "resolved": "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.5.tgz", + "integrity": "sha512-xH2e58elpj1X4ynnKp9qSnWlsRTIs6n3tgLGNfwAGHwePw0mulHQllV34n0T25uYSu1k0hRKkWXF890B1yS47w==", + "requires": { + "@types/babel-types": "*" + } + }, + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=" + }, + "acorn-globals": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-3.1.0.tgz", + "integrity": "sha1-/YJw9x+7SZawBPqIDuXUZXOnMb8=", + "requires": { + "acorn": "^4.0.4" + }, + "dependencies": { + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" + } + } + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "character-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", + "integrity": "sha1-x84o821LzZdE5f/CxfzeHHMmH8A=", + "requires": { + "is-regex": "^1.0.3" + } + }, + "clean-css": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", + "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", + "requires": { + "source-map": "~0.6.0" + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, + "constantinople": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/constantinople/-/constantinople-3.1.2.tgz", + "integrity": "sha512-yePcBqEFhLOqSBtwYOGGS1exHo/s1xjekXiinh4itpNQGCu4KA1euPh1fg07N2wMITZXQkBz75Ntdt1ctGZouw==", + "requires": { + "@types/babel-types": "^7.0.0", + "@types/babylon": "^6.16.2", + "babel-types": "^6.26.0", + "babylon": "^6.18.0" + } + }, + "core-js": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "doctypes": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz", + "integrity": "sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=" + }, + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-expression": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz", + "integrity": "sha1-Oayqa+f9HzRx3ELHQW5hwkMXrJ8=", + "requires": { + "acorn": "~4.0.2", + "object-assign": "^4.0.1" + }, + "dependencies": { + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" + } + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "requires": { + "has": "^1.0.3" + } + }, + "js-stringify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz", + "integrity": "sha1-Fzb939lyTyijaCrcYjCufk6Weds=" + }, + "jstransformer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz", + "integrity": "sha1-7Yvwkh4vPx7U1cGkT2hwntJHIsM=", + "requires": { + "is-promise": "^2.0.0", + "promise": "^7.0.1" + } + }, + "jstransformer-markdown-it": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/jstransformer-markdown-it/-/jstransformer-markdown-it-2.1.0.tgz", + "integrity": "sha1-aewwzkUYvtWZezjwJ2SOjChekvc=", + "requires": { + "markdown-it": "^8.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" + }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "requires": { + "uc.micro": "^1.0.1" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + }, + "markdown-it": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", + "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "requires": { + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "marked": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.0.tgz", + "integrity": "sha512-MyUe+T/Pw4TZufHkzAfDj6HarCBWia2y27/bhuYkTaiUnfDYFnCP3KUN+9oM7Wi6JA2rymtVYbQu3spE0GCmxQ==" + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "requires": { + "asap": "~2.0.3" + } + }, + "pug": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pug/-/pug-2.0.4.tgz", + "integrity": "sha512-XhoaDlvi6NIzL49nu094R2NA6P37ijtgMDuWE+ofekDChvfKnzFal60bhSdiy8y2PBO6fmz3oMEIcfpBVRUdvw==", + "requires": { + "pug-code-gen": "^2.0.2", + "pug-filters": "^3.1.1", + "pug-lexer": "^4.1.0", + "pug-linker": "^3.0.6", + "pug-load": "^2.0.12", + "pug-parser": "^5.0.1", + "pug-runtime": "^2.0.5", + "pug-strip-comments": "^1.0.4" + } + }, + "pug-attrs": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pug-attrs/-/pug-attrs-2.0.4.tgz", + "integrity": "sha512-TaZ4Z2TWUPDJcV3wjU3RtUXMrd3kM4Wzjbe3EWnSsZPsJ3LDI0F3yCnf2/W7PPFF+edUFQ0HgDL1IoxSz5K8EQ==", + "requires": { + "constantinople": "^3.0.1", + "js-stringify": "^1.0.1", + "pug-runtime": "^2.0.5" + } + }, + "pug-code-gen": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-2.0.2.tgz", + "integrity": "sha512-kROFWv/AHx/9CRgoGJeRSm+4mLWchbgpRzTEn8XCiwwOy6Vh0gAClS8Vh5TEJ9DBjaP8wCjS3J6HKsEsYdvaCw==", + "requires": { + "constantinople": "^3.1.2", + "doctypes": "^1.1.0", + "js-stringify": "^1.0.1", + "pug-attrs": "^2.0.4", + "pug-error": "^1.3.3", + "pug-runtime": "^2.0.5", + "void-elements": "^2.0.1", + "with": "^5.0.0" + } + }, + "pug-error": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-1.3.3.tgz", + "integrity": "sha512-qE3YhESP2mRAWMFJgKdtT5D7ckThRScXRwkfo+Erqga7dyJdY3ZquspprMCj/9sJ2ijm5hXFWQE/A3l4poMWiQ==" + }, + "pug-filters": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pug-filters/-/pug-filters-3.1.1.tgz", + "integrity": "sha512-lFfjNyGEyVWC4BwX0WyvkoWLapI5xHSM3xZJFUhx4JM4XyyRdO8Aucc6pCygnqV2uSgJFaJWW3Ft1wCWSoQkQg==", + "requires": { + "clean-css": "^4.1.11", + "constantinople": "^3.0.1", + "jstransformer": "1.0.0", + "pug-error": "^1.3.3", + "pug-walk": "^1.1.8", + "resolve": "^1.1.6", + "uglify-js": "^2.6.1" + } + }, + "pug-lexer": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/pug-lexer/-/pug-lexer-4.1.0.tgz", + "integrity": "sha512-i55yzEBtjm0mlplW4LoANq7k3S8gDdfC6+LThGEvsK4FuobcKfDAwt6V4jKPH9RtiE3a2Akfg5UpafZ1OksaPA==", + "requires": { + "character-parser": "^2.1.1", + "is-expression": "^3.0.0", + "pug-error": "^1.3.3" + } + }, + "pug-linker": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/pug-linker/-/pug-linker-3.0.6.tgz", + "integrity": "sha512-bagfuHttfQOpANGy1Y6NJ+0mNb7dD2MswFG2ZKj22s8g0wVsojpRlqveEQHmgXXcfROB2RT6oqbPYr9EN2ZWzg==", + "requires": { + "pug-error": "^1.3.3", + "pug-walk": "^1.1.8" + } + }, + "pug-load": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/pug-load/-/pug-load-2.0.12.tgz", + "integrity": "sha512-UqpgGpyyXRYgJs/X60sE6SIf8UBsmcHYKNaOccyVLEuT6OPBIMo6xMPhoJnqtB3Q3BbO4Z3Bjz5qDsUWh4rXsg==", + "requires": { + "object-assign": "^4.1.0", + "pug-walk": "^1.1.8" + } + }, + "pug-parser": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pug-parser/-/pug-parser-5.0.1.tgz", + "integrity": "sha512-nGHqK+w07p5/PsPIyzkTQfzlYfuqoiGjaoqHv1LjOv2ZLXmGX1O+4Vcvps+P4LhxZ3drYSljjq4b+Naid126wA==", + "requires": { + "pug-error": "^1.3.3", + "token-stream": "0.0.1" + } + }, + "pug-runtime": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/pug-runtime/-/pug-runtime-2.0.5.tgz", + "integrity": "sha512-P+rXKn9un4fQY77wtpcuFyvFaBww7/91f3jHa154qU26qFAnOe6SW1CbIDcxiG5lLK9HazYrMCCuDvNgDQNptw==" + }, + "pug-strip-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pug-strip-comments/-/pug-strip-comments-1.0.4.tgz", + "integrity": "sha512-i5j/9CS4yFhSxHp5iKPHwigaig/VV9g+FgReLJWWHEHbvKsbqL0oP/K5ubuLco6Wu3Kan5p7u7qk8A4oLLh6vw==", + "requires": { + "pug-error": "^1.3.3" + } + }, + "pug-walk": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pug-walk/-/pug-walk-1.1.8.tgz", + "integrity": "sha512-GMu3M5nUL3fju4/egXwZO0XLi6fW/K3T3VTgFQ14GxNi8btlxgT5qZL//JwZFm/2Fa64J/PNS8AZeys3wiMkVA==" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "resolve": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", + "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "requires": { + "path-parse": "^1.0.6" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "requires": { + "align-text": "^0.1.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" + }, + "token-stream": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/token-stream/-/token-stream-0.0.1.tgz", + "integrity": "sha1-zu78cXp2xDFvEm0LnbqlXX598Bo=" + }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "optional": true + }, + "void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", + "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=" + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=" + }, + "with": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/with/-/with-5.1.1.tgz", + "integrity": "sha1-+k2qktrzLE6pTtRTyB8EaGtXXf4=", + "requires": { + "acorn": "^3.1.0", + "acorn-globals": "^3.0.0" + } + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=" + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..7d5e20f --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "site", + "version": "1.0.0", + "description": "deuxfleurs.fr", + "main": "render.js", + "dependencies": { + "jstransformer-markdown-it": "^2.1.0", + "marked": "^0.8.0", + "pug": "^2.0.4" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git@git.deuxfleurs.fr:Deuxfleurs/site.git" + }, + "author": "", + "license": "ISC" +} diff --git a/render.js b/render.js new file mode 100644 index 0000000..e394400 --- /dev/null +++ b/render.js @@ -0,0 +1,172 @@ +'use strict' + +const pug = require('pug') +const marked = require('marked') +const fs = require('fs').promises + +const walk = async (path, filename) => { + const type = await fs.lstat(path) + if (type.isFile()) return {type: 'file', path: path, name: filename || path} + if (!type.isDirectory()) return null + + const files = await fs.readdir(path) + return { + type: 'folder', + path: path, + name: filename || path, + children: await Promise.all(files.map(file => walk(`${path}/${file}`, file))) + } +} + +const ext_static = ['.css', '.js', '.otf', '.png', '.svg', '.txt', 'client', 'server'] +const ext_md = ['.md', '.markdown'] +const ext_pug = ['.pug', '.jade'] + +const suffix = file => ext => file.substring(file.length - ext.length) == ext ? ext : null +const suffixl = (...l) => file => l.find(suffix(file)) +const is_static = suffixl(...ext_static) +const is_md = suffixl(...ext_md) +const is_pug = suffixl(...ext_pug) + +const prefix = file => ext => file.substring(0, ext.length) == ext ? ext : null +const prefixl = (...l) => file => l.find(prefix(file)) + +const rm_prefix = (...l) => file => file.substring(prefixl(...l)(file).length) +const rm_suffix = (...l) => file => file.substring(0, file.length - suffixl(...l)(file).length) + +const propagate_md_layout = (tree, markdown_template) => { + if (tree.type == 'file' && is_md(tree.name)) { + tree.template = markdown_template + } else if (tree.type == 'folder') { + const find_md_tpl = tree.children.filter(c => c.type == 'file' && c.name == '_markdown.pug') + const new_md_tpl = find_md_tpl.length > 0 ? find_md_tpl[0] : markdown_template + tree.children.forEach(c => propagate_md_layout(c, new_md_tpl)) + } + return tree +} + +const elagate_templates = tree => { + if (tree.type != 'folder') return tree + + tree.children = tree.children.filter(e => !(e.type == 'file' && e.name[0] == '_')) + tree.children.forEach(elagate_templates) + 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) + if (splitted.length > 0) { + tree.nice_path = splitted.slice(0, -1) + tree.nice_name = splitted[splitted.length - 1].split('.')[0] + tree.url = without_prefix + } + + if (tree.type == 'folder') tree.children.forEach(propagate_nice_name(prefix)) + return tree +} + +const prepare_copy = (old_prefix, new_prefix, exts) => tree => { + if (tree.type == 'file' && is_static(tree.name)) { + tree.generate = { + cmd: 'copy', + src: tree.path, + out: new_prefix + rm_prefix(old_prefix)(tree.path) + } + } else if (tree.type == 'folder') { + tree.children.forEach(prepare_copy(old_prefix, new_prefix, exts)) + } + return tree +} + +const prepare_pug = (old_prefix, new_prefix) => tree => { + if (tree.type == 'file' && is_pug(tree.name)) { + tree.generate = { + cmd: 'pug', + src: tree.path, + out: new_prefix + rm_prefix(old_prefix)(rm_suffix(...ext_pug)(tree.path)) + '.html' + } + } + else if (tree.type == 'folder') { + tree.children.forEach(prepare_pug(old_prefix, new_prefix)) + } + + return tree +} + +const prepare_md = (old_prefix, new_prefix) => tree => { + if (tree.type == 'file' && is_md(tree.name)) { + 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' + } + } + else if (tree.type == 'folder') { + tree.children.forEach(prepare_md(old_prefix, new_prefix)) + } + + return tree +} + +const prepare_folder = (old_prefix, new_prefix) => tree => { + if (tree.type == 'folder') { + tree.generate = { + cmd: 'mkdir', + out: new_prefix + rm_prefix(old_prefix)(tree.path) + } + tree.children.forEach(prepare_folder(old_prefix, new_prefix)) + } + + return tree +} + +const do_folder = async tree => { + if (!tree.generate || tree.generate.cmd != 'mkdir') return tree + await fs.mkdir(tree.generate.out, { recursive: true }) + await Promise.all(tree.children.map(do_folder)) + return tree +} + +const do_copy = async tree => { + if (tree.generate && tree.generate.cmd == 'copy') + await fs.copyFile(tree.generate.src, tree.generate.out) + else if (tree.type == 'folder') + await Promise.all(tree.children.map(do_copy)) + + return tree +} + +const do_pug = (prt, root) => async tree => { + prt = prt || tree + root = root || tree + if (tree.generate && tree.generate.cmd == 'pug') { + const html = pug.renderFile(tree.generate.src, { + markdown: tree.generate.markdown ? marked(await fs.readFile(tree.generate.markdown, 'utf-8')) : null, + prt: prt, + root: root, + element: tree + }) + await fs.writeFile(tree.generate.out, html) + } else if (tree.type == 'folder') + await Promise.all(tree.children.map(do_pug(tree,root))) + + return tree +} + + +const conf = { src: './src', dest: './static'} +walk(conf.src) + .then(propagate_md_layout) + .then(elagate_templates) + .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(do_folder) + .then(do_copy) + .then(do_pug()) + .then(v => console.log("done")) + .catch(console.error) diff --git a/src/.well-known/matrix/client b/src/.well-known/matrix/client new file mode 100644 index 0000000..d34a03a --- /dev/null +++ b/src/.well-known/matrix/client @@ -0,0 +1,9 @@ +{ + "m.homeserver": { + "base_url": "https://im.deuxfleurs.fr" + }, + "m.identity_server": { + "base_url": "https://vector.im" + } +} + diff --git a/src/.well-known/matrix/server b/src/.well-known/matrix/server new file mode 100644 index 0000000..e69de29 diff --git a/src/Documentation/Association/index.md b/src/Documentation/Association/index.md new file mode 100644 index 0000000..e69de29 diff --git a/src/Documentation/Technique/index.md b/src/Documentation/Technique/index.md new file mode 100644 index 0000000..e69de29 diff --git a/src/Documentation/_markdown.pug b/src/Documentation/_markdown.pug new file mode 100644 index 0000000..ea23f15 --- /dev/null +++ b/src/Documentation/_markdown.pug @@ -0,0 +1,22 @@ +extends ../_layout.pug + +prepend root + - title = element.nice_path[element.nice_path.length - 1] + +mixin menu(o) + ul + each val in o.children + - if (val.type == 'folder') + li + a(href=val.url)= val.nice_name + +menu(val) + +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/index.md b/src/Documentation/index.md new file mode 100644 index 0000000..cd99fca --- /dev/null +++ b/src/Documentation/index.md @@ -0,0 +1 @@ +# hello ! diff --git a/src/_layout.pug b/src/_layout.pug index 37d269a..a01151f 100644 --- a/src/_layout.pug +++ b/src/_layout.pug @@ -3,19 +3,19 @@ block root head meta(charset='utf-8') title 💮💮 deuxfleurs - #{title} - link(rel="stylesheet", href="css/main.css") + link(rel="stylesheet", href="/css/main.css") header .container .menu-item - a(href='index.html') + a(href='/') strong deuxfleurs  - img(src='img/flower.svg' width='38') - img(src='img/flower.svg' width='38') + img(src='/img/flower.svg' width='38') + img(src='/img/flower.svg' width='38') .menu-item a(href='https://guichet.deuxfleurs.fr') compte span  |  .menu-item - a(href='documentation.html') doc + a(href='/Documentation') doc span  |  h1 #{title} main diff --git a/src/css/main.css b/src/css/main.css new file mode 100644 index 0000000..37666f7 --- /dev/null +++ b/src/css/main.css @@ -0,0 +1,78 @@ +@font-face { + font-family: "Heroes"; + src: url('../fonts/texgyreheros-regular.otf') format('truetype'); +} +* { + font-family: Heroes; + margin: 0; + padding: 0; +} + +header { + background-color: #519c60; + color: #ffffff; + padding: 30px 0px 1px 0px; +} + +h1 { + font-size: 5em; +} + +h2 { + font-size: 3em; +} + +p { + font-size: 1.2em; +} + +.spacing { + margin-top: 1em; +} + +header > .container > h1 { + margin: 10px 0px -27px 0px; +} + +header > .container > .menu-item { + float: right; +} + +header > .container > .menu-item > img { + vertical-align: -9px; +} + +header > .container > .menu-item > a,span { + font-size: 30px; + color: white; + text-decoration: none; +} + +.container { + padding: 0px 40px 0px 40px; +} + +.chapeau { + font-size: 1.8em; + font-weight: bold; + line-height: 1.2; +} + +.service-box { + color: #000; + text-decoration: none; + border: 0.2em solid #000; + width: 250px; + text-align:center; + margin-right: 1em; + float: left; +} + +.service-box:hover { + background-color: #000; + color: #fff; +} + +.list > br { + clear: both; +} diff --git a/src/documentation.pug b/src/documentation.pug deleted file mode 100644 index a9a70f0..0000000 --- a/src/documentation.pug +++ /dev/null @@ -1,9 +0,0 @@ -extends _layout.pug - -prepend root - - title = "documentation" - -block content - .container.spacing - h2 Bientôt... - diff --git a/src/fonts/texgyreheros-bold.otf b/src/fonts/texgyreheros-bold.otf new file mode 100644 index 0000000..2f23b92 Binary files /dev/null and b/src/fonts/texgyreheros-bold.otf differ diff --git a/src/fonts/texgyreheros-bolditalic.otf b/src/fonts/texgyreheros-bolditalic.otf new file mode 100644 index 0000000..556b8e1 Binary files /dev/null and b/src/fonts/texgyreheros-bolditalic.otf differ diff --git a/src/fonts/texgyreheros-italic.otf b/src/fonts/texgyreheros-italic.otf new file mode 100644 index 0000000..ae50725 Binary files /dev/null and b/src/fonts/texgyreheros-italic.otf differ diff --git a/src/fonts/texgyreheros-regular.otf b/src/fonts/texgyreheros-regular.otf new file mode 100644 index 0000000..ac6c32f Binary files /dev/null and b/src/fonts/texgyreheros-regular.otf differ diff --git a/src/fonts/texgyreheroscn-bold.otf b/src/fonts/texgyreheroscn-bold.otf new file mode 100644 index 0000000..dc5f63a Binary files /dev/null and b/src/fonts/texgyreheroscn-bold.otf differ diff --git a/src/fonts/texgyreheroscn-bolditalic.otf b/src/fonts/texgyreheroscn-bolditalic.otf new file mode 100644 index 0000000..2b46b47 Binary files /dev/null and b/src/fonts/texgyreheroscn-bolditalic.otf differ diff --git a/src/fonts/texgyreheroscn-italic.otf b/src/fonts/texgyreheroscn-italic.otf new file mode 100644 index 0000000..f5159dd Binary files /dev/null and b/src/fonts/texgyreheroscn-italic.otf differ diff --git a/src/fonts/texgyreheroscn-regular.otf b/src/fonts/texgyreheroscn-regular.otf new file mode 100644 index 0000000..5630217 Binary files /dev/null and b/src/fonts/texgyreheroscn-regular.otf differ diff --git a/src/img/arobase.png b/src/img/arobase.png new file mode 100644 index 0000000..d2a275a Binary files /dev/null and b/src/img/arobase.png differ diff --git a/src/img/flower.svg b/src/img/flower.svg new file mode 100644 index 0000000..869788e --- /dev/null +++ b/src/img/flower.svg @@ -0,0 +1 @@ + diff --git a/src/robots.txt b/src/robots.txt new file mode 100644 index 0000000..c2a49f4 --- /dev/null +++ b/src/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Allow: / -- cgit v1.2.3