diff --git a/.nvmrc b/.nvmrc index dac255d..b009dfb 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16.15.1 +lts/* diff --git a/_posts/blog/2020-02-28-how-ive-built-my-web-site.md b/_posts/blog/2020-02-28-how-ive-built-my-web-site.md index 3a1c0c6..4d3ef62 100644 --- a/_posts/blog/2020-02-28-how-ive-built-my-web-site.md +++ b/_posts/blog/2020-02-28-how-ive-built-my-web-site.md @@ -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 diff --git a/_posts/blog/2020-04-10-custom-redox-keyboard-assembly.md b/_posts/blog/2020-04-10-custom-redox-keyboard-assembly.md index 8353de5..f443add 100644 --- a/_posts/blog/2020-04-10-custom-redox-keyboard-assembly.md +++ b/_posts/blog/2020-04-10-custom-redox-keyboard-assembly.md @@ -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 diff --git a/_posts/blog/2020-05-11-transition-to-colemak-layout.md b/_posts/blog/2020-05-11-transition-to-colemak-layout.md index 0e1f381..13fec46 100644 --- a/_posts/blog/2020-05-11-transition-to-colemak-layout.md +++ b/_posts/blog/2020-05-11-transition-to-colemak-layout.md @@ -1,6 +1,8 @@ --- layout: blog title: Transition to Colemak keyboard layout +segments: + - blog published: true date: 2020-05-11T05:38:18.797Z tags: diff --git a/_posts/blog/2020-06-07-samsung-galaxy-buds-plus-review.md b/_posts/blog/2020-06-07-samsung-galaxy-buds-plus-review.md index fde058a..4d43cb8 100644 --- a/_posts/blog/2020-06-07-samsung-galaxy-buds-plus-review.md +++ b/_posts/blog/2020-06-07-samsung-galaxy-buds-plus-review.md @@ -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: diff --git a/_posts/blog/2020-06-15-ive-made-rss-feed.md b/_posts/blog/2020-06-15-ive-made-rss-feed.md index b99cb18..88f8155 100644 --- a/_posts/blog/2020-06-15-ive-made-rss-feed.md +++ b/_posts/blog/2020-06-15-ive-made-rss-feed.md @@ -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: diff --git a/_posts/blog/2020-08-05-webassembly-briefing.md b/_posts/blog/2020-08-05-webassembly-briefing.md index c6a0b92..b0626fb 100644 --- a/_posts/blog/2020-08-05-webassembly-briefing.md +++ b/_posts/blog/2020-08-05-webassembly-briefing.md @@ -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: diff --git a/_posts/blog/2020-11-08-how-to-deal-with-technical-debt.md b/_posts/blog/2020-11-08-how-to-deal-with-technical-debt.md index 502577d..b9d751d 100644 --- a/_posts/blog/2020-11-08-how-to-deal-with-technical-debt.md +++ b/_posts/blog/2020-11-08-how-to-deal-with-technical-debt.md @@ -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: diff --git a/_posts/blog/2020-11-20-ive-moved-my-site-to-netlify.md b/_posts/blog/2020-11-20-ive-moved-my-site-to-netlify.md index 26412f8..38d42ff 100644 --- a/_posts/blog/2020-11-20-ive-moved-my-site-to-netlify.md +++ b/_posts/blog/2020-11-20-ive-moved-my-site-to-netlify.md @@ -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. \ No newline at end of file +It got me so pumped that I've immediately logged in to the CMS (finally) through my own domain and written this article. diff --git a/_posts/blog/2020-12-09-guide-on-error-handling.md b/_posts/blog/2020-12-09-guide-on-error-handling.md index c7eeeda..fd1a4eb 100644 --- a/_posts/blog/2020-12-09-guide-on-error-handling.md +++ b/_posts/blog/2020-12-09-guide-on-error-handling.md @@ -1,6 +1,8 @@ --- layout: blog title: Guide on error handling +segments: + - blog published: true date: 2020-12-09T14:44:11.948Z tags: diff --git a/_posts/blog/2020-12-18-logging-recommendations.md b/_posts/blog/2020-12-18-logging-recommendations.md index d99aec3..1f6fd21 100644 --- a/_posts/blog/2020-12-18-logging-recommendations.md +++ b/_posts/blog/2020-12-18-logging-recommendations.md @@ -1,6 +1,8 @@ --- layout: blog title: Logging recommendations +segments: + - blog published: true date: 2020-12-18T14:39:53.533Z tags: diff --git a/_posts/blog/2021-02-16-podcast-episode-about-agile-development.md b/_posts/blog/2021-02-16-podcast-episode-about-agile-development.md index 3f42170..d6a3f29 100644 --- a/_posts/blog/2021-02-16-podcast-episode-about-agile-development.md +++ b/_posts/blog/2021-02-16-podcast-episode-about-agile-development.md @@ -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**: - \ No newline at end of file + diff --git a/_posts/blog/2021-05-07-introduction-javascript-to-javascript-application-testing.md b/_posts/blog/2021-05-07-introduction-javascript-to-javascript-application-testing.md index 509b1c5..6adb6c4 100644 --- a/_posts/blog/2021-05-07-introduction-javascript-to-javascript-application-testing.md +++ b/_posts/blog/2021-05-07-introduction-javascript-to-javascript-application-testing.md @@ -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: diff --git a/_posts/blog/2021-12-16-how-we-handle-the-rapid-growth-of-the-project-team.md b/_posts/blog/2021-12-16-how-we-handle-the-rapid-growth-of-the-project-team.md index b6f50ed..c5d579f 100644 --- a/_posts/blog/2021-12-16-how-we-handle-the-rapid-growth-of-the-project-team.md +++ b/_posts/blog/2021-12-16-how-we-handle-the-rapid-growth-of-the-project-team.md @@ -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! \ No newline at end of file +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! diff --git a/_posts/blog/2022-02-06-first-weekly.md b/_posts/blog/2022-02-06-first-weekly.md index eba7b84..11d2597 100644 --- a/_posts/blog/2022-02-06-first-weekly.md +++ b/_posts/blog/2022-02-06-first-weekly.md @@ -1,6 +1,8 @@ --- layout: blog title: First Weekly +segments: + - blog published: true date: 2022-02-06T17:13:02.611Z tags: diff --git a/_posts/blog/2022-02-13-ive-started-streaming-weekly-06-2022.md b/_posts/blog/2022-02-13-ive-started-streaming-weekly-06-2022.md index 2129cd6..ebd6bc1 100644 --- a/_posts/blog/2022-02-13-ive-started-streaming-weekly-06-2022.md +++ b/_posts/blog/2022-02-13-ive-started-streaming-weekly-06-2022.md @@ -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! \ No newline at end of file +That's it for this week. Thank you very much! diff --git a/_posts/blog/2022-02-20-weekly-07-2022.md b/_posts/blog/2022-02-20-weekly-07-2022.md index afdfd6b..318fb16 100644 --- a/_posts/blog/2022-02-20-weekly-07-2022.md +++ b/_posts/blog/2022-02-20-weekly-07-2022.md @@ -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). \ No newline at end of file +[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). diff --git a/_posts/blog/2022-02-28-error-handling-with-either-type.md b/_posts/blog/2022-02-28-error-handling-with-either-type.md index 9ea99a9..91a0f5e 100644 --- a/_posts/blog/2022-02-28-error-handling-with-either-type.md +++ b/_posts/blog/2022-02-28-error-handling-with-either-type.md @@ -1,6 +1,8 @@ --- layout: blog title: Error handling with Either +segments: + - blog published: true date: 2022-02-28T11:30:54.195Z tags: diff --git a/_posts/blog/2022-02-28-second-attempt-weekly-08-2022.md b/_posts/blog/2022-02-28-second-attempt-weekly-08-2022.md index 520ff57..9629cb6 100644 --- a/_posts/blog/2022-02-28-second-attempt-weekly-08-2022.md +++ b/_posts/blog/2022-02-28-second-attempt-weekly-08-2022.md @@ -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! \ No newline at end of file +Let's keep it short. Thank you! diff --git a/_posts/blog/2022-03-15-devbreak-1-state-of-js-2021.md b/_posts/blog/2022-03-15-devbreak-1-state-of-js-2021.md new file mode 100644 index 0000000..a02ece4 --- /dev/null +++ b/_posts/blog/2022-03-15-devbreak-1-state-of-js-2021.md @@ -0,0 +1,18 @@ +--- +layout: blog +title: "DevBreak #1 State of JS 2021 review with Lukáš Orgován" +segments: + - broadcasts +published: true +date: 2022-03-15T20:22:21.191Z +tags: + - DevBreak +--- +The first episode of the [DevBreak talk show](/broadcasts/tags/DevBreak). +I've invited my close friend and a tech lead [Lukáš Orgován](https://www.linkedin.com/in/lukasorgovan/) to talk about the opinions on the results of the [State of JS 2021 survey](https://2021.stateofjs.com/en-us/). + +This episode aired on the 15th of March 2022 and is in the Slovak language. + +
+ +
diff --git a/_posts/blog/2022-03-19-coming-from-devbreak-weekly-11-2022.md b/_posts/blog/2022-03-19-coming-from-devbreak-weekly-11-2022.md index eec6771..26f8cd8 100644 --- a/_posts/blog/2022-03-19-coming-from-devbreak-weekly-11-2022.md +++ b/_posts/blog/2022-03-19-coming-from-devbreak-weekly-11-2022.md @@ -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! \ No newline at end of file +Be ready for the next one, Thank you! diff --git a/_posts/blog/2022-04-17-happy-easter-weekly-15-2022.md b/_posts/blog/2022-04-17-happy-easter-weekly-15-2022.md index c089b73..1eee476 100644 --- a/_posts/blog/2022-04-17-happy-easter-weekly-15-2022.md +++ b/_posts/blog/2022-04-17-happy-easter-weekly-15-2022.md @@ -1,6 +1,8 @@ --- layout: blog title: "Happy Easter - Weekly #15-2022" +segments: + - blog published: true date: 2022-04-17T08:05:05.489Z tags: diff --git a/_posts/blog/2022-04-26-devbreak-2-stories-and-impressions-hack-kosice.md b/_posts/blog/2022-04-26-devbreak-2-stories-and-impressions-hack-kosice.md new file mode 100644 index 0000000..77a2f91 --- /dev/null +++ b/_posts/blog/2022-04-26-devbreak-2-stories-and-impressions-hack-kosice.md @@ -0,0 +1,17 @@ +--- +layout: blog +title: "DevBreak #2 Stories and impressions from Hack Kosice 2022" +segments: + - broadcasts +published: true +date: 2022-04-26T20:22:21.191Z +tags: + - DevBreak +--- + +At the last possible moment, I have been able to invite **Daniela, Samuel, and Filip** over to talk about stories and their impressions of the _Hack Kosice 2022_ event that took place last weekend. +This episode aired on the 26th of April 2022 and is in the Slovak language. + +
+ +
diff --git a/_posts/blog/2022-05-07-treasure-hunt-weekly-18-2022.md b/_posts/blog/2022-05-07-treasure-hunt-weekly-18-2022.md index b84b4d6..f630dd4 100644 --- a/_posts/blog/2022-05-07-treasure-hunt-weekly-18-2022.md +++ b/_posts/blog/2022-05-07-treasure-hunt-weekly-18-2022.md @@ -1,6 +1,8 @@ --- layout: blog title: 'Treasure hunt - Weekly #18-2022' +segments: + - blog published: true date: 2022-05-07T08:35:51.818Z tags: diff --git a/_posts/blog/2022-06-09-devbreak-3-full-stack-development.md b/_posts/blog/2022-06-09-devbreak-3-full-stack-development.md new file mode 100644 index 0000000..6ced5cf --- /dev/null +++ b/_posts/blog/2022-06-09-devbreak-3-full-stack-development.md @@ -0,0 +1,17 @@ +--- +layout: blog +title: "DevBreak #3 Full-stack development with Dominik Štefan" +segments: + - broadcasts +published: true +date: 2022-06-09T20:22:21.191Z +tags: + - DevBreak +--- + +My friend and former colleague [Dominik Štefan](https://www.linkedin.com/in/dominik-%C5%A1tefan-167266180/) came by to talk about his experience working on full-stack web application development. We talked about many different topics but most importantly we had a lot of fun. +This episode aired on the 9th of June 2022 and is in the Slovak language. + +
+ +
diff --git a/_posts/blog/2022-06-26-our-attempt-at-rusty-game-jam-weekly-25-2022.md b/_posts/blog/2022-06-26-our-attempt-at-rusty-game-jam-weekly-25-2022.md index a7042ac..759a7cd 100644 --- a/_posts/blog/2022-06-26-our-attempt-at-rusty-game-jam-weekly-25-2022.md +++ b/_posts/blog/2022-06-26-our-attempt-at-rusty-game-jam-weekly-25-2022.md @@ -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: diff --git a/_posts/blog/2022-11-27-lovely-london-trip.md b/_posts/blog/2022-11-27-lovely-london-trip.md index c39815a..4e6392e 100644 --- a/_posts/blog/2022-11-27-lovely-london-trip.md +++ b/_posts/blog/2022-11-27-lovely-london-trip.md @@ -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") \ No newline at end of file +![Me and my wife on the Queens walk](/images/uploads/image2.jpeg "Me and my wife on the Queens walk") diff --git a/_posts/blog/2023-01-21-devbreak-4-state-of-js-2022.md b/_posts/blog/2023-01-21-devbreak-4-state-of-js-2022.md new file mode 100644 index 0000000..43d15f8 --- /dev/null +++ b/_posts/blog/2023-01-21-devbreak-4-state-of-js-2022.md @@ -0,0 +1,17 @@ +--- +layout: blog +title: "DevBreak #4 State of JS 2022 review with Filip Seman" +segments: + - broadcasts +published: true +date: 2023-01-21T20:22:21.191Z +tags: + - DevBreak +--- +After another year, the results of the [State of JS](https://2022.stateofjs.com/en-us/) survey have been published. +I've invited my #1 fan and friend [Filip Seman](https://www.linkedin.com/in/xseman/). +This episode aired on the 21st of January 2023 and is in the Slovak language. + +
+ +
diff --git a/_posts/blog/2023-02-04-devbreak-5-joys-and-concerns-of-engineering-manager.md b/_posts/blog/2023-02-04-devbreak-5-joys-and-concerns-of-engineering-manager.md new file mode 100644 index 0000000..c40bd72 --- /dev/null +++ b/_posts/blog/2023-02-04-devbreak-5-joys-and-concerns-of-engineering-manager.md @@ -0,0 +1,16 @@ +--- +layout: blog +title: "DevBreak #5 Joys and concerns of Engineering manager with Pavol Dudrík" +segments: + - broadcasts +published: true +date: 2023-02-04T20:22:21.191Z +tags: + - DevBreak +--- +In this episode, I've invited my friend [Pavol Dudrík](https://www.linkedin.com/in/pavol-dudr%C3%ADk-043100168/) to talk about what motivates us and makes us happy about the work of the Engineering manager. This job combines two views, and the transition from engineer to manager is often full of pitfalls. We want to share our experience and dispel misconceptions often associated with managerial positions in IT. +This episode aired on the 4th of February 2023 and is in the Slovak language. + +
+ +
diff --git a/_posts/blog/dev-2019-08-09-ide-to copy.md b/_posts/blog/dev-2019-08-09-ide-to copy.md index 1f5c40e..fd9ca33 100644 --- a/_posts/blog/dev-2019-08-09-ide-to copy.md +++ b/_posts/blog/dev-2019-08-09-ide-to copy.md @@ -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 diff --git a/_posts/blog/dev-2019-08-09-ide-to.md b/_posts/blog/dev-2019-08-09-ide-to.md index af75027..3b9c164 100644 --- a/_posts/blog/dev-2019-08-09-ide-to.md +++ b/_posts/blog/dev-2019-08-09-ide-to.md @@ -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 diff --git a/_posts/blog/dev-2019-11-03-anothert-one.md b/_posts/blog/dev-2019-11-03-anothert-one.md index b5f2041..5b58f95 100644 --- a/_posts/blog/dev-2019-11-03-anothert-one.md +++ b/_posts/blog/dev-2019-11-03-anothert-one.md @@ -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 diff --git a/_posts/blog/dev-2020-06-07-dev-template.md b/_posts/blog/dev-2020-06-07-dev-template.md index 48945f1..b88db1e 100644 --- a/_posts/blog/dev-2020-06-07-dev-template.md +++ b/_posts/blog/dev-2020-06-07-dev-template.md @@ -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: diff --git a/src/components/portfolio/personal.svelte b/src/components/portfolio/personal.svelte deleted file mode 100644 index bad4133..0000000 --- a/src/components/portfolio/personal.svelte +++ /dev/null @@ -1,29 +0,0 @@ - -
-

Personal Information

-

I was born on 26th of May in Košice, Slovakia and I still live here.

-

Hobbies:

-

- I enjoy playing basketball with my friends. I also like to play other team sports like football and hockey. - I also play squash and table tennis. Once I've won a competition in squash at my university. - During summer I love water skiing and swimming in a nearby lake. -
- I am very passionate about music. I've also tried some software for composing music but I am not really hooked into that yet. - From time to time I enjoy playing board games with my friends. -

-

Interests:

-

- I like to explore new technologies and I'm passionate about Open Source movement, - Internet of Things applications and Linux desktop evolution. -
- I am interested in modern software architecture and reactive programming. -
- I've attended various tech conferences and hackathons. I like them for all of the fascinating ideas that might be invented. -
- I've given presentations on various topics related to web development. You can take a look at some of them here. -
- I enjoy teaching and explaining how various technologies and techniques work to my colleagues for their better understanding. -
- I take advantage of test driven development. -

-
diff --git a/src/lib/articleContent/articleContent.ts b/src/lib/articleContent/articleContent.ts new file mode 100644 index 0000000..7698f81 --- /dev/null +++ b/src/lib/articleContent/articleContent.ts @@ -0,0 +1,38 @@ +import { error } from '@sveltejs/kit' +import fm from 'front-matter' +import { readFile } from 'fs' +import { parseField } from '$lib/markdown/parse-markdown' +import { promisify } from 'util' + +export interface ArticleAttributes { + slug: string + layout: string + segments: string[] + title: string + published: boolean + date: string + thumbnail: string + tags: string[] + body: string +} + +export async function getArticleContent(slug: string) { + let postSource: string + try { + postSource = await promisify(readFile)(`_posts/blog/${slug}.md`, 'utf-8') + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (e: any) { + if (e.code === 'ENOENT') { + throw error(404, 'Post not found \n' + e.toString()) + } + throw e + } + + const parsedPost = fm(postSource) + + const post = parseField('body')({ + ...parsedPost.attributes, + body: parsedPost.body, + }) + return post +} diff --git a/src/routes/blog/content.ts b/src/lib/articleContent/articleContentListing.ts similarity index 81% rename from src/routes/blog/content.ts rename to src/lib/articleContent/articleContentListing.ts index 41a7bdf..b319f69 100644 --- a/src/routes/blog/content.ts +++ b/src/lib/articleContent/articleContentListing.ts @@ -8,24 +8,13 @@ import { filterAndCount, type PaginationQuery, } from '$lib/pagination/pagination' +import type { ArticleAttributes } from './articleContent' + +export interface ArticlePreviewAttributes extends ArticleAttributes { + preview: string +} const { NODE_ENV } = process.env - -export interface PostAttributes { - layout: string - title: string - published: boolean - date: string - thumbnail: string - tags: string[] -} - -export interface PostContent extends PostAttributes { - preview: string - slug: string - published: boolean -} - export async function getBlogListing(paginationQuery: PaginationQuery) { const files = await promisify(readdir)(`_posts/blog/`, 'utf-8') const filteredFiles = filterDevelopmentFiles(files) @@ -36,7 +25,7 @@ export async function getBlogListing(paginationQuery: PaginationQuery) { `_posts/blog/${file}`, 'utf-8' ) - const parsedAttributes = fm(fileContent) + const parsedAttributes = fm(fileContent) const lineOfTextRegExp = /^(?:\w|\[).+/gm const lines = parsedAttributes.body @@ -53,7 +42,7 @@ export async function getBlogListing(paginationQuery: PaginationQuery) { }) ) const filteredContents = pipe( - sortBy(prop('date')), + sortBy(prop('date')), (items) => reverse(items), filter<(typeof contents)[0]>((article) => article.published), filterAndCount(paginationQuery) diff --git a/src/lib/articleContent/onMountScripts.ts b/src/lib/articleContent/onMountScripts.ts new file mode 100644 index 0000000..7410763 --- /dev/null +++ b/src/lib/articleContent/onMountScripts.ts @@ -0,0 +1,11 @@ +declare global { + interface Window { + onMountScripts?: Array<() => void> + } +} +export function runOnMountScripts() { + window.onMountScripts?.forEach((fn) => { + fn() + }) +} + diff --git a/src/components/Footer.css.ts b/src/lib/components/Footer.css.ts similarity index 100% rename from src/components/Footer.css.ts rename to src/lib/components/Footer.css.ts diff --git a/src/components/Footer.svelte b/src/lib/components/Footer.svelte similarity index 96% rename from src/components/Footer.svelte rename to src/lib/components/Footer.svelte index 9e2e34a..fc0e22b 100644 --- a/src/components/Footer.svelte +++ b/src/lib/components/Footer.svelte @@ -1,6 +1,6 @@