Introduce segments for blog posts and filter them

This commit is contained in:
Michal Vanko 2023-02-15 22:40:37 +01:00
parent f156d4dacc
commit dac3e13520
33 changed files with 84 additions and 11 deletions

View File

@ -1,6 +1,8 @@
---
layout: blog
title: How I've built my website
segments:
- blog
published: true
date: 2020-02-28T16:00:55.791Z
thumbnail: /images/uploads/DSC01202.jpg

View File

@ -1,6 +1,8 @@
---
layout: blog
title: Custom Redox keyboard assembly
segments:
- blog
published: true
date: 2020-04-10T15:16:54.820Z
thumbnail: /images/uploads/img_20200301_171735.jpg

View File

@ -1,6 +1,8 @@
---
layout: blog
title: Transition to Colemak keyboard layout
segments:
- blog
published: true
date: 2020-05-11T05:38:18.797Z
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: Samsung Galaxy Buds+ Review
segments:
- blog
published: true
date: 2020-06-07T22:58:18.797Z # TODO executable line for generating date
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: I've made an RSS feed
segments:
- blog
published: true
date: 2020-06-15T15:48:18.797Z # TODO executable line for generating date
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: WebAssembly briefing
segments:
- blog
published: true
date: 2020-08-05T15:38:18.797Z # TODO executable line for generating date
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: How to deal with technical debt
segments:
- blog
published: true
date: 2020-11-08T15:57:18.797Z
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: I've moved my site to Netlify
segments:
- blog
published: true
date: 2020-11-20T20:35:05.230Z
tags:
@ -38,4 +40,4 @@ I haven't found a big decider feature in any of these so I just went with the on
I was able to **configure whole deployment** of my website **in 8 minutes**.
The instructions where so clear and simple that I've also **transfered my DNS nameserver** too. I didn't have to search in 10 different services and documentations. I've just went with the flow. Didn't had to change a single line of code. I've just removed the `amplify` folder and I don't want to see any of the AWS docs ever again.
It got me so pumped that I've immediately logged in to the CMS (finally) through my own domain and written this article.
It got me so pumped that I've immediately logged in to the CMS (finally) through my own domain and written this article.

View File

@ -1,6 +1,8 @@
---
layout: blog
title: Guide on error handling
segments:
- blog
published: true
date: 2020-12-09T14:44:11.948Z
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: Logging recommendations
segments:
- blog
published: true
date: 2020-12-18T14:39:53.533Z
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: Podcast episode about Agile development
segments:
- blog
published: true
date: 2021-02-16T09:09:57.102Z
tags:
@ -14,4 +16,4 @@ I have to admit, it was a wonderful experience and I've enjoyed it. I'd like to
The episode was **recorded in Slovak** language. You can **listen to the podcast episode here**:
<iframe src="https://open.spotify.com/embed-podcast/episode/0NE6Gakn6wUP6oj7Rq4viR" width="100%" height="232" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe>
<iframe src="https://open.spotify.com/embed-podcast/episode/0NE6Gakn6wUP6oj7Rq4viR" width="100%" height="232" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe>

View File

