diff --git a/.env.local b/.env.local new file mode 100644 index 0000000..16a39a4 --- /dev/null +++ b/.env.local @@ -0,0 +1 @@ +NEXT_PUBLIC_BLOG_OWNER=Rattatwinko \ No newline at end of file diff --git a/posts/welcome.md b/posts/welcome.md index 9a9aa83..594a494 100644 --- a/posts/welcome.md +++ b/posts/welcome.md @@ -1,5 +1,5 @@ --- -title: "Welcome to My Blog" +title: "Read Me . Markdown!" date: "2025-05-17" tags: ["welcome", "introduction"] summary: "Read Me Please" @@ -7,56 +7,72 @@ summary: "Read Me Please" # Welcome to the Blog -This Blog was built as a response to the lack of blogging systems that accept "Human readable" Formats that are editable in a Terminal Emulator. +This blog was built as a response to the lack of blogging systems that accept "human readable" formats editable in a terminal emulator. -**Prequesits:** - - NPM - - Docker (optional) +**Prerequisites:** +- NPM +- Docker (optional) -Thats about it. +That's about it. -## Formating: +--- -Standard Markdown is supported. HTML with some basic CSS too! External CSS Files arent Supported JavaScript files arent supported too. (This will not be supported in the Future as it is a safety risk.) +## Formatting + +Standard Markdown is supported. HTML with some basic CSS too! External CSS files aren't supported. JavaScript files aren't supported either (and won't be in the future, as it's a safety risk). **This is _Markdown_!** | Option | Description | | ------ | ----------- | -| data | path to data files to supply the data that will be passed into templates. | -| engine | engine to be used for processing templates. Handlebars is the default. | -| ext | extension to be used for dest files. | +| data | Path to data files to supply the data that will be passed into templates. | +| engine | Engine to be used for processing templates. Handlebars is the default. | +| ext | Extension to be used for destination files. | -HTML: +

If you noticed data was blue! This works due to the HTML / CSS / Markdown Transpiler. This basically means you can embed HTML into your Markdown blog-styled posts, and it will interpret correctly!

-

Hello from HTML

+**HTML Example:** + +

Hello from HTML

+ +Heres the fancy **source code** for the **interrested**: ```html -

Hello from HTML

+

Hello from HTML

``` -## Some technical Information: +--- -For the development I used: +## Some Technical Information + +For development, I used: - Docker - TypeScript -- Next.JS -- Git (ofc) +- Next.js +- Git (of course) -## Building: +--- + +## Building If you are deploying this on your machine for whatever reason, please note: -- Docker Building is fully implemented and supported - - Docker will deploy this app to Port 8080 (http://localhost:8080) -- If you run this with: +- Docker building is fully implemented and supported. + - Docker will deploy this app to port 8080 (http://localhost:8080) +- If you run this with: + ```sh npm install && npm run dev # or production (if you're fancy enough to deal with it) ``` -- note that the build times will take like 10 Years. Docker takes ages too , but once built it can recover shit from the cache. So its faster by a TON. + +- Note that the build times will take a while. Docker takes ages too, but once built it can recover stuff from the cache, so it's much faster after the first build. + +--- ## Administration -If you are a Admin then the default password / user is +

Please set your name (or not) in @.env.local! Before deploying this to Docker!

+ +If you are an admin, then the default username and password are: ``` user: admin @@ -64,14 +80,39 @@ password: admin ``` > [!CAUTION] -> Change the Administration Password once the Server is set up. This is really easy! -> The server will store your password in a Hash. So be carefull of people getting that Hash. +> Change the administration password once the server is set up. This is really easy! +> The server will store your password as a hash. So be careful of people getting that hash. --- -You can pin a Post both in the UI and in the Backend of the Server. +You can pin a post both in the UI and in the backend of the server. ```sh /path/to/your/instance/posts/pinned.json ``` +--- + +## TODO + +| Status | Task | +|:------:|:----:| +|NOT DONE!|GitHub's Caution/Error Stuff| + +--- + +## Issues + +If any issues pop up, please open a Gitea issue with **proper** error reports! + +--- + +## Closing Statements + +Developing of this Applet has been really fun! Thanks JavaScript for fucking my ass harder than , eh ... idk , im gay, i cant make jokes about this. +Yeah fuck JavaScript, TypeScript is better. + + +- Thanks Rattatwinko ; 17.05.2025 + + \ No newline at end of file diff --git a/src/app/api/admin/posts/route.ts b/src/app/api/admin/posts/route.ts index f9a001b..156e908 100644 --- a/src/app/api/admin/posts/route.ts +++ b/src/app/api/admin/posts/route.ts @@ -22,6 +22,7 @@ export async function POST(request: Request) { date, tags, summary, + author: process.env.NEXT_PUBLIC_BLOG_OWNER + "'s" || 'Anonymous', }); // Write the file diff --git a/src/app/api/admin/upload/route.ts b/src/app/api/admin/upload/route.ts index 5d46156..9b8e11a 100644 --- a/src/app/api/admin/upload/route.ts +++ b/src/app/api/admin/upload/route.ts @@ -44,6 +44,7 @@ export async function POST(request: Request) { date: data.date || new Date().toISOString().split('T')[0], tags: data.tags || [], summary: data.summary || '', + author: process.env.NEXT_PUBLIC_BLOG_OWNER + "'s" || 'Anonymous', }); } catch (error) { console.error('Error uploading file:', error); diff --git a/src/app/api/posts/[slug]/route.ts b/src/app/api/posts/[slug]/route.ts index 8f35e58..1913760 100644 --- a/src/app/api/posts/[slug]/route.ts +++ b/src/app/api/posts/[slug]/route.ts @@ -39,6 +39,7 @@ async function getPostBySlug(slug: string) { summary: data.summary, content: processedContent.toString(), createdAt: createdAt.toISOString(), + author: process.env.NEXT_PUBLIC_BLOG_OWNER + "'s" || 'Anonymous', }; } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index b6e0386..427ef08 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -9,9 +9,11 @@ import HeaderButtons from './HeaderButtons'; const inter = Inter({ subsets: ['latin'] }); +const blogOwner = process.env.NEXT_PUBLIC_BLOG_OWNER || 'Anonymous'; + export const metadata: Metadata = { - title: 'Sebastian Zinkls - Blog', - description: 'Ein Blog von Sebastian Zinkl, gebaut mit Next.js und Markdown', + title: `${blogOwner}'s Blog`, + description: `Ein Blog von ${blogOwner}, gebaut mit Next.js und Markdown`, }; const PersonIcon = ( diff --git a/src/app/page.tsx b/src/app/page.tsx index 86c3f8a..5331f5a 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -87,7 +87,7 @@ export default function Home() { return (
-

Sebastian Zinkls - Blog

+

{process.env.NEXT_PUBLIC_BLOG_OWNER + "'s" || 'Anonymous'} - Blog