Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09ed207ab6 | ||
|
|
f3f90df38e | ||
|
|
dfe2436718 | ||
|
|
120d6b6941 | ||
|
|
b4440c8cc9 | ||
|
|
da9024548d | ||
|
|
bb923a69e7 | ||
|
|
faaf082c8b | ||
|
|
79c9398981 | ||
|
|
bc785a0077 | ||
|
|
1a5bc59a99 | ||
|
|
f4f9092fe8 | ||
|
|
3e85246344 | ||
|
|
740c584378 | ||
|
|
376f8099b9 | ||
|
|
c8789bc39e | ||
|
|
db3c56cfd8 |
@@ -1,15 +1,36 @@
|
|||||||
|
:root {
|
||||||
|
--primary-color: #272736;
|
||||||
|
--text-color: #ffffeb;
|
||||||
|
|
||||||
|
/* Overriding DP DS */
|
||||||
|
--body-background: var(--primary-color);
|
||||||
|
--body-color: var(--text-color);
|
||||||
|
|
||||||
|
--nav-color: var(--primary-color);
|
||||||
|
--nav-background: var(--text-color);
|
||||||
|
|
||||||
|
--a-color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
nav {
|
nav {
|
||||||
border-bottom-left-radius: 5px;
|
border-bottom-left-radius: 5px;
|
||||||
border-bottom-right-radius: 5px;
|
border-bottom-right-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.question {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) {
|
||||||
|
:root {
|
||||||
|
--primary-color: #ffffeb;
|
||||||
|
--text-color: #272736;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 420px) {
|
@media (max-width: 420px) {
|
||||||
#app {
|
#app {
|
||||||
margin-left: 0vw;
|
margin-left: 0vw;
|
||||||
margin-right: 0vw;
|
margin-right: 0vw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.question {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
:root {
|
|
||||||
--primary-color: #272736;
|
|
||||||
--text-color: #ffffeb;
|
|
||||||
|
|
||||||
/* Overriding DP DS */
|
|
||||||
--body-background: var(--primary-color);
|
|
||||||
--body-color: var(--text-color);
|
|
||||||
|
|
||||||
--nav-color: var(--primary-color);
|
|
||||||
--nav-background: var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: light) {
|
|
||||||
:root {
|
|
||||||
--primary-color: #ffffeb;
|
|
||||||
--text-color: #272736;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,19 +2,23 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Raymon's personal website about his life and projects with a blog.">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Raymon Zutekouw</title>
|
<title>Raymon Zutekouw</title>
|
||||||
|
|
||||||
|
<link rel="preload" href="./lib/me.mjs" as="script" crossorigin="anonymous" type="application/javascript">
|
||||||
|
<link rel="preload" href="index.mjs" as="script" crossorigin="anonymous" type="application/javascript">
|
||||||
|
<link rel="dns-prefetch" href="https://cdn.statically.io">
|
||||||
|
|
||||||
<link defer
|
<link defer
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="https://cdn.statically.io/gh/dragonprojects/dragondesign/master/main.min.css"
|
href="https://cdn.statically.io/gh/dragonprojects/dragondesign/master/main.min.css"
|
||||||
media="all"
|
media="all"
|
||||||
>
|
>
|
||||||
<link defer rel="stylesheet" href="css/themes.css" media="all">
|
|
||||||
<link defer rel="stylesheet" href="css/general.css" media="all">
|
<link defer rel="stylesheet" href="css/general.css" media="all">
|
||||||
|
|
||||||
<script defer type="module" src="index.mjs"></script>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
@@ -45,5 +49,6 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script async type="module" src="index.mjs"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -2,19 +2,22 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Raymon typing nonsense on his blog">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Raymon Zutekouw</title>
|
<title>Raymon Zutekouw</title>
|
||||||
|
|
||||||
|
<link rel="preload" href="./lib/remote.mjs" as="script" crossorigin="anonymous" type="application/javascript">
|
||||||
|
<link rel="preload" href="posts.mjs" as="script" crossorigin="anonymous" type="application/javascript">
|
||||||
|
|
||||||
<link defer
|
<link defer
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="https://cdn.statically.io/gh/dragonprojects/dragondesign/master/main.min.css"
|
href="https://cdn.statically.io/gh/dragonprojects/dragondesign/master/main.min.css"
|
||||||
media="all"
|
media="all"
|
||||||
>
|
>
|
||||||
<link defer rel="stylesheet" href="css/themes.css" media="all">
|
|
||||||
<link defer rel="stylesheet" href="css/general.css" media="all">
|
<link defer rel="stylesheet" href="css/general.css" media="all">
|
||||||
|
|
||||||
<script defer type="module" src="posts.mjs"></script>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
@@ -30,8 +33,10 @@
|
|||||||
<a href="/qa">QA</a>
|
<a href="/qa">QA</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<h3>For those using a RSS reader, subscribe here: <a href="/api/posts/rss.xml">rss.xml</a></h3>
|
||||||
<!-- Placeholder for posts -->
|
<!-- Placeholder for posts -->
|
||||||
<div id="posts"></div>
|
<div id="posts"></div>
|
||||||
|
<script async type="module" src="posts.mjs"></script>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ async function showPost(id) {
|
|||||||
|
|
||||||
post.content.split('\n').forEach(paragraph => {
|
post.content.split('\n').forEach(paragraph => {
|
||||||
const p = document.createElement("p")
|
const p = document.createElement("p")
|
||||||
p.textContent = paragraph
|
p.innerHTML = paragraph
|
||||||
postsDOM.appendChild(p)
|
postsDOM.appendChild(p)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Raymon answering common questions">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Raymon Zutekouw</title>
|
<title>Raymon Zutekouw</title>
|
||||||
|
|
||||||
@@ -10,7 +13,6 @@
|
|||||||
href="https://cdn.statically.io/gh/dragonprojects/dragondesign/master/main.min.css"
|
href="https://cdn.statically.io/gh/dragonprojects/dragondesign/master/main.min.css"
|
||||||
media="all"
|
media="all"
|
||||||
>
|
>
|
||||||
<link defer rel="stylesheet" href="css/themes.css" media="all">
|
|
||||||
<link defer rel="stylesheet" href="css/general.css" media="all">
|
<link defer rel="stylesheet" href="css/general.css" media="all">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Executable
+1
@@ -0,0 +1 @@
|
|||||||
|
User-agent: *
|
||||||
Generated
+28
-28
@@ -37,9 +37,9 @@
|
|||||||
"integrity": "sha512-/oA9z7JszpIioo6J6dB79LVUgJ3eD3cxkAmdCkvWWS+Y9tPtALs1rLqOekLUXUbYqM2fB9TTK0ibAyZJJOP/CA=="
|
"integrity": "sha512-/oA9z7JszpIioo6J6dB79LVUgJ3eD3cxkAmdCkvWWS+Y9tPtALs1rLqOekLUXUbYqM2fB9TTK0ibAyZJJOP/CA=="
|
||||||
},
|
},
|
||||||
"ajv": {
|
"ajv": {
|
||||||
"version": "6.12.2",
|
"version": "6.12.3",
|
||||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz",
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz",
|
||||||
"integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==",
|
"integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"fast-deep-equal": "^3.1.1",
|
"fast-deep-equal": "^3.1.1",
|
||||||
"fast-json-stable-stringify": "^2.0.0",
|
"fast-json-stable-stringify": "^2.0.0",
|
||||||
@@ -106,9 +106,9 @@
|
|||||||
"integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ=="
|
"integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ=="
|
||||||
},
|
},
|
||||||
"avvio": {
|
"avvio": {
|
||||||
"version": "6.4.1",
|
"version": "6.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/avvio/-/avvio-6.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/avvio/-/avvio-6.5.0.tgz",
|
||||||
"integrity": "sha512-jeZaUK+F7MuWSNT3VHfltskPJZKqVeTWQqBA4SDaDoLaQ0lb5TOgLeQT1BEuhTIUNISCDCGY3zjYyVmQQ48gKA==",
|
"integrity": "sha512-BmzcZ7gFpyFJsW8G+tfQw8vJNUboA9SDkkHLZ9RAALhvw/rplfWwni8Ee1rA11zj/J7/E5EvZmweusVvTHjWCA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"archy": "^1.0.0",
|
"archy": "^1.0.0",
|
||||||
"debug": "^4.0.0",
|
"debug": "^4.0.0",
|
||||||
@@ -386,9 +386,9 @@
|
|||||||
"integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg=="
|
"integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg=="
|
||||||
},
|
},
|
||||||
"fast-deep-equal": {
|
"fast-deep-equal": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||||
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA=="
|
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
|
||||||
},
|
},
|
||||||
"fast-json-stable-stringify": {
|
"fast-json-stable-stringify": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
@@ -396,9 +396,9 @@
|
|||||||
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
|
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
|
||||||
},
|
},
|
||||||
"fast-json-stringify": {
|
"fast-json-stringify": {
|
||||||
"version": "1.20.1",
|
"version": "1.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-1.20.1.tgz",
|
"resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-1.21.0.tgz",
|
||||||
"integrity": "sha512-PEPWrRZvKqI11fY2uDhLLuoapIda9wVQ2mzAj8rkBfVD7jWvOSIICL0Om1knoReIWKF5y/5bbR/GzcZANaaJfQ==",
|
"integrity": "sha512-xY6gyjmHN3AK1Y15BCbMpeO9+dea5ePVsp3BouHCdukcx0hOHbXwFhRodhcI0NpZIgDChSeAKkHW9YjKvhwKBA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"ajv": "^6.11.0",
|
"ajv": "^6.11.0",
|
||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
@@ -416,13 +416,13 @@
|
|||||||
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
|
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
|
||||||
},
|
},
|
||||||
"fastify": {
|
"fastify": {
|
||||||
"version": "2.14.1",
|
"version": "2.15.1",
|
||||||
"resolved": "https://registry.npmjs.org/fastify/-/fastify-2.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/fastify/-/fastify-2.15.1.tgz",
|
||||||
"integrity": "sha512-nSL8AgIdFCpZmFwjqB5Zzv+3/1KpwwVtB/h88Q4Og8njYbkddKGpuQlQ2tHUULXPTJrLZ7wop6olzx6HEbHdpw==",
|
"integrity": "sha512-pEE1pa5j/vtZeZTbPpFgsJgzLbThcYgiLDw2yZIG8qNZ5LkF1Ew2vbv9k3nTXNxGEPYFBbyNTCKRSj3JbX+FhA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"abstract-logging": "^2.0.0",
|
"abstract-logging": "^2.0.0",
|
||||||
"ajv": "^6.12.0",
|
"ajv": "^6.12.0",
|
||||||
"avvio": "^6.3.1",
|
"avvio": "^6.4.1",
|
||||||
"fast-json-stringify": "^1.18.0",
|
"fast-json-stringify": "^1.18.0",
|
||||||
"find-my-way": "^2.2.2",
|
"find-my-way": "^2.2.2",
|
||||||
"flatstr": "^1.0.12",
|
"flatstr": "^1.0.12",
|
||||||
@@ -471,9 +471,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"find-my-way": {
|
"find-my-way": {
|
||||||
"version": "2.2.2",
|
"version": "2.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-2.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-2.2.3.tgz",
|
||||||
"integrity": "sha512-zk3eOsS1tABNQjII0vCbhkqgsX/COpRUxl0b5rlA41V2Ft7jWDr30LhYq4BZXLAlzw5yskg24XQG/U1wCT30vQ==",
|
"integrity": "sha512-C7dxfbX8pV1maLd31ygkBEOaD51Ls4dROuHjeSQZf1FeQinUzq3UA/kSPecLSDy9iAQufd8w1zgp7j64kyLdhw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"fast-decode-uri-component": "^1.0.0",
|
"fast-decode-uri-component": "^1.0.0",
|
||||||
"safe-regex2": "^2.0.0",
|
"safe-regex2": "^2.0.0",
|
||||||
@@ -1049,9 +1049,9 @@
|
|||||||
"integrity": "sha512-TcZvGMMy9vodEFSse30lWinkj+JgOBvPn8wRItpQRSayhc+4ssDs335uklkfvQQJgL/WvmHLVj4Ycv2s7QCQMg=="
|
"integrity": "sha512-TcZvGMMy9vodEFSse30lWinkj+JgOBvPn8wRItpQRSayhc+4ssDs335uklkfvQQJgL/WvmHLVj4Ycv2s7QCQMg=="
|
||||||
},
|
},
|
||||||
"set-cookie-parser": {
|
"set-cookie-parser": {
|
||||||
"version": "2.4.5",
|
"version": "2.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.4.6.tgz",
|
||||||
"integrity": "sha512-LkSDwseogN5l6TerqGzFzL9mUDTxSq3hX2b5AaynjC1nSCNWiDypEgHatfc0v6KcnfgV3/6F6h4ABh6igjzlQQ=="
|
"integrity": "sha512-mNCnTUF0OYPwYzSHbdRdCfNNHqrne+HS5tS5xNb6yJbdP9wInV0q5xPLE0EyfV/Q3tImo3y/OXpD8Jn0Jtnjrg=="
|
||||||
},
|
},
|
||||||
"signal-exit": {
|
"signal-exit": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
@@ -1069,9 +1069,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"string-similarity": {
|
"string-similarity": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.2.tgz",
|
||||||
"integrity": "sha512-v36MJzloekKVvKAsYi6O/qpn2mIuvwEFIT9Gx3yg4spkNjXYsk7yxc37g4ZTyMVIBvt/9PZGxnqEtme8XHK+Mw=="
|
"integrity": "sha512-eCsPPyoQBgY4TMpVD6DVfO7pLrimUONriaO4Xjp3WPUW0YnNLqdHgRj23xotLlqrL90eJhBeq3zdAJf2mQgfBQ=="
|
||||||
},
|
},
|
||||||
"string-width": {
|
"string-width": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
@@ -1152,9 +1152,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"tiny-lru": {
|
"tiny-lru": {
|
||||||
"version": "7.0.2",
|
"version": "7.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-7.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-7.0.6.tgz",
|
||||||
"integrity": "sha512-cmc9OOwmnAJtyFBYaznKR3abypEhWecarFrvS5db6qwSgoaDUWV0JX+mdh6B9wN60Wux3+gE1vjzxkoqxFBjqw=="
|
"integrity": "sha512-zNYO0Kvgn5rXzWpL0y3RS09sMK67eGaQj9805jlK9G6pSadfriTczzLHFXa/xcW4mIRfmlB9HyQ/+SgL0V1uow=="
|
||||||
},
|
},
|
||||||
"to-readable-stream": {
|
"to-readable-stream": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@
|
|||||||
"author": "Raymonzut",
|
"author": "Raymonzut",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fastify": "^2.14.1",
|
"fastify": "^2.15.1",
|
||||||
"fastify-cors": "^3.0.3"
|
"fastify-cors": "^3.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
+19
-12
@@ -56,9 +56,9 @@ routes.set('/:id', async (req, res) => {
|
|||||||
else res.send(results[0])
|
else res.send(results[0])
|
||||||
})
|
})
|
||||||
|
|
||||||
// For the sitemap.xml, will be listed in the XML Sitemap Index
|
// Dynamic RSS feed
|
||||||
routes.set('/urls', async (req, res) => {
|
routes.set('/rss.xml', async (req, res) => {
|
||||||
const re = /(\/api\/)?(.*)\/urls/g
|
const re = /(\/api\/)?(.*)\/rss/g
|
||||||
const result = [...req.raw.originalUrl.matchAll(re)]
|
const result = [...req.raw.originalUrl.matchAll(re)]
|
||||||
if (!result) {
|
if (!result) {
|
||||||
notFoundResponse(res)
|
notFoundResponse(res)
|
||||||
@@ -68,16 +68,23 @@ routes.set('/urls', async (req, res) => {
|
|||||||
const endpoint = result [1] ? result[1][2] : result[0][2]
|
const endpoint = result [1] ? result[1][2] : result[0][2]
|
||||||
// Assumes https
|
// Assumes https
|
||||||
const BASE_URL = 'https://' + req.raw.hostname + endpoint
|
const BASE_URL = 'https://' + req.raw.hostname + endpoint
|
||||||
const urls = posts.map(post =>
|
const ITEMS = posts.map(post =>
|
||||||
`\n <url>
|
`\r\n <item>
|
||||||
<loc>${BASE_URL}/${post._id}</loc>
|
<title>${post.title}</title>
|
||||||
<lastmod>${post.date}</lastmod>
|
<link>https://${req.raw.hostname}/posts?post=${post._id}</link>
|
||||||
<changefreq>never</changefreq>
|
<guid>https://${req.raw.hostname}/posts?post=${post._id}</guid>
|
||||||
<priority>0.9</priority>
|
<description>${post.content}</description>
|
||||||
</url>`
|
</item>`
|
||||||
).join("\n")
|
).join("\n")
|
||||||
const xml = `<?xml version="1.0" encoding="UTF-8"?>\r<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
const xml = `<?xml version="1.0" encoding="UTF-8" ?>\n<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
${urls}\n\r</urlset>`
|
<channel>
|
||||||
|
<atom:link href="https://${req.raw.hostname}/api/posts/rss.xml" rel="self" type="application/rss+xml" />
|
||||||
|
<title>Posts</title>
|
||||||
|
<link>https://${req.raw.hostname}</link>
|
||||||
|
<description>Personal blog</description>
|
||||||
|
<language>en-us</language>
|
||||||
|
${ITEMS}
|
||||||
|
</channel>\n</rss>`
|
||||||
|
|
||||||
res.header('Content-Type', 'application/xml')
|
res.header('Content-Type', 'application/xml')
|
||||||
res.status(200).send(xml)
|
res.status(200).send(xml)
|
||||||
|
|||||||
Reference in New Issue
Block a user