This commit is contained in:
core 2023-07-01 15:45:00 -04:00
parent 85afa80eb4
commit d38cd0db4f
Signed by: core
GPG Key ID: FDBF740DADDCEECF
12 changed files with 238 additions and 6 deletions

View File

@ -13,6 +13,7 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-cloudflare": "^2.3.0",
"@sveltejs/kit": "^1.5.0",
"@types/prismjs": "^1.26.0",
"@typescript-eslint/eslint-plugin": "^5.45.0",

View File

@ -0,0 +1,37 @@
<script lang="ts">
export let title;
export let published;
export let description;
export let url;
</script>
<a class="blog-link" href="{url}">
<h2 class="blog-title">{title}</h2>
<time>{new Date(published).toLocaleDateString()}</time>
</a>
<p class="blog-description">{description}</p>
<style>
.blog-title {
display: inline;
}
.blog-link {
text-decoration: none;
text-decoration-color: transparent;
color: white;
transition: 0.2s;
}
.blog-link:hover {
text-decoration: underline;
text-decoration-color: white;
transition: 0.2s;
}
.blog-description {
font-size: 11pt;
color: #ababab;
}
</style>

View File

@ -1,4 +1,4 @@
<script lang="ts">
<script>
export let title = 'Untitled';
export let published = '';
</script>
@ -8,6 +8,20 @@
</svelte:head>
<h1>{title}</h1>
<time>{new Date(published).toLocaleDateString()}</time>
<span><a class="blog-link" href="/blog/">← Back</a> - <time>{new Date(published).toLocaleDateString()}</time></span>
<slot />
<style>
.blog-link {
text-decoration: none;
text-decoration-color: transparent;
color: white;
transition: 1s;
}
.blog-link:hover {
text-decoration: underline;
text-decoration-color: white;
}
</style>

View File

@ -9,7 +9,7 @@
<Bar selected="about"/>
<Content offset="30">
<Content offset="20">
<span><span class="coregreen">[core ~]$</span> cat about.txt</span>
<p><i>Q: Who are you?</i></p>
<p>A: I'm core, an independent freelance software developer and video editor.</p>

View File

