1549469775 3 years ago
parent
commit
642351c4e7
  1. 2
      package.json
  2. 159
      pnpm-lock.yaml
  3. 351
      public/style/common/normalize.css
  4. 6
      public/style/common/style.css
  5. 0
      public/style/views/index.css
  6. 2
      source/plugins/index.ts
  7. 25
      source/route/views/index/index.ts
  8. 9
      source/run.ts
  9. 41
      template/helper/rain.pug
  10. 18
      template/helper/ui.pug
  11. 3
      template/layout/layout.ejs
  12. 14
      template/layout/layout.pug
  13. 1
      template/md/about.md
  14. 0
      template/views/about copy.ejs
  15. 3
      template/views/about.ejs
  16. 14
      template/views/about.pug
  17. 15
      template/views/include/flush.pug
  18. 52
      template/views/index.pug

2
package.json

@ -34,9 +34,11 @@
"json-merge-patch": "^1.0.1",
"jsonwebtoken": "^8.5.1",
"jstransformer-markdown-it": "^3.0.0",
"markdown-it": "^13.0.1",
"multiparty": "^4.2.2",
"nodemon": "^2.0.7",
"pug": "^3.0.2",
"pug-alias": "^2.0.1",
"sequelize": "^6.6.2",
"sqlite3": "^5.0.2"
},

159
pnpm-lock.yaml

