Migrate website to my own static site generator

This commit is contained in:
Quentin 2020-03-02 23:54:46 +01:00
parent 74c6a06b4b
commit ac3e7e4946
26 changed files with 843 additions and 18 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
*.html
static/
node_modules/

View File

@ -1,2 +1,3 @@
#!/bin/bash
pug ./src --out ./static
npm install
node render.js

View File

@ -5,7 +5,5 @@ deuxfleurs.fr
## Building
```
sudo npm install -g pug-cli
sudo npm install -g jstransformer-markdown-it
./.webpull
```

528
package-lock.json generated Normal file
View File

@ -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"
}
}
}
}

21
package.json Normal file
View File

@ -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"
}

172
render.js Normal file
View File

@ -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)

View File

@ -0,0 +1,9 @@
{
"m.homeserver": {
"base_url": "https://im.deuxfleurs.fr"
},
"m.identity_server": {
"base_url": "https://vector.im"
}
}

View File

View File

View File

View File

@ -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

View File

@ -0,0 +1 @@
# hello !

View File

@ -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

78
src/css/main.css Normal file
View File

@ -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;
}

View File

@ -1,9 +0,0 @@
extends _layout.pug
prepend root
- title = "documentation"
block content
.container.spacing
h2 Bientôt...

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
src/img/arobase.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

1
src/img/flower.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill-opacity="0.0" fill="#FFF" d="M15.632 34.661c-.799-.597-1.498-1.484-2.035-2.592l-.228-.47-.46.249c-.975.528-1.913.858-2.744.969l-.202-3.756-3.636.968c-.157-.854-.125-1.887.096-3.022l.103-.525-.532-.066c-1.242-.154-2.306-.525-3.104-1.08l1.521-2.917-2.988-1.523c.319-.944.948-1.882 1.834-2.735l.377-.363-.379-.36c-.803-.764-1.408-1.554-1.77-2.311l3.51-1.353-2.045-3.159c.74-.402 1.693-.686 2.789-.832l.519-.068-.091-.514c-.215-1.211-.172-2.338.124-3.288l3.308.523.524-3.308c.988.013 2.08.326 3.164.907l.462.248.226-.473c.479-1.003 1.044-1.824 1.653-2.404L18 4.326l2.372-2.92c.609.58 1.175 1.401 1.653 2.404l.226.473.462-.247c1.085-.581 2.178-.894 3.164-.906l.523 3.308 3.31-.525c.296.951.34 2.078.124 3.288l-.092.515.518.069c1.095.145 2.048.43 2.788.832l-2.046 3.156 3.511 1.355c-.361.757-.966 1.547-1.77 2.311l-.379.36.377.363c.888.854 1.516 1.793 1.835 2.736l-2.984 1.52 1.521 2.984c-.812.574-1.871.964-3.094 1.134l-.518.072.096.514c.201 1.089.226 2.083.073 2.909l-3.634-.97-.204 3.757c-.83-.11-1.768-.44-2.742-.968l-.459-.249-.228.47c-.539 1.107-1.237 1.994-2.036 2.591L18 32.293l-2.368 2.368z"/><path d="M7.092 10.678c-.53-1.489-.698-2.97-.432-4.2l2.368.375.987.156.157-.988.375-2.368c1.261.127 2.613.743 3.862 1.706.118-.337.244-.663.382-.967-1.551-1.135-3.223-1.763-4.73-1.763-.123 0-.245.004-.366.013l-.511 3.223-3.224-.511c-.6 1.487-.565 3.415.085 5.393.335-.037.684-.061 1.047-.069zm14.501-5.319c1.248-.962 2.6-1.578 3.86-1.705l.376 2.368.156.988.987-.157 2.369-.376c.266 1.23.098 2.71-.432 4.2.361.009.711.032 1.046.07.651-1.978.685-3.906.085-5.394l-3.225.512-.511-3.224c-.12-.008-.242-.012-.365-.012-1.507 0-3.179.628-4.73 1.762.14.306.266.631.384.968zM7.368 27h.035c.067 0 .157-.604.26-.947-.098.004-.197.046-.294.046-1.496 0-2.826-.303-3.83-.89l1.089-2.128.454-.887-.891-.452-2.136-1.088c.508-1.151 1.515-2.25 2.818-3.143-.287-.219-.561-.441-.81-.669-1.687 1.217-2.846 2.755-3.235 4.31l2.908 1.483-1.482 2.843C3.475 26.501 5.303 27 7.368 27zm27.806-5.846c-.39-1.555-1.548-3.093-3.234-4.311-.25.228-.523.451-.81.669 1.304.893 2.31 1.992 2.817 3.145l-2.136 1.088-.891.453.454.892 1.089 2.137c-1.004.587-2.332.904-3.828.904-.099 0-.199-.01-.299-.013.103.344.192.683.26 1.011l.039.002c2.066 0 3.892-.563 5.112-1.587l-1.482-2.908 2.909-1.482zm-12.653 9.182c-.447 1.517-1.181 2.812-2.119 3.651l-1.695-1.694-.707-.707-.707.707-1.695 1.694c-.938-.839-1.673-2.136-2.12-3.652-.296.206-.593.397-.886.563.636 1.98 1.741 3.559 3.1 4.409L18 33l2.308 2.308c1.358-.851 2.464-2.428 3.101-4.408-.295-.168-.591-.359-.888-.564z" fill="#FFF"/><path fill="#FFF" d="M20.118 5.683c.426 1.146.748 2.596.841 4.284l.2 3.683 3.564-.946c1.32-.351 2.655-.536 3.86-.536.16 0 .318.003.474.01l-1.827 2.819 3.139 1.211c-.958.759-2.237 1.514-3.814 2.123l-3.441 1.328 2.001 3.099c.918 1.42 1.509 2.782 1.838 3.96l-3.244-.865-.182 3.357c-1.019-.677-2.132-1.66-3.198-2.973L18 23.374l-2.328 2.862c-1.066 1.312-2.179 2.295-3.198 2.972l-.18-3.354-3.248.864c.329-1.178.921-2.54 1.839-3.961l2.004-3.099-3.442-1.328c-1.577-.609-2.856-1.363-3.814-2.122L8.768 15l-1.827-2.823c.155-.006.313-.01.473-.01 1.206 0 2.541.185 3.861.536l3.564.947.202-3.683c.092-1.688.415-3.138.84-4.284L18 8.292l2.118-2.609m.19-4.991L18 3.533 15.692.692c-1.989 1.532-3.421 4.992-3.646 9.112-1.617-.43-3.192-.637-4.632-.637-2.11 0-3.929.445-5.161 1.289l1.989 3.073-3.415 1.316c.842 2.366 3.69 4.797 7.54 6.283-2.241 3.465-3.116 7.106-2.407 9.516l3.537-.941.196 3.654c2.512-.07 5.703-2.027 8.307-5.228 2.603 3.201 5.796 5.158 8.306 5.228l.198-3.655 3.535.943c.71-2.411-.165-6.05-2.404-9.517 3.849-1.485 6.696-3.918 7.538-6.283l-3.415-1.318 1.99-3.07c-1.233-.844-3.053-1.29-5.164-1.29-1.438 0-3.013.207-4.63.636-.225-4.119-1.657-7.579-3.646-9.111z"/></svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

2
src/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-agent: *
Allow: /