Compare commits
No commits in common. "57efc611cd9f4d71a67ac2e875e774e8c4442ffd" and "cfee3be0d16edbf4c77faf70c4cfddbbcb99643d" have entirely different histories.
57efc611cd
...
cfee3be0d1
267
package-lock.json
generated
267
package-lock.json
generated
@ -12,13 +12,11 @@
|
||||
"github-slugger": "^2.0.0",
|
||||
"rehype-external-links": "^3.0.0",
|
||||
"rehype-highlight": "^7.0.1",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"rehype-slug": "^6.0.0",
|
||||
"rehype-stringify": "^10.0.1",
|
||||
"remark": "^15.0.1",
|
||||
"remark-breaks": "^4.0.0",
|
||||
"remark-gfm": "^4.0.0",
|
||||
"remark-math": "^6.0.0",
|
||||
"remark-rehype": "^11.1.1",
|
||||
"yaml": "^2.6.0"
|
||||
},
|
||||
@ -868,12 +866,6 @@
|
||||
"@types/unist": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/katex": {
|
||||
"version": "0.16.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/katex/-/katex-0.16.7.tgz",
|
||||
"integrity": "sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/mdast": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
|
||||
@ -1004,15 +996,6 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
|
||||
"integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
|
||||
@ -1092,18 +1075,6 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
||||
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.21.5",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",
|
||||
@ -1214,75 +1185,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/hast-util-from-dom": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-from-dom/-/hast-util-from-dom-5.0.1.tgz",
|
||||
"integrity": "sha512-N+LqofjR2zuzTjCPzyDUdSshy4Ma6li7p/c3pA78uTwzFgENbgbUrm2ugwsOdcjI1muO+o6Dgzp9p8WHtn/39Q==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@types/hast": "^3.0.0",
|
||||
"hastscript": "^9.0.0",
|
||||
"web-namespaces": "^2.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-from-html": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz",
|
||||
"integrity": "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/hast": "^3.0.0",
|
||||
"devlop": "^1.1.0",
|
||||
"hast-util-from-parse5": "^8.0.0",
|
||||
"parse5": "^7.0.0",
|
||||
"vfile": "^6.0.0",
|
||||
"vfile-message": "^4.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-from-html-isomorphic": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-from-html-isomorphic/-/hast-util-from-html-isomorphic-2.0.0.tgz",
|
||||
"integrity": "sha512-zJfpXq44yff2hmE0XmwEOzdWin5xwH+QIhMLOScpX91e/NSGPsAzNCvLQDIEPyO2TXi+lBmU6hjLIhV8MwP2kw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/hast": "^3.0.0",
|
||||
"hast-util-from-dom": "^5.0.0",
|
||||
"hast-util-from-html": "^2.0.0",
|
||||
"unist-util-remove-position": "^5.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-from-parse5": {
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.2.tgz",
|
||||
"integrity": "sha512-SfMzfdAi/zAoZ1KkFEyyeXBn7u/ShQrfd675ZEE9M3qj+PMFX05xubzRyF76CCSJu8au9jgVxDV1+okFvgZU4A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/hast": "^3.0.0",
|
||||
"@types/unist": "^3.0.0",
|
||||
"devlop": "^1.0.0",
|
||||
"hastscript": "^9.0.0",
|
||||
"property-information": "^6.0.0",
|
||||
"vfile": "^6.0.0",
|
||||
"vfile-location": "^5.0.0",
|
||||
"web-namespaces": "^2.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-heading-rank": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-heading-rank/-/hast-util-heading-rank-3.0.0.tgz",
|
||||
@ -1309,19 +1211,6 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-parse-selector": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz",
|
||||
"integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/hast": "^3.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hast-util-to-html": {
|
||||
"version": "9.0.3",
|
||||
"resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.3.tgz",
|
||||
@ -1387,23 +1276,6 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/hastscript": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hastscript/-/hastscript-9.0.0.tgz",
|
||||
"integrity": "sha512-jzaLBGavEDKHrc5EfFImKN7nZKKBdSLIdGvCwDZ9TfzbF2ffXiov8CKE445L2Z1Ek2t/m4SKQ2j6Ipv7NyUolw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/hast": "^3.0.0",
|
||||
"comma-separated-tokens": "^2.0.0",
|
||||
"hast-util-parse-selector": "^4.0.0",
|
||||
"property-information": "^6.0.0",
|
||||
"space-separated-tokens": "^2.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/highlight.js": {
|
||||
"version": "11.10.0",
|
||||
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.10.0.tgz",
|
||||
@ -1468,22 +1340,6 @@
|
||||
"@types/estree": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/katex": {
|
||||
"version": "0.16.11",
|
||||
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.11.tgz",
|
||||
"integrity": "sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==",
|
||||
"funding": [
|
||||
"https://opencollective.com/katex",
|
||||
"https://github.com/sponsors/katex"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^8.3.0"
|
||||
},
|
||||
"bin": {
|
||||
"katex": "cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/kleur": {
|
||||
"version": "4.1.5",
|
||||
"resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
|
||||
@ -1687,25 +1543,6 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/mdast-util-math": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mdast-util-math/-/mdast-util-math-3.0.0.tgz",
|
||||
"integrity": "sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/hast": "^3.0.0",
|
||||
"@types/mdast": "^4.0.0",
|
||||
"devlop": "^1.0.0",
|
||||
"longest-streak": "^3.0.0",
|
||||
"mdast-util-from-markdown": "^2.0.0",
|
||||
"mdast-util-to-markdown": "^2.1.0",
|
||||
"unist-util-remove-position": "^5.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/mdast-util-newline-to-break": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mdast-util-newline-to-break/-/mdast-util-newline-to-break-2.0.0.tgz",
|
||||
@ -1979,25 +1816,6 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/micromark-extension-math": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz",
|
||||
"integrity": "sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/katex": "^0.16.0",
|
||||
"devlop": "^1.0.0",
|
||||
"katex": "^0.16.0",
|
||||
"micromark-factory-space": "^2.0.0",
|
||||
"micromark-util-character": "^2.0.0",
|
||||
"micromark-util-symbol": "^2.0.0",
|
||||
"micromark-util-types": "^2.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/micromark-factory-destination": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz",
|
||||
@ -2416,18 +2234,6 @@
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/parse5": {
|
||||
"version": "7.2.1",
|
||||
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz",
|
||||
"integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"entities": "^4.5.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
||||
@ -2509,25 +2315,6 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-katex": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/rehype-katex/-/rehype-katex-7.0.1.tgz",
|
||||
"integrity": "sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/hast": "^3.0.0",
|
||||
"@types/katex": "^0.16.0",
|
||||
"hast-util-from-html-isomorphic": "^2.0.0",
|
||||
"hast-util-to-text": "^4.0.0",
|
||||
"katex": "^0.16.0",
|
||||
"unist-util-visit-parents": "^6.0.0",
|
||||
"vfile": "^6.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-slug": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/rehype-slug/-/rehype-slug-6.0.0.tgz",
|
||||
@ -2609,22 +2396,6 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/remark-math": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/remark-math/-/remark-math-6.0.0.tgz",
|
||||
"integrity": "sha512-MMqgnP74Igy+S3WwnhQ7kqGlEerTETXMvJhrUzDikVZ2/uogJCb+WHUg97hK9/jcfc0dkD73s3LN8zU49cTEtA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/mdast": "^4.0.0",
|
||||
"mdast-util-math": "^3.0.0",
|
||||
"micromark-extension-math": "^3.0.0",
|
||||
"unified": "^11.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/remark-parse": {
|
||||
"version": "11.0.0",
|
||||
"resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz",
|
||||
@ -2905,20 +2676,6 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/unist-util-remove-position": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz",
|
||||
"integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/unist": "^3.0.0",
|
||||
"unist-util-visit": "^5.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/unist-util-stringify-position": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz",
|
||||
@ -2975,20 +2732,6 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/vfile-location": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz",
|
||||
"integrity": "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/unist": "^3.0.0",
|
||||
"vfile": "^6.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/vfile-message": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz",
|
||||
@ -3082,16 +2825,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/web-namespaces": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz",
|
||||
"integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz",
|
||||
|
@ -19,13 +19,11 @@
|
||||
"github-slugger": "^2.0.0",
|
||||
"rehype-external-links": "^3.0.0",
|
||||
"rehype-highlight": "^7.0.1",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"rehype-slug": "^6.0.0",
|
||||
"rehype-stringify": "^10.0.1",
|
||||
"remark": "^15.0.1",
|
||||
"remark-breaks": "^4.0.0",
|
||||
"remark-gfm": "^4.0.0",
|
||||
"remark-math": "^6.0.0",
|
||||
"remark-rehype": "^11.1.1",
|
||||
"yaml": "^2.6.0"
|
||||
}
|
||||
|
@ -78,22 +78,6 @@
|
||||
background-color: #fff0;
|
||||
}
|
||||
}
|
||||
& table {
|
||||
margin: 1rem auto;
|
||||
font-size: 1.2em;
|
||||
border-collapse: collapse;
|
||||
|
||||
& thead {
|
||||
border-bottom: solid 1px var(--black-white);
|
||||
}
|
||||
& tbody tr:nth-child(2n) {
|
||||
background-color: color-mix(in srgb, var(--black-white) 10%, var(--back-color));
|
||||
}
|
||||
& td,th {
|
||||
border-width: 0px;
|
||||
padding: .3em .6em;
|
||||
}
|
||||
}
|
||||
& blockquote {
|
||||
position: relative;
|
||||
font-style: italic;
|
||||
@ -161,13 +145,4 @@
|
||||
width: 60%;
|
||||
}
|
||||
}
|
||||
& .katex-html {
|
||||
display: none;
|
||||
}
|
||||
& .katex-display {
|
||||
& math {
|
||||
margin: 1rem;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +1,11 @@
|
||||
<script>
|
||||
export let mdtext;
|
||||
|
||||
import { onMount } from "svelte";
|
||||
|
||||
import { remark } from 'remark'
|
||||
import remarkgfm from 'remark-gfm'
|
||||
import remarkBreaks from "remark-breaks"
|
||||
import remarkmath from 'remark-math'
|
||||
import remarkRehype from 'remark-rehype'
|
||||
import rehypeslug from 'rehype-slug'
|
||||
import rehypeKatex from 'rehype-katex'
|
||||
import rehypeHighlight from 'rehype-highlight'
|
||||
import rehypeExternalLinks from 'rehype-external-links'
|
||||
import rehypeStringify from 'rehype-stringify'
|
||||
@ -21,36 +17,13 @@
|
||||
let md = remark()
|
||||
.use(remarkgfm) // Github Markdown
|
||||
.use(remarkBreaks) // 改行
|
||||
.use(remarkmath) // 数式
|
||||
.use(remarkRehype, {allowDangerousHtml: true})
|
||||
.use(rehypeslug) // headingにidを設定
|
||||
.use(rehypeKatex) // 数式
|
||||
.use(rehypeHighlight)// Syntax highlight
|
||||
.use(rehypeExternalLinks, {target:'_blank', rel:['noreferrer','noopener']})// 外部サイトを新規タブで開く
|
||||
.use(rehypeStringify, {allowDangerousHtml: true})
|
||||
.processSync(mdtext)
|
||||
|
||||
onMount(()=>{
|
||||
let toggleHide = function(e){
|
||||
|
||||
let iframes = document.getElementsByTagName('iframe')
|
||||
for ( let i = 0; i < iframes.length; i++ ){
|
||||
try{
|
||||
console.log(iframes[i].contentWindow.name)
|
||||
if (e.origin === window.origin && iframes[i].contentWindow.name == e.data.id){
|
||||
iframes[i].classList.toggle('hide')
|
||||
}
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('message', toggleHide)
|
||||
|
||||
return ()=>{window.removeEventListener('message', toggleHide)}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<div class='markdown'>
|
||||
|
@ -10,6 +10,7 @@ async function Metadatas() {
|
||||
const cache_dir = '/tmp/day.moris.blog/';
|
||||
const cache_file = `${cache_dir}metadata.json`;
|
||||
|
||||
|
||||
async function build() {
|
||||
const posts = await Posts();
|
||||
|
||||
@ -19,11 +20,9 @@ async function Metadatas() {
|
||||
return {postId, metadata}
|
||||
}))
|
||||
|
||||
const sorted = metadataList
|
||||
.sort((a,b)=>{
|
||||
const sorted = metadataList.sort((a,b)=>{
|
||||
return b.metadata.date.getTime() - a.metadata.date.getTime()
|
||||
})
|
||||
.filter((m)=> dev||m.metadata.published)
|
||||
|
||||
return sorted
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
import Header from "./header.svelte";
|
||||
import Footer from "./footer.svelte";
|
||||
import { onMount } from 'svelte';
|
||||
import { dev } from '$app/environment'
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
@ -20,9 +19,6 @@
|
||||
|
||||
<div id="root">
|
||||
<div id="scroll"></div>
|
||||
{#if dev}
|
||||
<div id='devTicker'>DEV DUILD</div>
|
||||
{/if}
|
||||
|
||||
<div class="headerContainer">
|
||||
<header class:hide={!scrollObserver}>
|
||||
@ -49,23 +45,13 @@
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
#devTicker {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: 6px;
|
||||
color: yellow;
|
||||
background-color: #0008;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.headerContainer {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
height: 80px;
|
||||
height: 100px;
|
||||
z-index: 1;
|
||||
@media(width<1000px) {
|
||||
height: 40px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
& header {
|
||||
@ -73,7 +59,7 @@
|
||||
height: 100%;
|
||||
transition: height .4s, transform .4s;
|
||||
&.hide {
|
||||
height: 40px;
|
||||
height: 50px;
|
||||
@media(width<1000px) {
|
||||
transform: translate(0px,-50px);
|
||||
}
|
||||
@ -110,6 +96,6 @@
|
||||
}
|
||||
|
||||
@media (scripting: none) {
|
||||
.headerContainer{height:40px !important;}
|
||||
.headerContainer{height:50px !important;}
|
||||
}
|
||||
</style>
|
@ -7,11 +7,13 @@
|
||||
<div class='contain'>
|
||||
<div class="posts">
|
||||
{#each data.posts as post}
|
||||
<div class="post" class:published={!post.metadata.published}>
|
||||
{#if post.metadata.published}
|
||||
<div class="post">
|
||||
<a style='text-decoration: none;' href="../post/{post.postId}" tabindex="0">
|
||||
<Postgrid id={post.postId} {...post.metadata}></Postgrid>
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
{#if data.posts.length%4}
|
||||
{#each Array(4-data.posts.length%4) as i}
|
||||
@ -46,10 +48,6 @@
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 0 6px #0001;
|
||||
|
||||
&.published {
|
||||
border: solid red 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.paging {
|
||||
|
@ -24,8 +24,6 @@
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
font-size: .9rem;
|
||||
max-height: 280px;
|
||||
overflow: scroll;
|
||||
}
|
||||
li {
|
||||
padding: 4px;
|
||||
|
@ -1,6 +1,4 @@
|
||||
<script>
|
||||
let { children } = $props();
|
||||
|
||||
import './app.css'
|
||||
|
||||
function toggleFullScreen() {
|
||||
@ -27,7 +25,7 @@
|
||||
<button style="background-color: rgb(40 200 64)" aria-label="fullscreen" onclick={toggleFullScreen}></button>
|
||||
</div>
|
||||
<div class="code">
|
||||
{@render children()}
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -4,7 +4,7 @@ import fs from 'node:fs';
|
||||
export async function load({params}) {
|
||||
const code = params.slug.replace(/\.html$/, "");
|
||||
|
||||
const html = fs.readFileSync(`${POST_DIR}/Codes/${code}.html`, 'utf-8');
|
||||
const html = fs.readFileSync(`${POST_DIR}/Codes/${code}.html`);
|
||||
|
||||
return {html}
|
||||
}
|
@ -18,15 +18,17 @@ export async function GET() {
|
||||
let meta = post.metadata
|
||||
let link = `https://${PUBLIC_HOSTNAME}/blog/post/${path.basename(post.postId, '.md')}`
|
||||
|
||||
i++
|
||||
items += `
|
||||
<item>
|
||||
<title>${meta.title}</title>
|
||||
<description>${meta.description}</description>
|
||||
<link>${link}</link>
|
||||
<pubDate>${meta.date.toUTCString()}</pubDate>
|
||||
<guid>${link}</guid>
|
||||
</item>`
|
||||
if (meta.published) {
|
||||
i++
|
||||
items += `
|
||||
<item>
|
||||
<title>${meta.title}</title>
|
||||
<description>${meta.description}</description>
|
||||
<link>${link}</link>
|
||||
<pubDate>${meta.date.toUTCString()}</pubDate>
|
||||
<guid>${link}</guid>
|
||||
</item>`
|
||||
}
|
||||
|
||||
if (i==15) {break}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user