diff --git a/Jenkinsfile b/Jenkinsfile
deleted file mode 100644
index 032b115..0000000
--- a/Jenkinsfile
+++ /dev/null
@@ -1,42 +0,0 @@
-pipeline {
- agent { docker { image 'httpd' } }
- stages {
- stage('build') {
- steps {
- sh 'echo "building"'
- sh 'id'
- sh "cd scripts ; bash -x ./build-website.sh"
- sh "su - root -c apachectl restart"
- }
- }
- stage('test') {
- steps {
- sh 'echo "testing"'
- input "Testing complete. Proceed to deployment?"
- }
- }
- stage('deploy') {
- steps {
- sh 'echo "deploying"'
- }
- }
- }
- post {
- always {
- echo 'This will always run'
- }
- success {
- echo 'This will run only if successful'
- }
- failure {
- echo 'This will run only if failed'
- }
- unstable {
- echo 'This will run only if the run was marked as unstable'
- }
- changed {
- echo 'This will run only if the state of the Pipeline has changed'
- echo 'For example, if the Pipeline was previously failing but is now successful'
- }
- }
-}
diff --git a/blog/.data.json b/blog/.data.json
new file mode 100644
index 0000000..740b3b2
--- /dev/null
+++ b/blog/.data.json
@@ -0,0 +1,87 @@
+{"data":[
+ {
+ "title":"The First Entry",
+ "published_date":"Thu, 20 Jun 2019 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-000"
+ },
+ {
+ "title":"The Migration",
+ "published_date":"Wed, 07 Aug 2019 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-001"
+ },
+ {
+ "title":"Configuring Dynamic DNS Records",
+ "published_date":"Thu, 29 Aug 2019 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-002"
+ },
+ {
+ "title":"? Matched Expression Does Not Match in Perl",
+ "published_date":"Wed, 18 Sep 2019 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-003"
+ },
+ {
+ "title":"The SBC Change",
+ "published_date":"Mon, 02 Mar 2020 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-004"
+ },
+ {
+ "title":"A Hit of Kubernetes",
+ "published_date":"Thu, 21 May 2020 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-005"
+ },
+ {
+ "title":"Optimizing Web Pages and File Sizes",
+ "published_date":"Fri, 22 May 2020 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-006"
+ },
+ {
+ "title":"Some Website Design and CSS",
+ "published_date":"Mon, 08 Jun 2020 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-007"
+ },
+ {
+ "title":"Git and Bash The Site",
+ "published_date":"Thu, 02 Jul 2020 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-008"
+ },
+ {
+ "title":"A Birth In The Family",
+ "published_date":"Sun, 26 Jul 2020 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-009"
+ },
+ {
+ "title":"Programming Anxiety",
+ "published_date":"Thu, 13 Aug 2020 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-010"
+ },
+ {
+ "title":"LXC and Friends",
+ "published_date":"Thu, 20 Aug 2020 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-011"
+ },
+ {
+ "title":"Migrating Everything to Proxmox - Part 1",
+ "published_date":"Mon, 30 Nov 2020 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-012"
+ },
+ {
+ "title":"A Brief Goodbye to CentOS",
+ "published_date":"Wed, 09 Dec 2020 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-013"
+ },
+ {
+ "title":"A Walk Along The Side",
+ "published_date":"Tue, 27 Jul 2021 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-014"
+ },
+ {
+ "title":"A Taste of Progress",
+ "published_date":"Sat, 23 Oct 2021 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-015"
+ },
+ {
+ "title":"Fighting With The Past",
+ "published_date":"Sat, 29 Mar 2022 00:00:00 +0800",
+ "guid":"https://www.clementchiew.me/blog/blog-016"
+ }
+]}
diff --git a/blog/.rss.item.template b/blog/.rss.item.template
new file mode 100644
index 0000000..cfff709
--- /dev/null
+++ b/blog/.rss.item.template
@@ -0,0 +1,10 @@
+
I am an avid user of RSS and I love my RSS app to death. It brings me a steady stream of news and information every day from the sources that I personally curate; a stream uncorrupted by the ad-funded Internet we have now. It is my breath of fresh air every morning before I suit up with adblockers and venture into the cancer-ridden wasteland of ads and content filler. The premise was simple: no-BS news fully in text with some images sprinkled in. Every article does not waste your time or attention. If need be, click the link at the bottom to read the full article. So a few months ago, an idea lit up in my mind and I thought "Gee, wouldn't it be neat if my website was readable via RSS?" and I got to work.
+ +As with most endeavours, everything seemed simple on the surface. Browsing through the RSS specifications, everything looked fine and dandy. A RSS feed is just an itemized list of your latest posts alongside some metadata about your site. Just generate a new XML file after every new post and serve it, and you're set for the day, right? Oh, how wrong I was.
+ +To put it simply, my posts are handwritten in HTML and are not dynamically generated with some CMS. This means that I have to find a way to convert HTML to a XML-kosher format somehow. Thus the hunt begun. In the end, I found Tidy, a tool that can clean up my messy HTML documents to XHTML. XHTML is XML-friendly, but it wasn't the end-all. I only needed the body, not the metadata. This was easily achievable with xmllint and XPATH. With the body prepped and ready, the tricky part is that while syntactically-comformant, HTML tags do not work. I wrapped the body as a CDATA section and went by my way.
+ +The last piece of the puzzle was the metadata for the posts. I went with a JSON file as a temporary databases for the posts, but this is a solution that is bound to bite me back in the future, but who cares about future me right? It works. The duct tape will do for now.
+ +These 3 paragraphs took me weeks to read up about XML and RSS and thinking about the solution. While it works, this is less than ideal. I will be wrangling 3 data formats with a Bash script that is becoming increasingly unwieldy. Reading up XML has also enlightened, if not misguided, me that I need write with XML documents moving forward. If not redesigned, this issue is a ticking bomb waiting to blow up in my face. Time to think really hard. Thanks for reading.
diff --git a/blog/quote-016 b/blog/quote-016 new file mode 100644 index 0000000..5743adb --- /dev/null +++ b/blog/quote-016 @@ -0,0 +1,5 @@ ++No man ever steps in the same river twice, for it's not the same river and he's not the same man. +diff --git a/index.html b/index.html index 08ff0ce..e10faef 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@ name="viewport" content="width=device-width, initial-scale=1">
+- Heraclitus +
I'm current a professional services engineer working at Napier Technologies. I experiment and develop my skills on the Linux infrastructure. I currently self-host this website, Gitea, and others. Do look up my blog to see what am I currently working on or view my CV to get more infomation.
+I'm current a cloud engineer working at Cloud Mile. I experiment and develop my skills on the Linux infrastructure. I currently self-host this website, Gitea, and others. Do look up my blog to see what am I currently working on or view my CV to get more infomation.
I play video games, watch movies/anime, and cook. I love having a warm cup of coffee before starting work. My top 3 favourite movies are Up, Interstellar, and Avengers: Endgame. But really, I spend most of my time grinding away at the lab.
diff --git a/scripts/build-website.sh b/scripts/build-website.sh index 1768470..9e24c3e 100755 --- a/scripts/build-website.sh +++ b/scripts/build-website.sh @@ -3,46 +3,91 @@ # just gonna assume you're executing in the scripts folder # build the blog files -cd ../blog -CONTENTNUM=$(($(ls content-* | wc -l)-1)) -for ((i=-1;i<$CONTENTNUM;i++)) +cd ../blog || exit +CONTENTNUM=$(($( find . -type f -name "content-*" | wc -l)-1)) +for ((i=-1;i