From 1ffefddd607da9a2077cbafdb5bd528a006fb566 Mon Sep 17 00:00:00 2001 From: Michal Vanko Date: Sat, 18 Feb 2023 21:24:43 +0100 Subject: [PATCH] resolved how to run scripts in articles, added devbreak broadcasts --- .../2022-03-16-devbreak-1-state-of-js-2021.md | 19 +++++++++++++++++++ ...k-2-stories-and-impressions-hack-kosice.md | 17 +++++++++++++++++ ...06-14-devbreak-3-full-stack-development.md | 17 +++++++++++++++++ .../2023-01-22-devbreak-4-state-of-js-2022.md | 18 ++++++++++++++++++ ...oys-and-concerns-of-engineering-manager.md | 17 +++++++++++++++++ src/lib/articleContent/onMountScripts.ts | 11 +++++++++++ src/lib/styles/article/article.css.ts | 6 ++++++ src/routes/blog/[slug=blogPage]/+page.svelte | 10 ++++++++-- .../broadcasts/[slug=blogPage]/+page.svelte | 10 ++++++++-- static/admin/config.yml | 2 +- 10 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 _posts/blog/2022-03-16-devbreak-1-state-of-js-2021.md create mode 100644 _posts/blog/2022-04-27-devbreak-2-stories-and-impressions-hack-kosice.md create mode 100644 _posts/blog/2022-06-14-devbreak-3-full-stack-development.md create mode 100644 _posts/blog/2023-01-22-devbreak-4-state-of-js-2022.md create mode 100644 _posts/blog/2023-02-04-devbreak-5-joys-and-concerns-of-engineering-manager.md create mode 100644 src/lib/articleContent/onMountScripts.ts diff --git a/_posts/blog/2022-03-16-devbreak-1-state-of-js-2021.md b/_posts/blog/2022-03-16-devbreak-1-state-of-js-2021.md new file mode 100644 index 0000000..9846e4d --- /dev/null +++ b/_posts/blog/2022-03-16-devbreak-1-state-of-js-2021.md @@ -0,0 +1,19 @@ +--- +layout: blog +title: "DevBreak #1 State of JS 2021 review with Lukáš Orgován" +segments: + - broadcasts +published: true +date: 2022-03-16T22: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 in 16th of March 2022 and is in Slovak language. + +
+ +
diff --git a/_posts/blog/2022-04-27-devbreak-2-stories-and-impressions-hack-kosice.md b/_posts/blog/2022-04-27-devbreak-2-stories-and-impressions-hack-kosice.md new file mode 100644 index 0000000..891fb2c --- /dev/null +++ b/_posts/blog/2022-04-27-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-16T22: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 in 27th of April 2022 and is in Slovak language. + +
+ +
diff --git a/_posts/blog/2022-06-14-devbreak-3-full-stack-development.md b/_posts/blog/2022-06-14-devbreak-3-full-stack-development.md new file mode 100644 index 0000000..f6a9d4d --- /dev/null +++ b/_posts/blog/2022-06-14-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-14T22:22:21.191Z +tags: + - DevBreak +--- + +My friend and former collegue [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 have talked about many different topics but most importantly we had a lot of fun. +This episode aired in 14th of June 2022 and is in Slovak language. + +
+ +
diff --git a/_posts/blog/2023-01-22-devbreak-4-state-of-js-2022.md b/_posts/blog/2023-01-22-devbreak-4-state-of-js-2022.md new file mode 100644 index 0000000..2595209 --- /dev/null +++ b/_posts/blog/2023-01-22-devbreak-4-state-of-js-2022.md @@ -0,0 +1,18 @@ +--- +layout: blog +title: "DevBreak #4 State of JS 2022 review with Filip Seman" +segments: + - broadcasts +published: true +date: 2023-01-22T22:22:21.191Z +tags: + - DevBreak +--- + +After another year, the results for the [State of JS](https://2022.stateofjs.com/en-us/) survey has been published. +I've invited my #1 fan and friend [Filip Seman](https://www.linkedin.com/in/xseman/). +This episode aired in 22nd of January 2023 and is in 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..705e8ad --- /dev/null +++ b/_posts/blog/2023-02-04-devbreak-5-joys-and-concerns-of-engineering-manager.md @@ -0,0 +1,17 @@ +--- +layout: blog +title: "DevBreak #5 Joys and concerns of Engineering manager with Pavol Dudrík" +segments: + - broadcasts +published: true +date: 2023-02-04T22:22:21.191Z +tags: + - DevBreak +--- + +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 Engineering manager. This job combines two different views, and the transition from engineer to manager is often full of pitfalls. We would like to share our experience and dispel the misconceptions that are often associated with managerial positions in IT. +This episode aired in 4th of February 2023 and is in Slovak language. + +
+ +
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/lib/styles/article/article.css.ts b/src/lib/styles/article/article.css.ts index 5bd8a6c..f794fcb 100644 --- a/src/lib/styles/article/article.css.ts +++ b/src/lib/styles/article/article.css.ts @@ -19,3 +19,9 @@ globalStyle(`${contentClass} img:only-child`, { display: 'block', margin: '0 auto', }) + +globalStyle(`${contentClass} .video-embed`, { + margin: '0 auto', + maxWidth: vars.width.image, + aspectRatio: vars.aspectRatio.monitor, +}) diff --git a/src/routes/blog/[slug=blogPage]/+page.svelte b/src/routes/blog/[slug=blogPage]/+page.svelte index 99c40ca..b5036bd 100644 --- a/src/routes/blog/[slug=blogPage]/+page.svelte +++ b/src/routes/blog/[slug=blogPage]/+page.svelte @@ -2,8 +2,14 @@ import ArticleFooter from '$lib/components/articles/ArticlePreviewFooter/ArticlePreviewFooter.svelte' import type { PageData } from './$types' import { contentClass } from '$lib/styles/article/article.css' + import { onMount } from 'svelte' + import { runOnMountScripts } from '$lib/articleContent/onMountScripts' export let data: PageData + + onMount(() => { + runOnMountScripts() + }) @@ -12,7 +18,7 @@

{data.title}

-
+
{@html data.body} -
+ diff --git a/src/routes/broadcasts/[slug=blogPage]/+page.svelte b/src/routes/broadcasts/[slug=blogPage]/+page.svelte index 52ed140..78a50e2 100644 --- a/src/routes/broadcasts/[slug=blogPage]/+page.svelte +++ b/src/routes/broadcasts/[slug=blogPage]/+page.svelte @@ -2,8 +2,14 @@ import ArticleFooter from '$lib/components/articles/ArticlePreviewFooter/ArticlePreviewFooter.svelte' import type { PageData } from './$types' import { contentClass } from '$lib/styles/article/article.css' + import { onMount } from 'svelte' + import { runOnMountScripts } from '$lib/articleContent/onMountScripts' export let data: PageData + + onMount(() => { + runOnMountScripts() + }) @@ -12,7 +18,7 @@

{data.title}

-
+
{@html data.body} -
+ diff --git a/static/admin/config.yml b/static/admin/config.yml index 206c50f..446a536 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -25,7 +25,7 @@ collections: multiple: true options: - { label: 'Blog', value: 'blog' } - - { label: 'Broadcasts', value: 'Broadcasts' } + - { label: 'Broadcasts', value: 'broadcasts' } - { label: 'Cookbook', value: 'cookbook' } default: ['blog'] - {