feat: hide blog posts

This commit is contained in:
Alexander Daichendt 2022-07-26 13:15:10 +02:00
parent 94ca2a8a2a
commit c891a924cd
6 changed files with 49 additions and 6 deletions

View file

@ -2,7 +2,7 @@
const year = new Date().getFullYear();
</script>
<script>
<script lang="ts">
import ThemeSwitcher from '../components/ThemeSwitcher.svelte';
import { page } from '$app/stores';
import { mdiCopyright } from '@mdi/js';
@ -12,6 +12,7 @@
import MoveUpButton from '../components/MoveUpButton.svelte';
const NAV_ITEMS = [
{ href: '/', label: 'Home' },
{ href: '/blog', label: 'Blog' },
{ href: '/contact', label: 'Contact' },
];
@ -19,8 +20,13 @@
<svelte:head
><title>{$page.stuff.title} - AlexDaichendt</title>
{#if $page.stuff.description}
<meta name="description" content={$page.stuff.description} />
{/if}
<meta name="author" content="Alexander Daichendt" />
{#if $page.stuff.keywords}
<meta name="keywords" content={$page.stuff.keywords.join(',')} />
{/if}
</svelte:head>
<div class="container upper">
@ -35,7 +41,12 @@
<nav>
<ol>
{#each NAV_ITEMS as navItem}
<li class="navItem {$page.url.pathname.includes(navItem.href) ? 'active' : ''}">
<li
class="navItem {$page.url.pathname === navItem.href ||
(navItem.href === '/blog' && $page.url.pathname.includes('/blog'))
? 'active'
: ''}"
>
<a href={navItem.href}>{navItem.label}</a>
</li>
{/each}

View file

@ -0,0 +1 @@
<h1>Administration Area</h1>

View file

@ -10,10 +10,12 @@ export async function GET() {
resolved.forEach(({ metadata }, index) => {
const path = Object.keys(modules)[index].replace('.svx', '');
posts.push({ ...metadata, href: `blog/${path}` });
if (!metadata.hidden) posts.push({ ...metadata, href: `blog/${path}` });
});
posts.sort((a, b) => new Date(b.date).valueOf() - new Date(a.date).valueOf());
return {
body: { posts }
body: { posts },
};
}

View file

@ -1,5 +1,5 @@
---
date: '22-05-08'
date: '2022-05-08'
title: 'Arrow OS on Redmi Note 7'
description: 'Learn how to install ArrowOS, based on Android 12 on your Redmi Note 7 (lavender) phone! Also installs root and microG for a BigTech free phone.'
keywords:

View file

@ -0,0 +1,26 @@
---
date: '2022-07-26'
title: 'Software recommendations for a privacy conscious digital life'
description: ''
keywords:
- privacy
hidden: true
---
<script context="module" lang="ts">
export async function load() {
return {
stuff: {
title,
description,
keywords,
},
};
}
</script>
# Useful software I like
Moving away from BigTech is not an easy task. However, in these days, there are plenty polished
alternatives out there. Over the years I tried out many different services and software. I will
formulate some of my opinions here.

View file

@ -1,6 +1,9 @@
export interface BlogPostFrontmatter {
date: string;
title: string;
description: string;
keywords: string[];
hidden: boolean;
}
export interface BlogPostMeta extends BlogPostFrontmatter {