@ -33,9 +33,11 @@ specifiers:
jsonwebtoken: ^8.5.1
jstransformer-markdown-it: ^3.0.0
log4js: ^6.4.1
markdown-it: ^13.0.1
multiparty: ^4.2.2
nodemon: ^2.0.7
pug: ^3.0.2
pug-alias: ^2.0.1
sequelize: ^6.6.2
sqlite3: ^5.0.2
ts-node: ^10.0.0
@ -63,9 +65,11 @@ dependencies:
json-merge-patch: 1.0.1
jsonwebtoken: 8.5.1
jstransformer-markdown-it: 3.0.0
markdown-it: 13.0.1
multiparty: 4.2.2
nodemon: 2.0.7
pug: 3.0.2
pug-alias: 2.0.1
sequelize: 6.6.2_sqlite3@5.0.2
sqlite3: 5.0.2
@ -1016,7 +1020,7 @@ packages:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
/array-find-index/1.0.2:
resolution: {integrity: sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=}
resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==}
engines: {node: '>=0.10.0'}
dev: true
@ -1041,7 +1045,7 @@ packages:
dev: false
/assert-plus/1.0.0:
resolution: {integrity: sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=}
resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==}
engines: {node: '>=0.8'}
dev: false
optional: true
@ -1051,7 +1055,7 @@ packages:
dev: true
/asynckit/0.4.0:
resolution: {integrity: sha1-x57Zf380y48robyXkLzDZkdLS3k=}
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
dev: false
optional: true
@ -1061,7 +1065,7 @@ packages:
dev: false
/aws-sign2/0.7.0:
resolution: {integrity: sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=}
resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==}
dev: false
optional: true
@ -1081,7 +1085,7 @@ packages:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
/bcrypt-pbkdf/1.0.2:
resolution: {integrity: sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=}
resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==}
dependencies:
tweetnacl: 0.14.5
dev: false
@ -1185,7 +1189,7 @@ packages:
dev: true
/camelcase-keys/2.1.0:
resolution: {integrity: sha1-MIvur/3ygRkFHvodkyITyRuPkuc=}
resolution: {integrity: sha512-bA/Z/DERHKqoEOrp+qeGKw1QlvEQkGZSc0XaY6VnTxZr+Kv1G5zFwttpjv8qxZ/sBPT4nthwZaAcsAZTJlSKXQ==}
engines: {node: '>=0.10.0'}
dependencies:
camelcase: 2.1.1
@ -1193,7 +1197,7 @@ packages:
dev: true
/camelcase/2.1.1:
resolution: {integrity: sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=}
resolution: {integrity: sha512-DLIsRzJVBQu72meAKPkWQOLcujdXT32hwdfnkI1frSiSRMK1MofjKHf+MEx0SB6fjEFXL8fBDv1dKymBlOp4Qw==}
engines: {node: '>=0.10.0'}
dev: true
@ -1207,7 +1211,7 @@ packages:
dev: true
/caseless/0.12.0:
resolution: {integrity: sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=}
resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==}
dev: false
optional: true
@ -1296,7 +1300,7 @@ packages:
dev: false
/code-point-at/1.1.0:
resolution: {integrity: sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=}
resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==}
engines: {node: '>=0.10.0'}
dev: false
@ -1354,7 +1358,7 @@ packages:
dev: false
/console-control-strings/1.1.0:
resolution: {integrity: sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=}
resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==}
dev: false
/constantinople/4.0.1:
@ -1382,7 +1386,7 @@ packages:
dev: false
/core-util-is/1.0.2:
resolution: {integrity: sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=}
resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==}
dev: false
/create-require/1.1.1:
@ -1412,14 +1416,14 @@ packages:
dev: false
/currently-unhandled/0.4.1:
resolution: {integrity: sha1-mI3zP+qxke95mmE2nddsF635V+o=}
resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==}
engines: {node: '>=0.10.0'}
dependencies:
array-find-index: 1.0.2
dev: true
/dashdash/1.14.1:
resolution: {integrity: sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=}
resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==}
engines: {node: '>=0.10'}
dependencies:
assert-plus: 1.0.0
@ -1511,7 +1515,7 @@ packages:
dev: true
/decamelize/1.2.0:
resolution: {integrity: sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=}
resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}
engines: {node: '>=0.10.0'}
dev: true
@ -1563,13 +1567,13 @@ packages:
dev: false
/delayed-stream/1.0.0:
resolution: {integrity: sha1-3zrhmayt+31ECqrgsp4icrJOxhk=}
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
dev: false
optional: true
/delegates/1.0.0:
resolution: {integrity: sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=}
resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==}
dev: false
/depd/1.1.2:
@ -1638,7 +1642,7 @@ packages:
dev: true
/ecc-jsbn/0.1.2:
resolution: {integrity: sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=}
resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==}
dependencies:
jsbn: 0.1.1
safer-buffer: 2.1.2
@ -1882,7 +1886,7 @@ packages:
optional: true
/extsprintf/1.3.0:
resolution: {integrity: sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=}
resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==}
engines: {'0': node >=0.6.0}
dev: false
optional: true
@ -1978,7 +1982,7 @@ packages:
dev: false
/forever-agent/0.6.1:
resolution: {integrity: sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=}
resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==}
dev: false
optional: true
@ -2018,7 +2022,7 @@ packages:
dev: false
/fs.realpath/1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/fs.realpath/-/fs.realpath-1.0.0.tgz}
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
/fsevents/2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
@ -2046,7 +2050,7 @@ packages:
dev: true
/gauge/2.7.4:
resolution: {integrity: sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=}
resolution: {integrity: sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==}
dependencies:
aproba: 1.2.0
console-control-strings: 1.1.0
@ -2072,7 +2076,7 @@ packages:
dev: false
/get-stdin/4.0.1:
resolution: {integrity: sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=}
resolution: {integrity: sha512-F5aQMywwJ2n85s4hJPTT9RPxGmubonuB10MNYo17/xph174n2MIR33HRguhzVag10O/npM7SPk73LMZNP+FaWw==}
engines: {node: '>=0.10.0'}
dev: true
@ -2091,7 +2095,7 @@ packages:
dev: false
/getpass/0.1.7:
resolution: {integrity: sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=}
resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==}
dependencies:
assert-plus: 1.0.0
dev: false
@ -2111,12 +2115,12 @@ packages:
dev: true
/glob/7.1.7:
resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/glob/-/glob-7.1.7.tgz}
resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==}
dependencies:
fs.realpath: 1.0.0
inflight: 1.0.6
inherits: 2.0.4
minimatch: 3.0.4
minimatch: 3.1.2
once: 1.4.0
path-is-absolute: 1.0.1
@ -2229,7 +2233,7 @@ packages:
dev: false
/har-schema/2.0.0:
resolution: {integrity: sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=}
resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==}
engines: {node: '>=4'}
dev: false
optional: true
@ -2262,7 +2266,7 @@ packages:
dev: false
/has-unicode/2.0.1:
resolution: {integrity: sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=}
resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==}
dev: false
/has-yarn/2.1.0:
@ -2296,7 +2300,7 @@ packages:
dev: false
/http-signature/1.2.0:
resolution: {integrity: sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=}
resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==}
engines: {node: '>=0.8', npm: '>=1.3.7'}
dependencies:
assert-plus: 1.0.0
@ -2364,7 +2368,7 @@ packages:
engines: {node: '>=0.8.19'}
/indent-string/2.1.0:
resolution: {integrity: sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=}
resolution: {integrity: sha512-aqwDFWSgSgfRaEwao5lg5KEcVd/2a+D1rvoG7NdilmYz0NwRk6StWpWdz/Hpk34MKPpx7s8XxUqimfcQK6gGlg==}
engines: {node: '>=0.10.0'}
dependencies:
repeating: 2.0.1
@ -2376,13 +2380,13 @@ packages:
dev: false
/inflight/1.0.6:
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/inflight/-/inflight-1.0.6.tgz}
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
dependencies:
once: 1.4.0
wrappy: 1.0.2
/inherits/2.0.4:
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/inherits/-/inherits-2.0.4.tgz}
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
/ini/1.3.7:
resolution: {integrity: sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==}
@ -2400,7 +2404,7 @@ packages:
dev: false
/is-arrayish/0.2.1:
resolution: {integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=}
resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==}
dev: true
/is-bigint/1.0.2:
@ -2459,14 +2463,14 @@ packages:
dev: true
/is-fullwidth-code-point/1.0.0:
resolution: {integrity: sha1-754xOG8DGn8NZDr4L95QxFfvAMs=}
resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==}
engines: {node: '>=0.10.0'}
dependencies:
number-is-nan: 1.0.1
dev: false
/is-fullwidth-code-point/2.0.0:
resolution: {integrity: sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=}
resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==}
engines: {node: '>=4'}
dev: false
@ -2562,11 +2566,11 @@ packages:
dev: false
/is-typedarray/1.0.0:
resolution: {integrity: sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=}
resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==}
dev: false
/is-utf8/0.2.1:
resolution: {integrity: sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=}
resolution: {integrity: sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==}
dev: true
/is-weakmap/2.0.1:
@ -2582,7 +2586,7 @@ packages:
dev: false
/isarray/1.0.0:
resolution: {integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=}
resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
dev: false
/isarray/2.0.5:
@ -2593,7 +2597,7 @@ packages:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
/isstream/0.1.2:
resolution: {integrity: sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=}
resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==}
dev: false
optional: true
@ -2649,7 +2653,7 @@ packages:
dev: true
/jsbn/0.1.1:
resolution: {integrity: sha1-peZUwuWi3rXyAdls77yoDA7y9RM=}
resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==}
dev: false
optional: true
@ -2692,7 +2696,7 @@ packages:
resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
/json-schema/0.2.3:
resolution: {integrity: sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=}
resolution: {integrity: sha512-a3xHnILGMtk+hDOqNwHzF6e2fNbiMrXZvxKQiEv2MlgQP+pjIOzqAmKYD2mDpXYE/44M7g+n9p2bKkYWDUcXCQ==}
dev: false
optional: true
@ -2701,7 +2705,7 @@ packages:
dev: true
/json-stringify-safe/5.0.1:
resolution: {integrity: sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=}
resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
dev: false
optional: true
@ -2742,7 +2746,7 @@ packages:
dev: false
/jsprim/1.4.1:
resolution: {integrity: sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=}
resolution: {integrity: sha512-4Dj8Rf+fQ+/Pn7C5qeEX02op1WfOss3PKTE9Nsop3Dx+6UPxlm1dr/og7o2cRa5hNN07CACr4NFzRLtj/rjWog==}
engines: {'0': node >=0.6.0}
dependencies:
assert-plus: 1.0.0
@ -2809,7 +2813,7 @@ packages:
dev: false
/load-json-file/1.1.0:
resolution: {integrity: sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=}
resolution: {integrity: sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==}
engines: {node: '>=0.10.0'}
dependencies:
graceful-fs: 4.2.6
@ -2885,7 +2889,7 @@ packages:
dev: true
/loud-rejection/1.6.0:
resolution: {integrity: sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=}
resolution: {integrity: sha512-RPNliZOFkqFumDhvYqOaNY4Uz9oJM2K9tC6JWsJJsNdhuONW4LQHRBpb0qf4pJApVffI5N39SwzWZJuEhfd7eQ==}
engines: {node: '>=0.10.0'}
dependencies:
currently-unhandled: 0.4.1
@ -2921,7 +2925,7 @@ packages:
dev: true
/map-obj/1.0.1:
resolution: {integrity: sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=}
resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==}
engines: {node: '>=0.10.0'}
dev: true
@ -2941,7 +2945,7 @@ packages:
dev: false
/meow/3.7.0:
resolution: {integrity: sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=}
resolution: {integrity: sha512-TNdwZs0skRlpPpCUK25StC4VH+tP5GgeY1HQOOGP+lQ2xtdkN2VtT/5tiX9k3IWpkBPV9b3LsAWXn4GGi/PrSA==}
engines: {node: '>=0.10.0'}
dependencies:
camelcase-keys: 2.1.0
@ -3249,7 +3253,7 @@ packages:
dev: false
/number-is-nan/1.0.1:
resolution: {integrity: sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=}
resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==}
engines: {node: '>=0.10.0'}
dev: false
@ -3259,7 +3263,7 @@ packages:
optional: true
/object-assign/4.1.1:
resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=}
resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
engines: {node: '>=0.10.0'}
/object-inspect/1.10.3:
@ -3290,7 +3294,7 @@ packages:
dev: false
/once/1.4.0:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/once/-/once-1.4.0.tgz}
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
dependencies:
wrappy: 1.0.2
@ -3371,7 +3375,7 @@ packages:
dev: true
/parse-json/2.2.0:
resolution: {integrity: sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=}
resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==}
engines: {node: '>=0.10.0'}
dependencies:
error-ex: 1.3.2
@ -3390,7 +3394,7 @@ packages:
dev: true
/path-is-absolute/1.0.1:
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz}
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
engines: {node: '>=0.10.0'}
/path-key/3.1.1:
@ -3421,7 +3425,7 @@ packages:
dev: true
/performance-now/2.1.0:
resolution: {integrity: sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=}
resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==}
dev: false
optional: true
@ -3434,19 +3438,19 @@ packages:
engines: {node: '>=8.6'}
/pify/2.3.0:
resolution: {integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw=}
resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
engines: {node: '>=0.10.0'}
dev: true
/pinkie-promise/2.0.1:
resolution: {integrity: sha1-ITXW36ejWMBprJsXh3YogihFD/o=}
resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==}
engines: {node: '>=0.10.0'}
dependencies:
pinkie: 2.0.4
dev: true
/pinkie/2.0.4:
resolution: {integrity: sha1-clVrgM+g1IqXToDnckjoDtT3+HA=}
resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==}
engines: {node: '>=0.10.0'}
dev: true
@ -3492,6 +3496,12 @@ packages:
resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==}
dev: false
/pug-alias/2.0.1:
resolution: {integrity: sha512-xyo2etc/6pex1yIvulRhYmMhxpPXHxcTZ2u33GemXIHH+iccGQ3CFAziTFfvrid5NZ95aQxjrybdB8aNjmBOyA==}
dependencies:
pug-load: 2.0.12
dev: false
/pug-attrs/3.0.0:
resolution: {integrity: sha512-azINV9dUtzPMFQktvTXciNAfAuVh/L/JCl0vtPCwvOA21uZrC08K/UnmrL+SXGEVc1FwzjW62+xw5S/uaLj6cA==}
dependencies:
@ -3542,6 +3552,13 @@ packages:
pug-walk: 2.0.0
dev: false
/pug-load/2.0.12:
resolution: {integrity: sha512-UqpgGpyyXRYgJs/X60sE6SIf8UBsmcHYKNaOccyVLEuT6OPBIMo6xMPhoJnqtB3Q3BbO4Z3Bjz5qDsUWh4rXsg==}
dependencies:
object-assign: 4.1.1
pug-walk: 1.1.8
dev: false
/pug-load/3.0.0:
resolution: {integrity: sha512-OCjTEnhLWZBvS4zni/WUMjH2YSUosnsmjGBB1An7CsKQarYSWQ0GCVyd4eQPMFJqZ8w9xgs01QdiZXKVjk92EQ==}
dependencies:
@ -3566,6 +3583,10 @@ packages:
pug-error: 2.0.0
dev: false
/pug-walk/1.1.8:
resolution: {integrity: sha512-GMu3M5nUL3fju4/egXwZO0XLi6fW/K3T3VTgFQ14GxNi8btlxgT5qZL//JwZFm/2Fa64J/PNS8AZeys3wiMkVA==}
dev: false
/pug-walk/2.0.0:
resolution: {integrity: sha512-yYELe9Q5q9IQhuvqsZNwA5hfPkMJ8u92bQLIMcsMxf/VADjNtEYptU+inlufAFYcWdHlwNfZOEnOOQrZrcyJCQ==}
dev: false
@ -3631,7 +3652,7 @@ packages:
dev: false
/read-pkg-up/1.0.1:
resolution: {integrity: sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=}
resolution: {integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==}
engines: {node: '>=0.10.0'}
dependencies:
find-up: 1.1.2
@ -3639,7 +3660,7 @@ packages:
dev: true
/read-pkg/1.1.0:
resolution: {integrity: sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=}
resolution: {integrity: sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==}
engines: {node: '>=0.10.0'}
dependencies:
load-json-file: 1.1.0
@ -3683,7 +3704,7 @@ packages:
picomatch: 2.3.0
/redent/1.0.0:
resolution: {integrity: sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=}
resolution: {integrity: sha512-qtW5hKzGQZqKoh6JNSD+4lfitfPKGz42e6QwiRmPM5mmKtR0N41AbJRYu0xJi7nhOJ4WDgRkKvAk6tw4WIwR4g==}
engines: {node: '>=0.10.0'}
dependencies:
indent-string: 2.1.0
@ -3718,7 +3739,7 @@ packages:
dev: false
/repeating/2.0.1:
resolution: {integrity: sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=}
resolution: {integrity: sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A==}
engines: {node: '>=0.10.0'}
dependencies:
is-finite: 1.1.0
@ -3897,7 +3918,7 @@ packages:
dev: false
/set-blocking/2.0.0:
resolution: {integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc=}
resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
dev: false
/setprototypeof/1.2.0:
@ -4023,7 +4044,7 @@ packages:
dev: true
/string-width/1.0.2:
resolution: {integrity: sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=}
resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==}
engines: {node: '>=0.10.0'}
dependencies:
code-point-at: 1.1.0
@ -4096,7 +4117,7 @@ packages:
ansi-regex: 5.0.1
/strip-bom/2.0.0:
resolution: {integrity: sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=}
resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==}
engines: {node: '>=0.10.0'}
dependencies:
is-utf8: 0.2.1
@ -4108,7 +4129,7 @@ packages:
dev: true
/strip-indent/1.0.1:
resolution: {integrity: sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=}
resolution: {integrity: sha512-I5iQq6aFMM62fBEAIB/hXzwJD6EEZ0xEGCX2t7oXqaKPIRgt4WruAQ285BISgdkP+HLGWyeGmNJcpIwFeRYRUA==}
engines: {node: '>=0.10.0'}
hasBin: true
dependencies:
@ -4279,7 +4300,7 @@ packages:
dev: true
/trim-newlines/1.0.0:
resolution: {integrity: sha1-WIeWa7WCpFA6QetST301ARgVphM=}
resolution: {integrity: sha512-Nm4cF79FhSTzrLKGDMi3I4utBtFv8qKy4sq1enftf2gMdpqI8oVQTAfySkTz5r49giVzDj88SVZXP4CeYQwjaw==}
engines: {node: '>=0.10.0'}
dev: true
@ -4384,14 +4405,14 @@ packages:
dev: true
/tunnel-agent/0.6.0:
resolution: {integrity: sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=}
resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}
dependencies:
safe-buffer: 5.2.1
dev: false
optional: true
/tweetnacl/0.14.5:
resolution: {integrity: sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=}
resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==}
dev: false
optional: true
@ -4513,7 +4534,7 @@ packages:
dev: false
/util-deprecate/1.0.2:
resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=}
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
/uuid/3.4.0:
resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==}
@ -4544,7 +4565,7 @@ packages:
dev: false
/verror/1.10.0:
resolution: {integrity: sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=}
resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==}
engines: {'0': node >=0.6.0}
dependencies:
assert-plus: 1.0.0
@ -4648,7 +4669,7 @@ packages:
resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==}
/wrappy/1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/wrappy/-/wrappy-1.0.2.tgz}
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
/write-file-atomic/3.0.3:
resolution: {integrity: sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==}

