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.
|
||||
|
||||
# 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.
|
||||
|
||||
48
src/app.css
48
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;
|
||||
}
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
<a href="/about" class="transition-all duration-150 hover:text-blue-300">
|
||||
<p class="px-3">About</p>
|
||||
</a>
|
||||
<a href="/blog" class="transition-all duration-150 hover:text-blue-300">
|
||||
<p class="px-3">Blog</p>
|
||||
<a href="/journal" class="transition-all duration-150 hover:text-blue-300">
|
||||
<p class="px-3">Journal</p>
|
||||
</a>
|
||||
<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">
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
}
|
||||
@ -13,9 +13,9 @@
|
||||
|
||||
<!-- Header -->
|
||||
<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">
|
||||
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!
|
||||
</p>
|
||||
</div>
|
||||
@ -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 = "";
|
||||
@ -7,7 +7,7 @@
|
||||
{#if data.post.error}
|
||||
<NotFound message={data.post.error} />
|
||||
{:else}
|
||||
<div class="blog-wrapper prose">
|
||||
<div class="journal-wrapper prose">
|
||||
{@html data.post.content}
|
||||
</div>
|
||||
{/if}
|
||||
Loading…
x
Reference in New Issue
Block a user