FIX: Rename from blog to journal.
Will switch branch names now too.
This commit is contained in:
parent
3623c48c54
commit
80b5161c24
@ -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.
|
> 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
|
However, before you begin writing, you must first add the following two lines at the top of the
|
||||||
new markdown file:
|
new markdown file:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Date: YYYY-MM-DD
|
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.
|
displaying and parsing the post.
|
||||||
|
|||||||
48
src/app.css
48
src/app.css
@ -4,77 +4,77 @@
|
|||||||
/* This is very painful. There must be a better way. */
|
/* This is very painful. There must be a better way. */
|
||||||
@layer base {
|
@layer base {
|
||||||
|
|
||||||
div.blog-wrapper h1,
|
div.journal-wrapper h1,
|
||||||
div.blog-wrapper h2,
|
div.journal-wrapper h2,
|
||||||
div.blog-wrapper h3,
|
div.journal-wrapper h3,
|
||||||
div.blog-wrapper h4,
|
div.journal-wrapper h4,
|
||||||
div.blog-wrapper h5,
|
div.journal-wrapper h5,
|
||||||
div.blog-wrapper h6 {
|
div.journal-wrapper h6 {
|
||||||
@apply text-gray-300 px-4;
|
@apply text-gray-300 px-4;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.blog-wrapper p,
|
div.journal-wrapper p,
|
||||||
div.blog-wrapper ul,
|
div.journal-wrapper ul,
|
||||||
div.blog-wrapper ol,
|
div.journal-wrapper ol,
|
||||||
div.blog-wrapper table {
|
div.journal-wrapper table {
|
||||||
@apply text-gray-400 text-sm px-4 py-2;
|
@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;
|
@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;
|
@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;
|
@apply border border-gray-300 p-2 text-sm;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.blog-wrapper ul {
|
div.journal-wrapper ul {
|
||||||
@apply list-disc list-outside;
|
@apply list-disc list-outside;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.blog-wrapper ol {
|
div.journal-wrapper ol {
|
||||||
@apply list-decimal list-inside;
|
@apply list-decimal list-inside;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.blog-wrapper h1 {
|
div.journal-wrapper h1 {
|
||||||
@apply text-3xl font-bold py-6;
|
@apply text-3xl font-bold py-6;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.blog-wrapper h2 {
|
div.journal-wrapper h2 {
|
||||||
@apply text-xl font-bold p-4;
|
@apply text-xl font-bold p-4;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.blog-wrapper h3 {
|
div.journal-wrapper h3 {
|
||||||
@apply text-lg font-bold p-4;
|
@apply text-lg font-bold p-4;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.blog-wrapper h4 {
|
div.journal-wrapper h4 {
|
||||||
@apply text-lg py-2;
|
@apply text-lg py-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.blog-wrapper h6 {
|
div.journal-wrapper h6 {
|
||||||
@apply text-xs text-gray-400;
|
@apply text-xs text-gray-400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
div.blog-wrapper p {
|
div.journal-wrapper p {
|
||||||
@apply text-sm;
|
@apply text-sm;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.blog-wrapper blockquote {
|
div.journal-wrapper blockquote {
|
||||||
@apply border-l-4 border-blue-300 p-4 my-4;
|
@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;
|
@apply underline hover:text-blue-300;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.blog-wrapper p code {
|
div.journal-wrapper p code {
|
||||||
@apply bg-[#191724] p-1;
|
@apply bg-[#191724] p-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,8 +11,8 @@
|
|||||||
<a href="/about" class="transition-all duration-150 hover:text-blue-300">
|
<a href="/about" class="transition-all duration-150 hover:text-blue-300">
|
||||||
<p class="px-3">About</p>
|
<p class="px-3">About</p>
|
||||||
</a>
|
</a>
|
||||||
<a href="/blog" class="transition-all duration-150 hover:text-blue-300">
|
<a href="/journal" class="transition-all duration-150 hover:text-blue-300">
|
||||||
<p class="px-3">Blog</p>
|
<p class="px-3">Journal</p>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/Azpect3120" target="_blank" class="">
|
<a href="https://github.com/Azpect3120" target="_blank" class="">
|
||||||
<svg viewBox="0 0 98 96" xmlns="http://www.w3.org/2000/svg" class="mx-4 h-auto w-6">
|
<svg viewBox="0 0 98 96" xmlns="http://www.w3.org/2000/svg" class="mx-4 h-auto w-6">
|
||||||
|
|||||||
@ -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 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
|
# Markdown Quirks and Edge Cases
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { readdirSync, readFileSync } from 'fs';
|
import { readdirSync, readFileSync } from 'fs';
|
||||||
|
|
||||||
// Location of the blogs, all md files should be placed here
|
// Location of the posts, all md files should be placed here
|
||||||
const blog_path = process.cwd().concat('/src', '/blog');
|
const journal_path = process.cwd().concat('/src', '/journal');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The post object for use in the page.
|
* The post object for use in the page.
|
||||||
@ -21,9 +21,9 @@ type Post = {
|
|||||||
export const load = async () => {
|
export const load = async () => {
|
||||||
const posts: Post[] = [];
|
const posts: Post[] = [];
|
||||||
|
|
||||||
// Read all the files names in the blog directory.
|
// Read all the files names in the journal directory.
|
||||||
readdirSync(blog_path).forEach(file => {
|
readdirSync(journal_path).forEach(file => {
|
||||||
const content: string = readFileSync(blog_path.concat('/', file), 'utf-8');
|
const content: string = readFileSync(journal_path.concat('/', file), 'utf-8');
|
||||||
|
|
||||||
// Date: 2025-02-24 -> date object
|
// Date: 2025-02-24 -> date object
|
||||||
// Desc: ... -> description
|
// Desc: ... -> description
|
||||||
@ -40,7 +40,7 @@ export const load = async () => {
|
|||||||
// Create the post
|
// Create the post
|
||||||
const post: Post = {
|
const post: Post = {
|
||||||
title: file.split('.')[0],
|
title: file.split('.')[0],
|
||||||
path: '/blog'.concat('/', file.split('.')[0]),
|
path: '/journal'.concat('/', file.split('.')[0]),
|
||||||
date,
|
date,
|
||||||
description
|
description
|
||||||
}
|
}
|
||||||
@ -13,9 +13,9 @@
|
|||||||
|
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="my-8 w-1/2">
|
<div class="my-8 w-1/2">
|
||||||
<h1 class="font-mono text-6xl font-[900] text-blue-300">Blog Posts.</h1>
|
<h1 class="font-mono text-6xl font-[900] text-blue-300">Journal.</h1>
|
||||||
<p class="my-5 py-2 text-gray-200 italic">
|
<p class="my-5 py-2 text-gray-200 italic">
|
||||||
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!
|
projects, some are about my thoughts, and some are about my experiences. I hope you enjoy!
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@ -8,14 +8,14 @@ import hljs from 'highlight.js';
|
|||||||
const cwd = process.cwd();
|
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
|
* @param {RequestEvent} event
|
||||||
*/
|
*/
|
||||||
export const load = async ({ url }: RequestEvent) => {
|
export const load = async ({ url }: RequestEvent) => {
|
||||||
// Create the path
|
// Create the path
|
||||||
// ./src/[url].md
|
// ./src/[url].md
|
||||||
const blogPath = cwd.concat("/src", url.pathname, ".md");
|
const journalPath = cwd.concat("/src", url.pathname, ".md");
|
||||||
const cleanPath = blogPath.replaceAll("%20", " ");
|
const cleanPath = journalPath.replaceAll("%20", " ");
|
||||||
|
|
||||||
// Read the file and get the data
|
// Read the file and get the data
|
||||||
let content: string = "";
|
let content: string = "";
|
||||||
@ -7,7 +7,7 @@
|
|||||||
{#if data.post.error}
|
{#if data.post.error}
|
||||||
<NotFound message={data.post.error} />
|
<NotFound message={data.post.error} />
|
||||||
{:else}
|
{:else}
|
||||||
<div class="blog-wrapper prose">
|
<div class="journal-wrapper prose">
|
||||||
{@html data.post.content}
|
{@html data.post.content}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
Loading…
x
Reference in New Issue
Block a user