Merge branch 'beta' into 'master'
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
* text=auto
|
||||
eol=lf
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "personal-website",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "personal-website",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"private": true,
|
||||
"description": "A nice introduction to my chaos",
|
||||
"main": "src/main.js",
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE-edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Personal Website</title>
|
||||
|
||||
<style>
|
||||
body, html {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
+63
-4
@@ -1,28 +1,87 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<div id="app" :class="theme">
|
||||
<div id="nav">
|
||||
<router-link to="/">Home</router-link> |
|
||||
<router-link to="/posts">Posts</router-link> |
|
||||
<router-link to="/qa">QA</router-link>
|
||||
</div>
|
||||
<router-view />
|
||||
<div>
|
||||
<button id="toggleThemeButton" @click="toggleTheme">{{ themeToggleVerb }} my eyes</button>
|
||||
</div>
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
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>
|
||||
|
||||
<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 {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
margin-top: 60px;
|
||||
color: var(--text-color);
|
||||
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>
|
||||
|
||||
|
||||
@@ -4,9 +4,15 @@
|
||||
<p>
|
||||
Hi there, good to see you on my website.
|
||||
My name is Raymon Zutekouw({{ age }}).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
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
|
||||
<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.
|
||||
That is why I am a huge fan of
|
||||
<a href='https://www.gnu.org/philosophy/free-sw.en.html'>free software</a>.
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "server",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "server",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"description": "The API for the website",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -37,7 +37,10 @@ routes.set('', async (req, res) => {
|
||||
|
||||
if (req.query.sort === '1') res.send(posts_sorted)
|
||||
else res.send(posts_sorted.reverse())
|
||||
return
|
||||
}
|
||||
// Default response when there are no interesting queries
|
||||
res.send(posts)
|
||||
})
|
||||
|
||||
routes.set('/:id', async (req, res) => {
|
||||
@@ -53,4 +56,29 @@ routes.set('/:id', async (req, res) => {
|
||||
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.send(xml)
|
||||
})
|
||||
|
||||
module.exports = routes
|
||||
|
||||
Reference in New Issue
Block a user