@ -0,0 +1,30 @@
<script lang="ts">
import Bar from "$components/Bar.svelte";
import Content from "$components/Content.svelte";
import PostPreview from "$components/PostPreview.svelte";
import blog_test from "./blog-test/data.json";
import hello from "./hello/data.json";
interface PostData {
title: string,
published: string,
short_description: string,
slug: string
}
let posts = [
blog_test,
hello
];
</script>
<Bar selected="blog"/>
<Content offset="15">
{#each posts as post}
<PostPreview title={post.title} published={post.published} description={post.short_description} url="/blog/{post.slug}" />
<br>
{/each}
</Content>

View File

@ -3,6 +3,52 @@
import Bar from "$components/Bar.svelte";
import Content from "$components/Content.svelte";
// Prism core
import Prism from "prismjs";
// Prism theme
import "prismjs/themes/prism-twilight.css";
// Prism languages
import "prismjs/components/prism-rust.js";
import "prismjs/components/prism-diff.js";
// Prism plugins
import "prismjs/plugins/line-numbers/prism-line-numbers.js"; // Line numbers
import "prismjs/plugins/line-numbers/prism-line-numbers.css"; // Line numbers
import "prismjs/plugins/line-highlight/prism-line-highlight.js"; // Line highlight
import "prismjs/plugins/line-highlight/prism-line-highlight.css"; // Line highlight
import "prismjs/plugins/autolinker/prism-autolinker.js"; // Autolinker
import "prismjs/plugins/autolinker/prism-autolinker.css"; // Autolinker
import "prismjs/plugins/toolbar/prism-toolbar.css"; // Toolbar
import "prismjs/plugins/toolbar/prism-toolbar.js"; // Toolbar
import "prismjs/plugins/show-language/prism-show-language.js"; // Show Language (broken?)
import "prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.js"; // Copy to Clipboard
import "prismjs/plugins/download-button/prism-download-button.js"; // Download Button
import "prismjs/plugins/match-braces/prism-match-braces.css"; // Match Braces
import "prismjs/plugins/match-braces/prism-match-braces.js"; // Match Braces
import "prismjs/plugins/diff-highlight/prism-diff-highlight.css"; // Diff Highlight
import "prismjs/plugins/diff-highlight/prism-diff-highlight.js"; // Diff Highlight
import "prismjs/plugins/treeview/prism-treeview.css"; // Treeview
import "prismjs/plugins/treeview/prism-treeview.js"; // Treeview
import {onMount} from "svelte";
onMount(() => {
window.Prism = window.Prism || {};
window.Prism.manual = true;
Prism.highlightAll();
})
</script>
<Bar selected="none"/>

View File

@ -0,0 +1,6 @@
{
"title": "Blog Test",
"published": "2023-06-30T22:22:19+0000",
"short_description": "Testing the new blog system",
"slug": "blog-test"
}

View File

@ -0,0 +1,59 @@
<script lang="ts">
import PostContent from "./page.svx";
import Bar from "$components/Bar.svelte";
import Content from "$components/Content.svelte";
// Prism core
import Prism from "prismjs";
// Prism theme
import "prismjs/themes/prism-twilight.css";
// Prism languages
import "prismjs/components/prism-rust.js";
import "prismjs/components/prism-diff.js";
// Prism plugins
import "prismjs/plugins/line-numbers/prism-line-numbers.js"; // Line numbers
import "prismjs/plugins/line-numbers/prism-line-numbers.css"; // Line numbers
import "prismjs/plugins/line-highlight/prism-line-highlight.js"; // Line highlight
import "prismjs/plugins/line-highlight/prism-line-highlight.css"; // Line highlight
import "prismjs/plugins/autolinker/prism-autolinker.js"; // Autolinker
import "prismjs/plugins/autolinker/prism-autolinker.css"; // Autolinker
import "prismjs/plugins/toolbar/prism-toolbar.css"; // Toolbar
import "prismjs/plugins/toolbar/prism-toolbar.js"; // Toolbar
import "prismjs/plugins/show-language/prism-show-language.js"; // Show Language (broken?)
import "prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.js"; // Copy to Clipboard
import "prismjs/plugins/download-button/prism-download-button.js"; // Download Button
import "prismjs/plugins/match-braces/prism-match-braces.css"; // Match Braces
import "prismjs/plugins/match-braces/prism-match-braces.js"; // Match Braces
import "prismjs/plugins/diff-highlight/prism-diff-highlight.css"; // Diff Highlight
import "prismjs/plugins/diff-highlight/prism-diff-highlight.js"; // Diff Highlight
import "prismjs/plugins/treeview/prism-treeview.css"; // Treeview
import "prismjs/plugins/treeview/prism-treeview.js"; // Treeview
import {onMount} from "svelte";
onMount(() => {
window.Prism = window.Prism || {};
window.Prism.manual = true;
Prism.highlightAll();
})
</script>
<Bar selected="none"/>
<Content offset="10">
<PostContent />
</Content>

View File

@ -0,0 +1,6 @@
{
"title": "Welcome to my blog!",
"published": "2023-07-01T19:08:18+0000",
"short_description": "An introduction to me and what this blog is about",
"slug": "hello"
}

View File

@ -0,0 +1,6 @@
---
title: Welcome to my blog!
published: 2023-07-01T19:08:18+0000
---
Hello! I'm core, I make silly things and this is my blog.

View File

@ -2,6 +2,11 @@
# yarn lockfile v1
"@cloudflare/workers-types@^4.20230404.0":
version "4.20230518.0"
resolved "https://registry.yarnpkg.com/@cloudflare/workers-types/-/workers-types-4.20230518.0.tgz#de1b0f71d68e2eac1b546542968ea2b837cb967e"
integrity sha512-A0w1V+5SUawGaaPRlhFhSC/SCDT9oQG8TMoWOKFLA4qbqagELqEAFD4KySBIkeVOvCBLT1DZSYBMCxbXddl0kw==
"@esbuild/android-arm64@0.17.19":
version "0.17.19"
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz#bafb75234a5d3d1b690e7c2956a599345e84a2fd"
@ -219,6 +224,15 @@
dependencies:
import-meta-resolve "^3.0.0"
"@sveltejs/adapter-cloudflare@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@sveltejs/adapter-cloudflare/-/adapter-cloudflare-2.3.0.tgz#931f5539f8c23a2796ef82bc3476c5caeb3db5f5"
integrity sha512-4rUtQG1rfenLh3V+w8DSfmtv/l3pGBdxjvJ68oAVX7Lpm2yHUaKPmPVOA7EuQiP0BOB/TSZVmIF8c5SnTlrYXQ==
dependencies:
"@cloudflare/workers-types" "^4.20230404.0"
esbuild "^0.17.18"
worktop "0.8.0-next.15"
"@sveltejs/kit@^1.5.0":
version "1.20.0"
resolved "https://registry.yarnpkg.com/@sveltejs/kit/-/kit-1.20.0.tgz#5deed969badda2cd9d4c68c580362c492425be75"
@ -564,7 +578,7 @@ es6-promise@^3.1.2:
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613"
integrity sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==
esbuild@^0.17.5:
esbuild@^0.17.18, esbuild@^0.17.5:
version "0.17.19"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955"
integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==
@ -1243,6 +1257,11 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"
regexparam@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-2.0.1.tgz#c912f5dae371e3798100b3c9ce22b7414d0889fa"
integrity sha512-zRgSaYemnNYxUv+/5SeoHI0eJIgTL/A2pUtXUPLHQxUldagouJ9p+K6IbIZ/JiQuCEv2E2B1O11SjVQy3aMCkw==
resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
@ -1542,6 +1561,14 @@ word-wrap@^1.2.3:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
worktop@0.8.0-next.15:
version "0.8.0-next.15"
resolved "https://registry.yarnpkg.com/worktop/-/worktop-0.8.0-next.15.tgz#f91d4a686fe43b813fbfd49bd3d4566dcddd4bd4"
integrity sha512-0ycNO52P6nVwsjr1y20zuf0nqJatAb8L7MODBfQIxbxndHV5O4s50oZZMHWhJG1RLpHwbK0Epq8aaQK4E2GlgQ==
dependencies:
mrmime "^1.0.0"
regexparam "^2.0.0"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"