From 0c17d94c4d1303d73b3ad3e7a9dfef1fb8f0a883 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Tue, 12 Nov 2024 16:05:53 +0200 Subject: Backup --- src/components/Link.astro | 12 ++ src/components/Markdown.astro | 12 ++ src/components/MarkdownB.astro | 11 ++ src/components/Nav.astro | 9 +- src/components/TerminalBorder.astro | 47 ++++---- src/content/aadkadocs/blogs/index.md | 42 +++++++ src/content/aadkadocs/blogs/test.md | 23 ++++ src/content/aadkadocs/blogs/test2.md | 66 +++++++++++ src/content/blogs/blog-0.md | 39 +++++++ src/content/blogs/blog-1.md | 4 + src/content/blogs/blog-2.md | 4 + src/content/config.ts | 5 +- src/content/docs/docs/index.md | 42 ------- src/content/docs/docs/test.md | 23 ---- src/content/docs/docs/test2.md | 66 ----------- src/layouts/Layout.astro | 12 +- src/pages/blogs/[...slug].astro | 32 +++++ src/pages/index.astro | 85 ++++++++------ src/pages/test.astro | 12 -- src/styles/asides.css | 49 ++++++++ src/styles/markdown.css | 218 +++++++++++++++++++++++++++++++++++ src/styles/props.css | 189 ++++++++++++++++++++++++++++++ src/styles/reset.css | 48 ++++++++ src/styles/shiki.css | 13 +++ src/styles/util.css | 61 ++++++++++ 25 files changed, 913 insertions(+), 211 deletions(-) create mode 100644 src/components/Link.astro create mode 100644 src/components/Markdown.astro create mode 100644 src/components/MarkdownB.astro create mode 100644 src/content/aadkadocs/blogs/index.md create mode 100644 src/content/aadkadocs/blogs/test.md create mode 100644 src/content/aadkadocs/blogs/test2.md create mode 100644 src/content/blogs/blog-0.md delete mode 100644 src/content/docs/docs/index.md delete mode 100644 src/content/docs/docs/test.md delete mode 100644 src/content/docs/docs/test2.md create mode 100644 src/pages/blogs/[...slug].astro delete mode 100644 src/pages/test.astro create mode 100644 src/styles/asides.css create mode 100644 src/styles/markdown.css create mode 100644 src/styles/props.css create mode 100644 src/styles/reset.css create mode 100644 src/styles/shiki.css create mode 100644 src/styles/util.css diff --git a/src/components/Link.astro b/src/components/Link.astro new file mode 100644 index 0000000..72a0e0a --- /dev/null +++ b/src/components/Link.astro @@ -0,0 +1,12 @@ +--- +interface Props { + href: string; + newTab?: boolean; +} + +const { href, newTab = true } = Astro.props; +--- + + + + diff --git a/src/components/Markdown.astro b/src/components/Markdown.astro new file mode 100644 index 0000000..ef3ed1d --- /dev/null +++ b/src/components/Markdown.astro @@ -0,0 +1,12 @@ +--- +import "../../styles/asides.css"; +import "../../styles/markdown.css"; +import "../../styles/props.css"; +import "../../styles/reset.css"; +import "../../styles/shiki.css"; +import "../../styles/util.css"; +--- + +
+ +
diff --git a/src/components/MarkdownB.astro b/src/components/MarkdownB.astro new file mode 100644 index 0000000..adc46c1 --- /dev/null +++ b/src/components/MarkdownB.astro @@ -0,0 +1,11 @@ +--- +import Markdown from './Markdown.astro'; +import "../../styles/asides.css"; +import "../../styles/markdown.css"; +import "../../styles/props.css"; +import "../../styles/reset.css"; +import "../../styles/shiki.css"; +import "../../styles/util.css"; +--- + + diff --git a/src/components/Nav.astro b/src/components/Nav.astro index 60f2f14..1d7d979 100644 --- a/src/components/Nav.astro +++ b/src/components/Nav.astro @@ -5,7 +5,7 @@ interface Props { const { path } = Astro.props; -const directories = ["about", "works", "links"]; +const directories = ["skills", "projects", "blogs"]; --- diff --git a/src/components/TerminalBorder.astro b/src/components/TerminalBorder.astro index 6add2b7..bb6874c 100644 --- a/src/components/TerminalBorder.astro +++ b/src/components/TerminalBorder.astro @@ -2,35 +2,36 @@ interface Props { header: string; margin?: string; + class?: string; } -const { header, margin = "-1px" } = Astro.props; +const { header, margin = "-1px", class: htmlClass } = Astro.props; --- -
+ +
{header} - +
diff --git a/src/content/aadkadocs/blogs/index.md b/src/content/aadkadocs/blogs/index.md new file mode 100644 index 0000000..dfab5a3 --- /dev/null +++ b/src/content/aadkadocs/blogs/index.md @@ -0,0 +1,42 @@ +--- +title: The search for the perfect ed25519 key pair +template: splash +--- + +Todo write intro to catch attention + +### Why care about ed25519 key pairs? + +Ed25519 is a cryptographic algorithm for generating +a pair of keys, a public one that can be shared with anyone +and a private one that is kept as a secret. + +### The ssh public key format + +If you have ever accessed a remote server it was most likely by +ssh-ing into it. +You have also most likely had to copy paste something similar to this: + +``` +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBSSj+yfJLWEb+Df4r4603TOFAUBREYS43qQB+c9i9UW +``` + +Let's break it down + +- The first part `ssh-ed25519` is the algorithm type, other common algorithms are `ssh-rsa` and `ssh-ecdsa` +- The second part is a base64-encoded binary format consiting of + - the length of the algorithm string, for ed25519 it's always 11 (4 bytes long) + - the algorithm type, for ed25519 it's always `ssh-ed25519` in binary (11 bytes long) + - the length of the key, 32 bytes for ed25519 (4 bytes long) + - the actual ed25519 key (32 bytes long) + +### Embedding a word in base64 + +Base64 is a widely used format for writing binary in a compact and human readable way, +it uses A-Z, a-z, 0-9, '/' and '+' adding up to 64 unique characters. + +It's possible to choose specific bytes in a way that when encoding it with base64 +it will form a word. + +For example, to encode "Kyren" in base64, we can use the following bytes +`00101011 00101010 01001110` or in hex `2b 2a de` diff --git a/src/content/aadkadocs/blogs/test.md b/src/content/aadkadocs/blogs/test.md new file mode 100644 index 0000000..f8e3832 --- /dev/null +++ b/src/content/aadkadocs/blogs/test.md @@ -0,0 +1,23 @@ +--- +title: My dakdkadkadk a +description: EEEEEE akd ak dka kdak ak dka kdka dk ak +template: splash +--- + +# My oadkadkakd + +## Secondary + +Testing some content with multiline thing + +```go example.go +package main + +import "fmt" + +func main() { + fmt.Println("Hello, World!") +} +``` + +Hmm diff --git a/src/content/aadkadocs/blogs/test2.md b/src/content/aadkadocs/blogs/test2.md new file mode 100644 index 0000000..02b9fbd --- /dev/null +++ b/src/content/aadkadocs/blogs/test2.md @@ -0,0 +1,66 @@ +--- +title: My docs +description: Learn more about my project in this docs site built with Starlight. +template: splash +--- + +# My Title + +## Secondary + +### Test + +#### 4 + +##### 5 + +###### 6 + +####### 7 Should be normal + +Testing some content with multiline thing +let's see what happens if this wraps +This should be super close + +This should be far + +- Some bullets +- Adka kda kd ak +- d kakd akd ka k + +- [ ] Check me +- [x] Already checked + +## Smaller header + +How about code blocks + +```go example.go +package main + +import "fmt" + +func main() { + fmt.Println("Hello, World!") +} +``` + +Hmm + +> ![INFO] +> Does this work + +This is `highlighting` I think is what it's called + +:::caution +If you are not sure you want an awesome docs site, think twice before using [Starlight](/). +::: + +:::danger +Your users may be more productive and find your product easier to use thanks to helpful Starlight features. + +- Clear navigation +- User-configurable colour theme +- [i18n support](/guides/i18n/) + +::: diff --git a/src/content/blogs/blog-0.md b/src/content/blogs/blog-0.md new file mode 100644 index 0000000..c954f97 --- /dev/null +++ b/src/content/blogs/blog-0.md @@ -0,0 +1,39 @@ +# The search for the perfect ed25519 key pair + +Todo write intro to catch attention + +### Why care about ed25519 key pairs? + +Ed25519 is a cryptographic algorithm for generating +a pair of keys, a public one that can be shared with anyone +and a private one that is kept as a secret. + +### The ssh public key format + +If you have ever accessed a remote server it was most likely by +ssh-ing into it. +You have also most likely had to copy paste something similar to this: + +``` +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBSSj+yfJLWEb+Df4r4603TOFAUBREYS43qQB+c9i9UW +``` + +Let's break it down + +- The first part `ssh-ed25519` is the algorithm type, other common algorithms are `ssh-rsa` and `ssh-ecdsa` +- The second part is a base64-encoded binary format consiting of + - the length of the algorithm string, for ed25519 it's always 11 (4 bytes long) + - the algorithm type, for ed25519 it's always `ssh-ed25519` in binary (11 bytes long) + - the length of the key, 32 bytes for ed25519 (4 bytes long) + - the actual ed25519 key (32 bytes long) + +### Embedding a word in base64 + +Base64 is a widely used format for writing binary in a compact and human readable way, +it uses A-Z, a-z, 0-9, '/' and '+' adding up to 64 unique characters. + +It's possible to choose specific bytes in a way that when encoding it with base64 +it will form a word. + +For example, to encode "Kyren" in base64, we can use the following bytes +`00101011 00101010 01001110` or in hex `2b 2a de` diff --git a/src/content/blogs/blog-1.md b/src/content/blogs/blog-1.md index ca2e3f1..75128e5 100644 --- a/src/content/blogs/blog-1.md +++ b/src/content/blogs/blog-1.md @@ -1,3 +1,7 @@ +--- +title: The search for the perfect ed25519 key pair +template: splash +--- # My Title ## Secondary diff --git a/src/content/blogs/blog-2.md b/src/content/blogs/blog-2.md index 0296fe2..c6b02c0 100644 --- a/src/content/blogs/blog-2.md +++ b/src/content/blogs/blog-2.md @@ -1,3 +1,7 @@ +--- +title: The search for the perfect ed25519 key pair +template: splash +--- # Other blog How about code blocks diff --git a/src/content/config.ts b/src/content/config.ts index 31b7476..9d8d958 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -1,6 +1,5 @@ -import { defineCollection } from 'astro:content'; -import { docsSchema } from '@astrojs/starlight/schema'; +import { defineCollection } from "astro:content"; export const collections = { - docs: defineCollection({ schema: docsSchema() }), + blogs: defineCollection({}), }; diff --git a/src/content/docs/docs/index.md b/src/content/docs/docs/index.md deleted file mode 100644 index dfab5a3..0000000 --- a/src/content/docs/docs/index.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: The search for the perfect ed25519 key pair -template: splash ---- - -Todo write intro to catch attention - -### Why care about ed25519 key pairs? - -Ed25519 is a cryptographic algorithm for generating -a pair of keys, a public one that can be shared with anyone -and a private one that is kept as a secret. - -### The ssh public key format - -If you have ever accessed a remote server it was most likely by -ssh-ing into it. -You have also most likely had to copy paste something similar to this: - -``` -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBSSj+yfJLWEb+Df4r4603TOFAUBREYS43qQB+c9i9UW -``` - -Let's break it down - -- The first part `ssh-ed25519` is the algorithm type, other common algorithms are `ssh-rsa` and `ssh-ecdsa` -- The second part is a base64-encoded binary format consiting of - - the length of the algorithm string, for ed25519 it's always 11 (4 bytes long) - - the algorithm type, for ed25519 it's always `ssh-ed25519` in binary (11 bytes long) - - the length of the key, 32 bytes for ed25519 (4 bytes long) - - the actual ed25519 key (32 bytes long) - -### Embedding a word in base64 - -Base64 is a widely used format for writing binary in a compact and human readable way, -it uses A-Z, a-z, 0-9, '/' and '+' adding up to 64 unique characters. - -It's possible to choose specific bytes in a way that when encoding it with base64 -it will form a word. - -For example, to encode "Kyren" in base64, we can use the following bytes -`00101011 00101010 01001110` or in hex `2b 2a de` diff --git a/src/content/docs/docs/test.md b/src/content/docs/docs/test.md deleted file mode 100644 index f8e3832..0000000 --- a/src/content/docs/docs/test.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: My dakdkadkadk a -description: EEEEEE akd ak dka kdak ak dka kdka dk ak -template: splash ---- - -# My oadkadkakd - -## Secondary - -Testing some content with multiline thing - -```go example.go -package main - -import "fmt" - -func main() { - fmt.Println("Hello, World!") -} -``` - -Hmm diff --git a/src/content/docs/docs/test2.md b/src/content/docs/docs/test2.md deleted file mode 100644 index 02b9fbd..0000000 --- a/src/content/docs/docs/test2.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: My docs -description: Learn more about my project in this docs site built with Starlight. -template: splash ---- - -# My Title - -## Secondary - -### Test - -#### 4 - -##### 5 - -###### 6 - -####### 7 Should be normal - -Testing some content with multiline thing -let's see what happens if this wraps -This should be super close - -This should be far - -- Some bullets -- Adka kda kd ak -- d kakd akd ka k - -- [ ] Check me -- [x] Already checked - -## Smaller header - -How about code blocks - -```go example.go -package main - -import "fmt" - -func main() { - fmt.Println("Hello, World!") -} -``` - -Hmm - -> ![INFO] -> Does this work - -This is `highlighting` I think is what it's called - -:::caution -If you are not sure you want an awesome docs site, think twice before using [Starlight](/). -::: - -:::danger -Your users may be more productive and find your product easier to use thanks to helpful Starlight features. - -- Clear navigation -- User-configurable colour theme -- [i18n support](/guides/i18n/) - -::: diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 9c1584c..17d0a70 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -24,8 +24,18 @@ const { title } = Astro.props;