@ -1,6 +1,8 @@
---
layout: blog
title: Introduction to JavaScript Application testing
segments:
- blog
published: true
date: 2021-05-07T14:44:57.102Z # update date accordingly
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: How we handle the rapid growth of the project team
segments:
- blog
published: true
date: 2021-12-16T11:02:10.123Z
tags:
@ -8,4 +10,4 @@ tags:
- Interviews
- Management
---
I've been interviewed by my friend [@zubkka](https://www.instagram.com/zubkka/) about my current position at _The Expert_ team as an Engineering Manager. We have talked about my journey at [sudolabs](https://sudolabs.com) but also about my early years and how I've got into programming. Please, [go check out the interview](https://sudolabs.com/blog/how-we-handle-the-rapid-growth-of-the-project-team) and let me know what you think. Happy reading!
I've been interviewed by my friend [@zubkka](https://www.instagram.com/zubkka/) about my current position at _The Expert_ team as an Engineering Manager. We have talked about my journey at [sudolabs](https://sudolabs.com) but also about my early years and how I've got into programming. Please, [go check out the interview](https://sudolabs.com/blog/how-we-handle-the-rapid-growth-of-the-project-team) and let me know what you think. Happy reading!

View File

@ -1,6 +1,8 @@
---
layout: blog
title: First Weekly
segments:
- blog
published: true
date: 2022-02-06T17:13:02.611Z
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: "I've started streaming - Weekly #06-2022 "
segments:
- blog
published: true
date: 2022-02-13T19:39:33.578Z
tags:
@ -42,4 +44,4 @@ My next pick will be a [podcast *Lifespan* hosted by Dr. David Sinclair](https:/
In our management course, we've been learning about different **person typologies**. That helped me to understand how I should treat other people and how to communicate better with them.
That's it for this week. Thank you very much!
That's it for this week. Thank you very much!

View File

@ -1,6 +1,8 @@
---
layout: blog
title: "Laptop battery got fat - Weekly #07-2022"
segments:
- blog
published: true
date: 2022-02-20T17:50:56.214Z
tags:
@ -37,4 +39,4 @@ I have to also mention, that I've changed my theme to light [NeoSolarized](https
Github is now able to parse [mermaid diagrams](https://github.com/mermaid-js/mermaid#readme). You can [check out the announcement](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/). It looks like I could be able to do that on my blog as well. I will put this into my to-do list and perhaps code it sometime during my stream ;)
[State of JS](https://2021.stateofjs.com/en-US/) results for 2021 has been presented this week. I am very excited about the satisfaction rate of [@svelte/kit](https://github.com/sveltejs/kit).
[State of JS](https://2021.stateofjs.com/en-US/) results for 2021 has been presented this week. I am very excited about the satisfaction rate of [@svelte/kit](https://github.com/sveltejs/kit).

View File

@ -1,6 +1,8 @@
---
layout: blog
title: Error handling with Either<Type>
segments:
- blog
published: true
date: 2022-02-28T11:30:54.195Z
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: "Second attempt @ Weekly #08-2022"
segments:
- blog
published: true
date: 2022-02-28T11:49:53.914Z
tags:
@ -28,4 +30,4 @@ I was very surprised that the mermaid is directly dependent on the browser to be
I haven't finished it, yet. So **prepare for a new article** where I will present the solution. I will stream it on [my twitch](https://www.twitch.tv/michalvankodev) so if you're interested, **please follow me there**.
Let's keep it short. Thank you!
Let's keep it short. Thank you!

View File

@ -1,6 +1,8 @@
---
layout: blog
title: "Coming from DevBreak - Weekly #11-2022"
segments:
- blog
published: true
date: 2022-03-19T21:22:35.128Z
tags:
@ -24,4 +26,4 @@ During the vacation time, I've stumbled upon a [great article about markdown by
The next one is a simpler tutorial on [Hosting a React App with OpenFaaS](https://www.openfaas.com/blog/react-app/). I am an advocate for open-source software and I am glad to see [OpenFaaS](https://www.openfaas.com) being still developed and trying to be more accessible for typical use-cases.
Be ready for the next one, Thank you!
Be ready for the next one, Thank you!

View File

@ -1,6 +1,8 @@
---
layout: blog
title: "Happy Easter - Weekly #15-2022"
segments:
- blog
published: true
date: 2022-04-17T08:05:05.489Z
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: 'Treasure hunt - Weekly #18-2022'
segments:
- blog
published: true
date: 2022-05-07T08:35:51.818Z
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: "Our attempt at Rusty game jam - Weekly #25-2022"
segments:
- blog
published: true
date: 2022-06-26T20:02:47.419Z
tags:

View File

@ -1,6 +1,8 @@
---
layout: blog
title: Lovely London Trip
segments:
- blog
published: true
date: 2022-11-27T19:49:09.204Z
tags:
@ -40,4 +42,4 @@ And next time we will take a laptop with us so we can watch movies or when we ac
Credits for all pictures go to my wife [Marika](https://www.instagram.com/marika_vnk/). She says Hi!
![Me and my wife on the Queens walk](/images/uploads/image2.jpeg "Me and my wife on the Queens walk")
![Me and my wife on the Queens walk](/images/uploads/image2.jpeg "Me and my wife on the Queens walk")

View File

@ -1,6 +1,10 @@
---
layout: blog
title: dev - Ide to ? copy
segments:
- blog
- broadcasts
- cookbook
published: true
date: 2020-01-09T17:24:13.481Z
thumbnail: /images/uploads/screenshot.gif

View File

@ -1,6 +1,10 @@
---
layout: blog
title: dev - Ide to ?
segments:
- blog
- broadcasts
- cookbook
published: true
date: 2019-08-09T17:24:13.481Z
thumbnail: /images/uploads/screenshot.gif

View File

@ -1,6 +1,10 @@
---
layout: blog
title: dev - Anothert one
segments:
- blog
- broadcasts
- cookbook
published: true
date: 2019-11-03T11:01:32.621Z
thumbnail: /images/uploads/responzio.png

View File

@ -1,6 +1,10 @@
---
layout: blog
title: New Title
segments:
- blog
- broadcasts
- cookbook
published: true
date: 2020-05-11T05:38:18.797Z # TODO executable line for generating date
tags:

View File

@ -52,6 +52,7 @@ export async function getBlogListing(paginationQuery: PaginationQuery) {
}
})
)
console.log(paginationQuery);
const filteredContents = pipe(
sortBy<ArticleContent>(prop('date')),
(items) => reverse(items),

View File

@ -34,6 +34,7 @@ export function filterAndCount<Item extends Record<string, any>>({
...dropTakeParams
}: PaginationQuery) {
return function (items: Item[]) {
console.log(filters);
const filterFunction = filters
? filterByPropContains<Item>(filters)
: identity

View File

@ -8,6 +8,7 @@ import type { RequestHandler } from './$types'
export const prerender = true
export const GET = (async ({ params }) => {
console.log(params);
const handledParams = params.params === 'index' ? '' : params.params
const { page = 1, pageSize = 7, ...filters } = parseParams(handledParams)
const paginationParams = getDropTakeFromPageParams(

View File

@ -6,9 +6,8 @@ import type { PaginationResult } from '$lib/pagination/pagination'
export const load = (async ({ fetch, params }) => {
const { page = 1, pageSize = 7, ...filters } = parseParams(params.params)
const articleResponse = await fetch(
`/articles/${params.params ? params.params : 'index'}.json`
`/articles/segments/blog${params.params ? `/${params.params}` : ''}.json`
).then((r) => r.json())
return {
posts: articleResponse.posts as PaginationResult<ArticleContent>,
page: Number(page),

View File

@ -6,7 +6,7 @@ import type { PaginationResult } from '$lib/pagination/pagination'
export const load = (async ({ fetch, params }) => {
const { page = 1, pageSize = 7, ...filters } = parseParams(params.params)
const articleResponse = await fetch(
`/articles/${params.params ? params.params : 'index'}.json`
`/articles/segments/broadcasts${params.params ? `/${params.params}` : ''}.json`
).then((r) => r.json())
return {

View File

@ -19,6 +19,15 @@ collections:
fields: # The fields for each document, usually in front matter
- { label: 'Layout', name: 'layout', widget: 'hidden', default: 'blog' }
- { label: 'Title', name: 'title', widget: 'string' }
- label: 'Segments'
name: 'segments'
widget: 'select'
multiple: true
options:
- { label: 'Blog', value: 'blog' }
- { label: 'Broadcasts', value: 'Broadcasts' }
- { label: 'Cookbook', value: 'cookbook' }
default: ['blog']
- {
label: 'Published',
name: 'published',