diff --git a/README.md b/README.md index 63c7a44..e984bf3 100644 --- a/README.md +++ b/README.md @@ -37,16 +37,16 @@ You can preview the production build with `npm run preview`. > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. -# Create Blog Posts +# Create Journal Posts -To create a new post, all you must do is create a new markdown file in the `./src/blog/` directory. +To create a new post, all you must do is create a new markdown file in the `./src/journal/` directory. However, before you begin writing, you must first add the following two lines at the top of the new markdown file: ```markdown Date: YYYY-MM-DD -Desc: Some short description to post on the index page of the blogs. +Desc: Some short description to post on the index page of the journal. ``` -Below this, you can write your blog post in the markdown format. The metadata above is used for +Below this, you can write your journal post in the markdown format. The metadata above is used for displaying and parsing the post. diff --git a/src/app.css b/src/app.css index 63e6634..9bb6796 100644 --- a/src/app.css +++ b/src/app.css @@ -4,77 +4,77 @@ /* This is very painful. There must be a better way. */ @layer base { - div.blog-wrapper h1, - div.blog-wrapper h2, - div.blog-wrapper h3, - div.blog-wrapper h4, - div.blog-wrapper h5, - div.blog-wrapper h6 { + div.journal-wrapper h1, + div.journal-wrapper h2, + div.journal-wrapper h3, + div.journal-wrapper h4, + div.journal-wrapper h5, + div.journal-wrapper h6 { @apply text-gray-300 px-4; } - div.blog-wrapper p, - div.blog-wrapper ul, - div.blog-wrapper ol, - div.blog-wrapper table { + div.journal-wrapper p, + div.journal-wrapper ul, + div.journal-wrapper ol, + div.journal-wrapper table { @apply text-gray-400 text-sm px-4 py-2; } - div.blog-wrapper table { + div.journal-wrapper table { @apply table-fixed w-full border border-gray-300 border-collapse; } - div.blog-wrapper table th { + div.journal-wrapper table th { @apply text-blue-300 p-2 text-xl; } - div.blog-wrapper table td { + div.journal-wrapper table td { @apply border border-gray-300 p-2 text-sm; } - div.blog-wrapper ul { + div.journal-wrapper ul { @apply list-disc list-outside; } - div.blog-wrapper ol { + div.journal-wrapper ol { @apply list-decimal list-inside; } - div.blog-wrapper h1 { + div.journal-wrapper h1 { @apply text-3xl font-bold py-6; } - div.blog-wrapper h2 { + div.journal-wrapper h2 { @apply text-xl font-bold p-4; } - div.blog-wrapper h3 { + div.journal-wrapper h3 { @apply text-lg font-bold p-4; } - div.blog-wrapper h4 { + div.journal-wrapper h4 { @apply text-lg py-2; } - div.blog-wrapper h6 { + div.journal-wrapper h6 { @apply text-xs text-gray-400; } - div.blog-wrapper p { + div.journal-wrapper p { @apply text-sm; } - div.blog-wrapper blockquote { + div.journal-wrapper blockquote { @apply border-l-4 border-blue-300 p-4 my-4; } - div.blog-wrapper a { + div.journal-wrapper a { @apply underline hover:text-blue-300; } - div.blog-wrapper p code { + div.journal-wrapper p code { @apply bg-[#191724] p-1; } diff --git a/src/components/navbar.svelte b/src/components/navbar.svelte index 17a3721..4b68793 100644 --- a/src/components/navbar.svelte +++ b/src/components/navbar.svelte @@ -11,8 +11,8 @@

About

- -

Blog

+
+

Journal