351
public/style/common/normalize.css

@ -0,0 +1,351 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
/* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

6
public/style/common/style.css

@ -0,0 +1,6 @@
/* html,
body {
background-color: #f5f5f5;
min-height: 100%;
} */

0
public/style/views/index.css

2
source/plugins/index.ts

@ -1,6 +1,6 @@
import filePlugin from "./file-plugin";
import path from "path";
import { sourceDir } from "@/util";
import { baseDir, sourceDir } from "@/util";
import { plugin as routePlugin } from "@noderun/hapi-router";
import {ServerRegisterPluginObject, Plugin, Server, Request, ResponseObject} from "@hapi/hapi"
import Hoek from "@hapi/hoek"

25
source/route/views/index/index.ts

@ -13,6 +13,7 @@ import glob from "fast-glob";
import path from "path";
import fs from "fs-extra";
import { baseDir } from "@/util";
import MarkdownIt from "markdown-it";
export default class Index {
async css(request: Req, h: Res): ReturnValue {
@ -32,18 +33,22 @@ export default class Index {
@route("/about")
@auth(false)
async about(request: Req, h) {
console.log(request.auth);
console.log(1);
// console.log(request.auth);
// console.log(1);
try {
const User = request.getModel("User");
// try {
// const User = request.getModel("User");
console.log(await User.findOne({ where: { username: "xieyaxin" } }));
} catch (error) {
console.log(error);
}
console.log(2);
return h.view("views/about.ejs");
// console.log(await User.findOne({ where: { username: "xieyaxin" } }));
// } catch (error) {
// console.log(error);
// }
// console.log(2);
const md = new MarkdownIt();
var result = md.render('# markdown-it rulezz!');
return h.view("views/about.pug", {
result: '# markdown-it rulezz!'
});
}
// @auth()

9
source/run.ts

@ -10,6 +10,8 @@ import { Req } from "#/global";
// const HapiSwagger = require("hapi-swagger");
// const HapiSwagger = require("hapi-swaggered-ui"); // swagger v2版本
const pugPluginAlias = require('pug-alias');
const run = async (): Promise<Server> => {
const server = Hapi.server({
port: 3388,
@ -88,6 +90,13 @@ const run = async (): Promise<Server> => {
// By default Pug uses relative paths (e.g. ../root.pug), when using absolute paths (e.g. include /root.pug), basedir is prepended.
// https://pugjs.org/language/includes.html
basedir: templateDir,
globals: [],
plugins: [
pugPluginAlias({
// as Function
'@': fn => fn.replace(/^@/, 'template')
})
]
},
});

41
template/helper/rain.pug

@ -0,0 +1,41 @@
canvas(id="snow") 不支持canvas
style
| canvas#snow { position: absolute; z-index: -1; top: 0; left: 0; opacity: 0.5; }
script(type="text/javascript", src="https://code.jquery.com/jquery-3.6.0.min.js")
script
| $(function () {
| var W = $(window).width(),
| H = $(window).height(),
| x2 = -15, len = 30, count = 100;
| var canvas = document.getElementById("snow");
| canvas.width = W;
| canvas.height = H;
| var ctx = canvas.getContext('2d');
|
| setInterval(clearCanvas,100);
| function clearCanvas() {
| ctx.clearRect(0, 0, W, H);
| draws();
| }
|
| function draw(x, y) {
| //canvas写渐变:createLinearGradient(startX,startY,endX,endY)
| var grd = ctx.createLinearGradient(x, y, x + x2, y + len);
| grd.addColorStop(0, "rgba(0,0,0,0)");
| grd.addColorStop(0.5, "rgba(105,105,105,1)");
| grd.addColorStop(1, "rgba(255,255,255,1)");
| ctx.strokeStyle = grd;
|
| ctx.beginPath();
| ctx.moveTo(x, y);
| ctx.lineTo(x + x2, y + len);
| ctx.lineWidth = 2;
| ctx.stroke();
| ctx.closePath();
| }
| function draws() {
| for (var i = 1; i <= count; i++) {
| draw(Math.random() * W, Math.random() * H);
| }
| }
|});

18
template/helper/ui.pug

@ -0,0 +1,18 @@
mixin css(href)
link(rel="stylesheet" href="/public/"+href)
mixin script(src)
script(src="/public/"+src)
mixin mdScript()
//- script(src="https://cdn.bootcdn.net/ajax/libs/markdown-it/13.0.1/markdown-it.min.js")
mixin header()
nav.navbar.navbar-expand-lg.bg-light
.container
a.navbar-brand(href='/') 飘雨
button.navbar-toggler(type='button', data-bs-toggle='collapse', data-bs-target='#navbarSupportedContent', aria-controls='navbarSupportedContent', aria-expanded='false', aria-label='Toggle navigation')
span.navbar-toggler-icon
.collapse.navbar-collapse#navbarSupportedContent
ul.navbar-nav.me-auto.mb-2.mb-lg-0
li.nav-item
a.nav-link.active(aria-current='page', href='/about') 关于

3
template/layout/layout.ejs

@ -1,3 +0,0 @@
11111111
<%- content %>
22222222

14
template/layout/layout.pug

@ -1,10 +1,7 @@
doctype html
include @/helper/ui.pug
html(lang="zh-cn")
mixin css(href)
link(rel="stylesheet" href="/public/"+href)
mixin script(src)
script(src="/public/"+src)
block var
head
meta(charset="UTF-8")
@ -13,9 +10,14 @@ html(lang="zh-cn")
//- device-width 宽度低于1100像素的设备直接缩小
meta(name="viewport", content="width=1100, initial-scale=1.0")
title #{title || 'WEB'}
//- link(rel="stylesheet", href="/public/css/common/style.css")
+css("css/common/style.css")
link(rel="stylesheet", href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css", integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx", crossorigin="anonymous")
+css("style/common/style.css")
block head
body
if !hideHeader
+header()
block content
script(src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js", integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa", crossorigin="anonymous")
+mdScript()
block script
include @/helper/rain.pug

1
template/md/about.md

@ -0,0 +1 @@
## 关于我

0
template/views/about copy.ejs

3
template/views/about.ejs

@ -1,3 +0,0 @@
<%- include("include/header", {title: "2131"}) %>
<div>撒大大大</div>
<%- include("include/footer") %>

14
template/views/about.pug

@ -0,0 +1,14 @@
extends /layout/layout
block var
-title="关于我" // 网页标题
//- -hideHeader=true
block head
//- +css("style/views/index.css")
block content
.container(style="margin-top: 20px;")
include:markdown-it ../md/about.md
//- - var markdown = require("markdown-it")
//- #{markdown}

15
template/views/include/flush.pug

@ -4,4 +4,17 @@ if flash&&flash.error
each item in flash.error
<li>#{item}</li>
</ul>
</div>
</div>
//- <div class="toast-container position-fixed bottom-0 end-0 p-3">
//- <div id="liveToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
//- <div class="toast-header">
//- <img src="..." class="rounded me-2" alt="...">
//- <strong class="me-auto">Bootstrap</strong>
//- <small>11 mins ago</small>
//- <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
//- </div>
//- <div class="toast-body">
//- Hello, world! This is a toast message.
//- </div>
//- </div>
//- </div>

52
template/views/index.pug

@ -1,16 +1,50 @@
extends /layout/layout
block var
-title="CSS选择器" // 网页标题
-title="首页" // 网页标题
//- -hideHeader=true
block head
//- link(rel="stylesheet", href="/public/css/common/reset.css")
//- link(rel="stylesheet", href="/public/css/page/index.css")
+css("css/page/index.css")
+css("style/views/index.css")
block content
.container
h1.title 终是无缘一别两欢#{isLogin}
div.word 昨天看了我初中喜欢的人在空间发的一篇关于怀念初中的短篇小说吧,记录了他对一些记忆深刻的人的评价,而我也看到了我明明一直清楚,却不肯打心底接受的真相,他喜欢另外一个人,过往那么多的蛛丝马迹,那么多明明一件事就能看出他喜欢的人是她的真相,可我却是宁愿找借口自欺欺人,而今他给出坦白答案,他是放下了,才说出来,我是不是也该放下了,直到今日才明白我一个人自以为刻骨铭心的回忆,他也许早就忘怀,他的短篇小说故事中我没有丝言片语,也许若干年后他回想起来的只是我的名字,我只是个戏子,在他的故事中流着自己的泪,一个于他青春年华中不曾使他掀起过一丝波澜的模糊影子,而他不知道也永远不会知道,我的故事里他出现的很多,占了很多篇幅,我把他写进我的故事,因为他路过我心上,他踏着万千星河而来,又乘舟奔赴远方,我与春风皆过客,你携秋水揽星河。如今看来万般故事不过情伤,易水人去,明月如霜。
div.word(href="232") 他是无意穿堂风,却偏偏孤据引山洪。我是垂眉摆渡翁,却独独偏爱哝。
+script("js/page/css.js")
.container
.row.overflow-hidden
.col-12.p-2.col-md-6.col-lg-3
.card(style='margin: 0 auto;')
.card-body
h5.card-title Card title
h6.card-subtitle.mb-2.text-muted Card subtitle
p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
a.card-link(href='#') Card link
a.card-link(href='#') Another link
.col-12.p-2.col-md-6.col-lg-3
.card(style='margin: 0 auto;')
.card-body
h5.card-title Card title
h6.card-subtitle.mb-2.text-muted Card subtitle
p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
a.card-link(href='#') Card link
a.card-link(href='#') Another link
.col-12.p-2.col-md-6.col-lg-3
.card(style='margin: 0 auto;')
.card-body
h5.card-title Card title
h6.card-subtitle.mb-2.text-muted Card subtitle
p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
a.card-link(href='#') Card link
a.card-link(href='#') Another link
.col-12.p-2.col-md-6.col-lg-3
.card(style='margin: 0 auto;')
.card-body
h5.card-title Card title
h6.card-subtitle.mb-2.text-muted Card subtitle
p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
a.card-link(href='#') Card link
a.card-link(href='#') Another link
ul
li: a(href="https://cloud.tencent.com/developer/article/1793543" target="_blank") 15个最优秀的响应式CSS框架
li https://getbootstrap.com/docs/5.2/components/collapse/
li https://getbase.org/
li https://tooltt.com/html2pug/
li https://www.pugjs.cn/language/conditionals.html
Loading…
Cancel
Save