this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

markdown -> html in RSS feed

+141 -2
+6 -1
package.json
··· 21 21 "react-dom": "^18", 22 22 "react-markdown": "^9.0.1", 23 23 "reading-time": "^1.5.0", 24 + "rehype-format": "^5.0.1", 24 25 "rehype-sanitize": "^6.0.0", 26 + "rehype-stringify": "^10.0.1", 27 + "remark-parse": "^11.0.0", 28 + "remark-rehype": "^11.1.1", 25 29 "rss": "^1.2.2", 26 30 "simple-icons": "^13.14.1", 27 - "tailwind-merge": "^2.5.4" 31 + "tailwind-merge": "^2.5.4", 32 + "unified": "^11.0.5" 28 33 }, 29 34 "devDependencies": { 30 35 "@ianvs/prettier-plugin-sort-imports": "^4.3.1",
+123
pnpm-lock.yaml
··· 38 38 reading-time: 39 39 specifier: ^1.5.0 40 40 version: 1.5.0 41 + rehype-format: 42 + specifier: ^5.0.1 43 + version: 5.0.1 41 44 rehype-sanitize: 42 45 specifier: ^6.0.0 43 46 version: 6.0.0 47 + rehype-stringify: 48 + specifier: ^10.0.1 49 + version: 10.0.1 50 + remark-parse: 51 + specifier: ^11.0.0 52 + version: 11.0.0 53 + remark-rehype: 54 + specifier: ^11.1.1 55 + version: 11.1.1 44 56 rss: 45 57 specifier: ^1.2.2 46 58 version: 1.2.2 ··· 50 62 tailwind-merge: 51 63 specifier: ^2.5.4 52 64 version: 2.5.4 65 + unified: 66 + specifier: ^11.0.5 67 + version: 11.0.5 53 68 devDependencies: 54 69 '@ianvs/prettier-plugin-sort-imports': 55 70 specifier: ^4.3.1 ··· 1179 1194 resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} 1180 1195 engines: {node: '>= 0.4'} 1181 1196 1197 + hast-util-embedded@3.0.0: 1198 + resolution: {integrity: sha512-naH8sld4Pe2ep03qqULEtvYr7EjrLK2QHY8KJR6RJkTUjPGObe1vnx585uzem2hGra+s1q08DZZpfgDVYRbaXA==} 1199 + 1200 + hast-util-format@1.1.0: 1201 + resolution: {integrity: sha512-yY1UDz6bC9rDvCWHpx12aIBGRG7krurX0p0Fm6pT547LwDIZZiNr8a+IHDogorAdreULSEzP82Nlv5SZkHZcjA==} 1202 + 1203 + hast-util-has-property@3.0.0: 1204 + resolution: {integrity: sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA==} 1205 + 1206 + hast-util-is-body-ok-link@3.0.1: 1207 + resolution: {integrity: sha512-0qpnzOBLztXHbHQenVB8uNuxTnm/QBFUOmdOSsEn7GnBtyY07+ENTWVFBAnXd/zEgd9/SUG3lRY7hSIBWRgGpQ==} 1208 + 1209 + hast-util-is-element@3.0.0: 1210 + resolution: {integrity: sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==} 1211 + 1212 + hast-util-minify-whitespace@1.0.1: 1213 + resolution: {integrity: sha512-L96fPOVpnclQE0xzdWb/D12VT5FabA7SnZOUMtL1DbXmYiHJMXZvFkIZfiMmTCNJHUeO2K9UYNXoVyfz+QHuOw==} 1214 + 1215 + hast-util-phrasing@3.0.1: 1216 + resolution: {integrity: sha512-6h60VfI3uBQUxHqTyMymMZnEbNl1XmEGtOxxKYL7stY2o601COo62AWAYBQR9lZbYXYSBoxag8UpPRXK+9fqSQ==} 1217 + 1182 1218 hast-util-sanitize@5.0.1: 1183 1219 resolution: {integrity: sha512-IGrgWLuip4O2nq5CugXy4GI2V8kx4sFVy5Hd4vF7AR2gxS0N9s7nEAVUyeMtZKZvzrxVsHt73XdTsno1tClIkQ==} 1184 1220 1221 + hast-util-to-html@9.0.3: 1222 + resolution: {integrity: sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg==} 1223 + 1185 1224 hast-util-to-jsx-runtime@2.3.2: 1186 1225 resolution: {integrity: sha512-1ngXYb+V9UT5h+PxNRa1O1FYguZK/XL+gkeqvp7EdHlB9oHUG0eYRo/vY5inBdcqo3RkPMC58/H94HvkbfGdyg==} 1187 1226 ··· 1190 1229 1191 1230 html-url-attributes@3.0.1: 1192 1231 resolution: {integrity: sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==} 1232 + 1233 + html-void-elements@3.0.0: 1234 + resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==} 1235 + 1236 + html-whitespace-sensitive-tag-names@3.0.1: 1237 + resolution: {integrity: sha512-q+310vW8zmymYHALr1da4HyXUQ0zgiIwIicEfotYPWGN0OJVEN/58IJ3A4GBYcEq3LGAZqKb+ugvP0GNB9CEAA==} 1193 1238 1194 1239 ignore@5.3.2: 1195 1240 resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} ··· 1847 1892 resolution: {integrity: sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==} 1848 1893 engines: {node: '>= 0.4'} 1849 1894 1895 + rehype-format@5.0.1: 1896 + resolution: {integrity: sha512-zvmVru9uB0josBVpr946OR8ui7nJEdzZobwLOOqHb/OOD88W0Vk2SqLwoVOj0fM6IPCCO6TaV9CvQvJMWwukFQ==} 1897 + 1850 1898 rehype-sanitize@6.0.0: 1851 1899 resolution: {integrity: sha512-CsnhKNsyI8Tub6L4sm5ZFsme4puGfc6pYylvXo1AeqaGbjOYyzNv3qZPwvs0oMJ39eryyeOdmxwUIo94IpEhqg==} 1900 + 1901 + rehype-stringify@10.0.1: 1902 + resolution: {integrity: sha512-k9ecfXHmIPuFVI61B9DeLPN0qFHfawM6RsuX48hoqlaKSF61RskNjSm1lI8PhBEM0MRdLxVVm4WmTqJQccH9mA==} 1852 1903 1853 1904 remark-parse@11.0.0: 1854 1905 resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==} ··· 3451 3502 dependencies: 3452 3503 function-bind: 1.1.2 3453 3504 3505 + hast-util-embedded@3.0.0: 3506 + dependencies: 3507 + '@types/hast': 3.0.4 3508 + hast-util-is-element: 3.0.0 3509 + 3510 + hast-util-format@1.1.0: 3511 + dependencies: 3512 + '@types/hast': 3.0.4 3513 + hast-util-embedded: 3.0.0 3514 + hast-util-minify-whitespace: 1.0.1 3515 + hast-util-phrasing: 3.0.1 3516 + hast-util-whitespace: 3.0.0 3517 + html-whitespace-sensitive-tag-names: 3.0.1 3518 + unist-util-visit-parents: 6.0.1 3519 + 3520 + hast-util-has-property@3.0.0: 3521 + dependencies: 3522 + '@types/hast': 3.0.4 3523 + 3524 + hast-util-is-body-ok-link@3.0.1: 3525 + dependencies: 3526 + '@types/hast': 3.0.4 3527 + 3528 + hast-util-is-element@3.0.0: 3529 + dependencies: 3530 + '@types/hast': 3.0.4 3531 + 3532 + hast-util-minify-whitespace@1.0.1: 3533 + dependencies: 3534 + '@types/hast': 3.0.4 3535 + hast-util-embedded: 3.0.0 3536 + hast-util-is-element: 3.0.0 3537 + hast-util-whitespace: 3.0.0 3538 + unist-util-is: 6.0.0 3539 + 3540 + hast-util-phrasing@3.0.1: 3541 + dependencies: 3542 + '@types/hast': 3.0.4 3543 + hast-util-embedded: 3.0.0 3544 + hast-util-has-property: 3.0.0 3545 + hast-util-is-body-ok-link: 3.0.1 3546 + hast-util-is-element: 3.0.0 3547 + 3454 3548 hast-util-sanitize@5.0.1: 3455 3549 dependencies: 3456 3550 '@types/hast': 3.0.4 3457 3551 '@ungap/structured-clone': 1.2.0 3458 3552 unist-util-position: 5.0.0 3459 3553 3554 + hast-util-to-html@9.0.3: 3555 + dependencies: 3556 + '@types/hast': 3.0.4 3557 + '@types/unist': 3.0.3 3558 + ccount: 2.0.1 3559 + comma-separated-tokens: 2.0.3 3560 + hast-util-whitespace: 3.0.0 3561 + html-void-elements: 3.0.0 3562 + mdast-util-to-hast: 13.2.0 3563 + property-information: 6.5.0 3564 + space-separated-tokens: 2.0.2 3565 + stringify-entities: 4.0.4 3566 + zwitch: 2.0.4 3567 + 3460 3568 hast-util-to-jsx-runtime@2.3.2: 3461 3569 dependencies: 3462 3570 '@types/estree': 1.0.6 ··· 3482 3590 '@types/hast': 3.0.4 3483 3591 3484 3592 html-url-attributes@3.0.1: {} 3593 + 3594 + html-void-elements@3.0.0: {} 3595 + 3596 + html-whitespace-sensitive-tag-names@3.0.1: {} 3485 3597 3486 3598 ignore@5.3.2: {} 3487 3599 ··· 4209 4321 es-errors: 1.3.0 4210 4322 set-function-name: 2.0.2 4211 4323 4324 + rehype-format@5.0.1: 4325 + dependencies: 4326 + '@types/hast': 3.0.4 4327 + hast-util-format: 1.1.0 4328 + 4212 4329 rehype-sanitize@6.0.0: 4213 4330 dependencies: 4214 4331 '@types/hast': 3.0.4 4215 4332 hast-util-sanitize: 5.0.1 4333 + 4334 + rehype-stringify@10.0.1: 4335 + dependencies: 4336 + '@types/hast': 3.0.4 4337 + hast-util-to-html: 9.0.3 4338 + unified: 11.0.5 4216 4339 4217 4340 remark-parse@11.0.0: 4218 4341 dependencies:
+12 -1
src/app/rss/route.ts
··· 1 + import rehypeFormat from "rehype-format"; 2 + import rehypeStringify from "rehype-stringify"; 3 + import remarkParse from "remark-parse"; 4 + import remarkRehype from "remark-rehype"; 1 5 import RSS from "rss"; 6 + import { unified } from "unified"; 2 7 3 8 import { getPosts } from "#/lib/api"; 4 9 ··· 18 23 for (const post of posts) { 19 24 rss.item({ 20 25 title: post.value.title ?? "Untitled", 21 - description: post.value.content, 26 + description: await unified() 27 + .use(remarkParse) 28 + .use(remarkRehype) 29 + .use(rehypeFormat) 30 + .use(rehypeStringify) 31 + .process(post.value.content) 32 + .then((v) => v.toString()), 22 33 url: `https://mozzius.dev/post/${post.uri.split("/").pop()}`, 23 34 date: new Date(post.value.createdAt ?? Date.now()), 24 35 });