diff --git a/src/blog/Markdown Parser Edge Cases.md b/src/journal/Markdown Parser Edge Cases.md similarity index 99% rename from src/blog/Markdown Parser Edge Cases.md rename to src/journal/Markdown Parser Edge Cases.md index a8313cf..57d9e45 100644 --- a/src/blog/Markdown Parser Edge Cases.md +++ b/src/journal/Markdown Parser Edge Cases.md @@ -18,7 +18,7 @@ Desc: Testing the markdown parser with various elements and edge cases. [This is an anchor](https://www.youtube.com), but this is not. -This is a blog post about something. It's really interesting. I hope you enjoy it. +This is a journal post about something. It's really interesting. I hope you enjoy it. # Markdown Quirks and Edge Cases diff --git a/src/blog/Neovim: A Robust Alternative to Visual Studio Code.md b/src/journal/Neovim: A Robust Alternative to Visual Studio Code.md similarity index 100% rename from src/blog/Neovim: A Robust Alternative to Visual Studio Code.md rename to src/journal/Neovim: A Robust Alternative to Visual Studio Code.md diff --git a/src/blog/Programming: From Gemini.md b/src/journal/Programming: From Gemini.md similarity index 100% rename from src/blog/Programming: From Gemini.md rename to src/journal/Programming: From Gemini.md diff --git a/src/routes/blog/+page.server.ts b/src/routes/journal/+page.server.ts similarity index 75% rename from src/routes/blog/+page.server.ts rename to src/routes/journal/+page.server.ts index b9108ca..ee490f2 100644 --- a/src/routes/blog/+page.server.ts +++ b/src/routes/journal/+page.server.ts @@ -1,7 +1,7 @@ import { readdirSync, readFileSync } from 'fs'; -// Location of the blogs, all md files should be placed here -const blog_path = process.cwd().concat('/src', '/blog'); +// Location of the posts, all md files should be placed here +const journal_path = process.cwd().concat('/src', '/journal'); /** * The post object for use in the page. @@ -21,9 +21,9 @@ type Post = { export const load = async () => { const posts: Post[] = []; - // Read all the files names in the blog directory. - readdirSync(blog_path).forEach(file => { - const content: string = readFileSync(blog_path.concat('/', file), 'utf-8'); + // Read all the files names in the journal directory. + readdirSync(journal_path).forEach(file => { + const content: string = readFileSync(journal_path.concat('/', file), 'utf-8'); // Date: 2025-02-24 -> date object // Desc: ... -> description @@ -40,7 +40,7 @@ export const load = async () => { // Create the post const post: Post = { title: file.split('.')[0], - path: '/blog'.concat('/', file.split('.')[0]), + path: '/journal'.concat('/', file.split('.')[0]), date, description } diff --git a/src/routes/blog/+page.svelte b/src/routes/journal/+page.svelte similarity index 89% rename from src/routes/blog/+page.svelte rename to src/routes/journal/+page.svelte index a0d9e5e..c05af78 100644 --- a/src/routes/blog/+page.svelte +++ b/src/routes/journal/+page.svelte @@ -13,9 +13,9 @@
-

Blog Posts.

+

Journal.

- Here you can find a list of all the blog posts I have written. Some of them are about my + Here you can find my journal where I write all kinds of tech-related things. Some of them are about my projects, some are about my thoughts, and some are about my experiences. I hope you enjoy!

diff --git a/src/routes/blog/[title]/+page.server.ts b/src/routes/journal/[title]/+page.server.ts similarity index 91% rename from src/routes/blog/[title]/+page.server.ts rename to src/routes/journal/[title]/+page.server.ts index 701adde..b1c5135 100644 --- a/src/routes/blog/[title]/+page.server.ts +++ b/src/routes/journal/[title]/+page.server.ts @@ -8,14 +8,14 @@ import hljs from 'highlight.js'; const cwd = process.cwd(); /** - * Load the blog post from the file system when the page is requested. + * Load the journal post from the file system when the page is requested. * @param {RequestEvent} event */ export const load = async ({ url }: RequestEvent) => { // Create the path // ./src/[url].md - const blogPath = cwd.concat("/src", url.pathname, ".md"); - const cleanPath = blogPath.replaceAll("%20", " "); + const journalPath = cwd.concat("/src", url.pathname, ".md"); + const cleanPath = journalPath.replaceAll("%20", " "); // Read the file and get the data let content: string = ""; diff --git a/src/routes/blog/[title]/+page.svelte b/src/routes/journal/[title]/+page.svelte similarity index 88% rename from src/routes/blog/[title]/+page.svelte rename to src/routes/journal/[title]/+page.svelte index 1764378..18a00a9 100644 --- a/src/routes/blog/[title]/+page.svelte +++ b/src/routes/journal/[title]/+page.svelte @@ -7,7 +7,7 @@ {#if data.post.error} {:else} -
+
{@html data.post.content}
{/if}