diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ea1b6fc..c279717 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,5 +18,13 @@ // "customizations": {}, // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - "remoteUser": "root" + "remoteUser": "root", + "customizations": { + "vscode": { + "extensions": [ + "svelte.svelte-vscode", + "esbenp.prettier-vscode" + ] + } + } } diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..167d781 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "svelte.svelte-vscode", + "ms-vscode-remote.remote-containers", + "esbenp.prettier-vscode", + "streetsidesoftware.code-spell-checker" + ] +} diff --git a/bgenc.net.code-workspace b/bgenc.net.code-workspace new file mode 100644 index 0000000..8f4183e --- /dev/null +++ b/bgenc.net.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "." + } + ] +} diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index b0f78e1..0f21a0e 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -30,12 +30,15 @@ export async function load() { }), ); + const mostRecentPost = _.maxBy(posts, ({ meta }) => meta.date); const highlightedPosts = _.reverse( _.sortBy( - posts.filter((post) => post.meta.highlighted), + posts.filter( + (post) => post.meta.highlighted && (!mostRecentPost || post.path !== mostRecentPost.path), + ), ({ meta }) => meta.date, ), - ); + ).slice(0, 4); - return { highlightedPosts }; + return { highlightedPosts, mostRecentPost }; } diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 261895a..28d5b4a 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -12,6 +12,7 @@ import MastodonLogo from 'phosphor-svelte/lib/MastodonLogo'; import BlogPostList from './posts/[[page=integer]]/BlogPostList.svelte'; import Button from '$lib/Button.svelte'; + import BlogPost from './posts/[[page=integer]]/BlogPost.svelte'; export let data; @@ -101,6 +102,13 @@ +{#if data.mostRecentPost} +
+

Most Recent Blog Post

+ +
+{/if} + {#if data.highlightedPosts.length > 0}

Highlighted Blog Posts

@@ -122,7 +130,7 @@ clip-path: var(--clip-path); } - .highlighted { + section { margin-top: 4rem; } diff --git a/src/routes/posts/2024.05.27.adding-single-click-dev-environment-links-to-your-open-sourc.md b/src/routes/posts/2024.05.27.adding-single-click-dev-environment-links-to-your-open-sourc.md index 54a94c8..6b2e768 100644 --- a/src/routes/posts/2024.05.27.adding-single-click-dev-environment-links-to-your-open-sourc.md +++ b/src/routes/posts/2024.05.27.adding-single-click-dev-environment-links-to-your-open-sourc.md @@ -2,6 +2,7 @@ title: 'Adding single click dev environment links to your open source project for easy contributions' date: 2024-05-27T05:10:06Z description: 'See how you can streamline contributions and onboarding by leveraging DevContainers and cloud dev environments - a one-click setup that lets new folks dive right in!' +highlighted: true --- [I have been using DevContainers](/2023.02.10.why-use-devcontainer/) a lot. If @@ -15,6 +16,7 @@ containers, and runs any commands you defined in the configuration to set things up. This comes with many benefits: + - Assuming you deploy with containers, your development environment can more closely match your production environment. - There are no "works on my machine" issues, everyone has the same development @@ -63,7 +65,6 @@ To do so, simply add the following links to your Readme, replacing `` and Codespaces, these are not restricted to Github and can be used with other forge services like [Gitlab](https://about.gitlab.com) or [Codeberg](https://codeberg.org). - ```md [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new//) [![Open in DevPod](https://devpod.sh/assets/open-in-devpod.svg)](https://devpod.sh/open#https://github.com//) @@ -82,8 +83,8 @@ with the appropriate links. Let's see what that workflow looks like: ```yml on: pull_request -permissions: - pull-requests: write +permissions: + pull-requests: write jobs: comment_click_dev: @@ -95,7 +96,7 @@ jobs: with: message: | Click links below to open this PR in a dev environment: - + [![Open PR in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new///tree/${{github.head_ref}}) [![Open PR in DevPod](https://devpod.sh/assets/open-in-devpod.svg)](https://devpod.sh/open#https://github.com//@${{github.head_ref}}) [![Open PR in CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://githubbox.com///tree/${{github.head_ref}}) diff --git a/src/routes/posts/[[page=integer]]/BlogPost.svelte b/src/routes/posts/[[page=integer]]/BlogPost.svelte new file mode 100644 index 0000000..98a0281 --- /dev/null +++ b/src/routes/posts/[[page=integer]]/BlogPost.svelte @@ -0,0 +1,74 @@ + + + +
  • +
    +
    + {post.meta.title} +
    + {#if post.meta.description} +

    {post.meta.description}

    + {/if} +
    +
    + + {#if showReadingTime} +
    {post.readingTime.words} words, {post.readingTime.text}
    + {/if} +
    +
  • +
    + + diff --git a/src/routes/posts/[[page=integer]]/BlogPostList.svelte b/src/routes/posts/[[page=integer]]/BlogPostList.svelte index 6a5f041..e6c6b02 100644 --- a/src/routes/posts/[[page=integer]]/BlogPostList.svelte +++ b/src/routes/posts/[[page=integer]]/BlogPostList.svelte @@ -1,7 +1,7 @@