Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89e22861af | ||
|
|
3d93b6ddb8 | ||
|
|
418fc1fad4 | ||
|
|
7f0d95b870 | ||
|
|
a8736826bf | ||
|
|
1a76d0d426 | ||
|
|
09a5a7438c | ||
|
|
f948e833e9 | ||
|
|
494f5b5c07 | ||
|
|
760677ce90 | ||
|
|
ffe62b6380 | ||
|
|
dd4e2ca9fb | ||
|
|
aab9885242 | ||
|
|
d8b038dc9c | ||
|
|
43d28f7f6b | ||
|
|
4324e569ca | ||
|
|
56fffda0fe | ||
|
|
9fdbd1b6a1 |
@@ -0,0 +1,3 @@
|
|||||||
|
* text=auto
|
||||||
|
eol=lf
|
||||||
|
|
||||||
Generated
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "personal-website",
|
"name": "personal-website",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -12874,9 +12874,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"websocket-extensions": {
|
"websocket-extensions": {
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz",
|
||||||
"integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==",
|
"integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"which": {
|
"which": {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "personal-website",
|
"name": "personal-website",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "A nice introduction to my chaos",
|
"description": "A nice introduction to my chaos",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
|
|||||||
@@ -6,6 +6,14 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE-edge">
|
<meta http-equiv="X-UA-Compatible" content="IE-edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Personal Website</title>
|
<title>Personal Website</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body, html {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
+62
-3
@@ -1,10 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app" :class="theme">
|
||||||
<div id="nav">
|
<div id="nav">
|
||||||
<router-link to="/">Home</router-link> |
|
<router-link to="/">Home</router-link> |
|
||||||
<router-link to="/posts">Posts</router-link> |
|
<router-link to="/posts">Posts</router-link> |
|
||||||
<router-link to="/qa">QA</router-link>
|
<router-link to="/qa">QA</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<button id="toggleThemeButton" @click="toggleTheme">{{ themeToggleVerb }} my eyes</button>
|
||||||
|
</div>
|
||||||
<router-view />
|
<router-view />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -13,16 +16,72 @@
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
theme: 'dark'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
themeToggleVerb: function() {
|
||||||
|
return this.theme === 'light' ? "Save" : "Hurt"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
toggleTheme() {
|
||||||
|
const themes = ['light', 'dark']
|
||||||
|
this.theme = themes[(themes.indexOf(this.theme) + 1) % themes.length]
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
.light {
|
||||||
|
--primary-color: #ffffeb;
|
||||||
|
--text-color: #272736;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark {
|
||||||
|
--primary-color: #272736;
|
||||||
|
--text-color: #ffffeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark a {
|
||||||
|
color: #7e7e8f;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #2c3e50;
|
color: var(--text-color);
|
||||||
margin-top: 60px;
|
padding-top: 60px;
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#toggleThemeButton {
|
||||||
|
background: var(--primary-color);
|
||||||
|
border: 0px;
|
||||||
|
color: var(--text-color);
|
||||||
|
margin: 0 auto;
|
||||||
|
|
||||||
|
margin-right: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width:420px) {
|
||||||
|
#toggleThemeButton {
|
||||||
|
float:right;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,15 @@
|
|||||||
<p>
|
<p>
|
||||||
Hi there, good to see you on my website.
|
Hi there, good to see you on my website.
|
||||||
My name is Raymon Zutekouw({{ age }}).
|
My name is Raymon Zutekouw({{ age }}).
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
Building software and exploring the wide variety of tools (or making them) is my passion.
|
Building software and exploring the wide variety of tools (or making them) is my passion.
|
||||||
To see it in action, checkout the stuff I make on
|
To see it in action, checkout the stuff I make on
|
||||||
<a href='https://github.com/Raymonzut'>GitHub</a>.
|
<a href='https://github.com/Raymonzut'>GitHub</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
The projects that may be useful to others are open source; for inspiring others and improving each others work.
|
The projects that may be useful to others are open source; for inspiring others and improving each others work.
|
||||||
That is why I am a huge fan of
|
That is why I am a huge fan of
|
||||||
<a href='https://www.gnu.org/philosophy/free-sw.en.html'>free software</a>.
|
<a href='https://www.gnu.org/philosophy/free-sw.en.html'>free software</a>.
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"description": "The API for the website",
|
"description": "The API for the website",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -37,7 +37,10 @@ routes.set('', async (req, res) => {
|
|||||||
|
|
||||||
if (req.query.sort === '1') res.send(posts_sorted)
|
if (req.query.sort === '1') res.send(posts_sorted)
|
||||||
else res.send(posts_sorted.reverse())
|
else res.send(posts_sorted.reverse())
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
// Default response when there are no interesting queries
|
||||||
|
res.send(posts)
|
||||||
})
|
})
|
||||||
|
|
||||||
routes.set('/:id', async (req, res) => {
|
routes.set('/:id', async (req, res) => {
|
||||||
@@ -53,4 +56,31 @@ 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
|
||||||
|
routes.set('/urls', async (req, res) => {
|
||||||
|
const re = /(\/api\/)?(.*)\/urls/g
|
||||||
|
const result = [...req.raw.originalUrl.matchAll(re)]
|
||||||
|
if (!result) {
|
||||||
|
notFoundResponse(res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const endpoint = result [1] ? result[1][2] : result[0][2]
|
||||||
|
// Assumes https
|
||||||
|
const BASE_URL = 'https://' + req.raw.hostname + endpoint
|
||||||
|
const urls = posts.map(post =>
|
||||||
|
`\n <url>
|
||||||
|
<loc>${BASE_URL}/${post._id}</loc>
|
||||||
|
<lastmod>${post.date}</lastmod>
|
||||||
|
<changefreq>never</changefreq>
|
||||||
|
<priority>0.9</priority>
|
||||||
|
</url>`
|
||||||
|
).join("\n")
|
||||||
|
const xml = `<?xml version="1.0" encoding="UTF-8"?>\r<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
${urls}\n\r</urlset>`
|
||||||
|
|
||||||
|
res.header('Content-Type', 'application/xml')
|
||||||
|
res.status(200).send(xml)
|
||||||
|
})
|
||||||
|
|
||||||
module.exports = routes
|
module.exports = routes
|
||||||
|
|||||||
Reference in New Issue
Block a user