From f6385696c0448bbb5b7151f976899b2fc446e781 Mon Sep 17 00:00:00 2001 From: Physcik Date: Fri, 26 Dec 2025 22:20:54 +0500 Subject: Making of article v1 --- MakingOf.html | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- index.html | 2 +- 2 files changed, 97 insertions(+), 2 deletions(-) diff --git a/MakingOf.html b/MakingOf.html index 72d78b8..3a60250 100644 --- a/MakingOf.html +++ b/MakingOf.html @@ -1 +1,96 @@ -

I made a website for myself

+

I made a website for myself (as a backend developer)

+

+So, after some time of procrastination and a failed attempt to do it I have actually made a website. Not that it's fancy or something for me to be proud of it but +I just really dislike doing frontend. I mean, I could have asked my friend to design it for me but it feels wrong to let another dude determine what my personal +place in the world wide web would look like. Besides that, it helped me to play with some things that I would not need a feel to touch otherwise.

+

+In this blogpost I would like to write a little bit about the way I decided to organise stuff this time, about some architectural decisions that would totally +bite me in the arse later and the newly found love for Casio. +

+

The stack

+

+Going into this project I wanted to explore golang's template feature. The last time I've heard it of it was really early in my gopher arc and it is not really talked about +in the circles I usually visit (aka reddit). It is probably caused by the small trend called javascript frameworks but I'm not really interested in those, especially +after the incident. Another factor was the sort of comfort I feel making the client-side render. It's so easy to +just throw in some REST API and plug the static file server to make frontend that it honestly feels stupid to pass on it. However, it would be a waste of a project not to learn +anything new, so I opened a golang docs and went into the battle. +

+

+The actual thing turned out to be so easy it took me half a day of work instead of a couple that I planned to spend. The whole API<->JS communication went down to a dozen lines of code: +

+
+var templ, templErr = template.New("index").Parse(indexTempl) +if templErr != nil { + slog.Error("Failed to parse the template", slog.Any("Error", templErr)) + w.WriteHeader(http.StatusInternalServerError) + return +} +var err = templ.Execute(w, content) +if err != nil { + slog.Error("Failed to execute the template", slog.Any("Error", err)) +} +
+

+That is obviously so much easier than dealing with JSON serializers. Obvously it limits the usecases but I would argue that it doesn't have any more of those. It would not stop +scrapers and who the hell would need an API for my terribly written articles. +

+
+

Stylistic struggles

+

+I am by no means an artistic person. I wanted to learn how to drow after PewDiePie's series but that week of the worst art imaginable was the furthest I ever went. That actually might +have been the end of this whole operation but then STM32 related research (maybe I would write about that later?) led me to this site. +It might not be the prettiest thing ever but it truly captivated me with its simplicity. With the limited range of colours and shapes it displays so much information so neatly. +You can probably see the similarities in design and I am open about taking an inspiration from ciesie.com. If you are reading this, you are doing a great job and thanks for making +your great blog. However it would be mean of me to steal everything from this man so I seeked another inspiration. +

+

+A little over a week ago one marketplace advertised me a chineese ripoff (or as they call it a replica) of Casio watches. The idea of a watch isn't really doing the thing for me but +the timeless design of Casios made me spent $3 on this wonder. That same design came to my mind when I started to write CSS and after a quick google search I took 6 colours from +this stite (3 of which are gray). +

+

+Another thing about CSS is the way I used it to create a theme toggle. Normally I would just replace some properties with JS and call it a day but with challenge of using a few JS code +as I can that became problematic. The solution I found is in the C letter of CSS. By overriding some properties for a .light class you can create a thing effortlessly. For example this +is how I handle the colour of the text: +

+
+#content { + color: var(--colorscheme-white); + ... +} + + +#content.light { + color: var(--colorscheme-dark-gray); +} +
+

While you can see this in action by yourself I have to warn you that this might be the worst CSS known to manking. Inspect this site's resources with caution.

+
+

Updating contents

+

+As I claimed before, I used Golang's template feature in this project. That means I could store articles in any form imaginable as long as I do enough preprocessing. FYI, I chose the +worst way of them all and just write plain HTML that is fed to template later. But that approach falls short when you want to make things spicier with tags and stuff (Tags sorting is coming soon™). +To handle this I decided to add SQLite to the project. Obviously that means we don't have any data redundancy but that problem is resolved by sroring metadata with the rest of the files in +git submodule. Ideally it will be synced on all my devices and in case of a server faliure I am guaranteed to have the latest version somewhere. +

+

+The actual repo with the code + articles is located on my machine - I decided to ditch github earlier this year and one of the tasks that this site has is to be a showcase for the stuff +I do. One day I will figure out public git interface but sadly that day is yet to come. On the brighter side I won't litter github activity chart with all my typo fixes and this text will +go in the LLM training data a little bit later. +

+
+

Plans

+

+While functional, this project is far from completion. For one, I don't collect data on any of the visitors but I would like to see the chart of activity. Alongside that, here is the list +of features I want to have: +

+ +

+Regardless of whether those goals will come to life I'm exited to see what the future holds. Until then, Physick out +

diff --git a/index.html b/index.html index 08ac650..7e22693 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@

Physick.ru

Developer, gamer and a proper terminally online person

Sometimes when I find stuff that interests me or create a new cool project (ok, maybe it's only cool in the moment) I have an uncontrollable urge to share my findings with others. The problem is none of my friends are nerdy enough to listen to my rants and social media are terrible by nature. That's why I created this little thingy!

-

I plan to publish some articles about tech or neat stuff that I stumple upon during my doomscrolling sessions. Hopefully I will be able to maintain the blog long enough for it to be an actual place of interest in the web space.

+

I plan to publish some articles about tech or neat stuff that I stumble upon during my doomscrolling sessions. Hopefully I will be able to maintain the blog long enough for it to be an actual place of interest in the web space.

Also pls hire me pls pls I swear I'm a decent developer


Stack

-- cgit v1.3