commit c809ead6450372bd8f83ae04eb3e3871a07ae793
parent 7f11ab79d2fc964a7d655b0a1261340f86897b6a
Author: emmett1 <emmett1.2miligrams@protonmail.com>
Date: Sun, 21 Sep 2025 14:44:26 +0800
new site
Diffstat:
16 files changed, 226 insertions(+), 159 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,2 +1 @@
-/public/
-md2html.sh
+*.html
diff --git a/README b/README
@@ -0,0 +1,9 @@
+welcome to my tiny website :D
+
+this site will be home for my 'computer life'. i have high enthusiast into computer, technology, software, operating system, most Linux :p
+
+so in here contains some details of me, if you need to contact me.
+
+also i'm gonna write some (not blog) guide, tips, tricks or notes for myself and i hope its gonna be usefull to other people too.
+
+enjoy :)
diff --git a/about.txt b/about.txt
@@ -0,0 +1,3 @@
+I’m a minimalist who likes keeping things simple and efficient. I have a deep love for technology, with a particular passion for Linux and all things open-source. Shell scripting is one of my favorite ways to automate and streamline tasks, and I enjoy finding creative solutions through code. When I'm not immersed in tech, you’ll find me listening to music, which is a constant source of inspiration and relaxation for me.
+
+“The only way to do great work is to love what you do.” – Steve Jobs
+\ No newline at end of file
diff --git a/contact.txt b/contact.txt
@@ -0,0 +1,5 @@
+you can contact me if you need anything.
+
+- email me at root@emmett1.my
+- usually I hangout at #crux #opencrux #krak3n (libera)
+- pm me at https://t.me/emmett1
diff --git a/footer b/footer
@@ -1,5 +0,0 @@
-<hr>
-<p>Copyright (C) Emmett1, 2024-2025</p>
-</div>
-</body>
-</html>
diff --git a/genhtml.sh b/genhtml.sh
@@ -1,39 +0,0 @@
-#!/bin/sh -e
-
-rm -rf public
-mkdir -p public
-
-if [ ! -f md2html.sh ]; then
- curl -LO https://codeberg.org/emmett1/md2html/raw/branch/main/md2html.sh || { rm -f md2html.sh; exit 1; }
-fi
-chmod +x md2html.sh
-
-# posts
-mkdir -p public/posts
-for i in posts/*.md; do
- echo "generating html for $i..."
- i=${i#*/}
- {
- sed "s/@TITLE@/posts/g" header
- ./md2html.sh posts/$i
- cat footer
- } > public/posts/${i%.md}.html
-done
-
-# top files
-for i in *.md; do
- echo "generating html for $i..."
- {
- title=${i%.md}
- case ${i%.md} in index) title=home; esac
- sed "s/@TITLE@/$title/g" header
- ./md2html.sh $i
- cat footer
- } > public/${i%.md}.html
-done
-
-if [ -d assets ]; then
- cp -ra assets public/
-fi
-
-exit 0
diff --git a/header b/header
@@ -1,73 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-<meta charset="UTF-8">
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<title>@TITLE@ - Emmett1's Space</title>
-<link rel="icon" href="assets/pixelfox.png" type="image/png">
-<style>
- body {
- font-family: monospace;
- font-size: 14px;
- line-height: 1.25;
- max-width: 60em;
- margin-left: auto;
- margin-right: auto;
- padding-left: 1em;
- padding-right: 1em;
- background-color: #242424;
- color: #fefefe;
- }
- pre {
- background-color: #2b2b2b;
- border-radius: 3px;
- padding: 10px;
- overflow-x: auto;
- }
- code {
- color: #f7f3d6;
- white-space: pre-wrap;
- }
- img {
- display: block;
- max-width: 100%;
- }
- hr {
- border: 0;
- border-top: 1px dashed #fefefe;
- margin: 20px 0;
- }
- table {
- width: 100%;
- border-collapse: collapse;
- }
- th, td {
- padding: 4px;
- }
- th {
- background-color: #221e1f;
- }
- table, th, td {
- border: 1px dashed #e7e8eb;
- }
- a {
- color: #90cbf9;
- text-decoration: none;
- }
- a:hover {
- color: #869edc;
- text-decoration: underline;
- }
- blockquote {
- font-family: monospace;
- font-style: italic;
- margin-left: 1em;
- padding-left: 1em;
- }
-</style>
-</head>
-<body>
-<div class="centered-wrapper">
-<h1>@TITLE@</h1>
-<a href="/">home</a> / <a href="/posts">posts</a> / <a href="/links.html">links</a> / <a href="https://git.emmett1.my">git</a> / <a href="/pub">pub</a>
-<hr>
diff --git a/index.md b/index.md
@@ -1,29 +0,0 @@
-about me
---------
-
-I’m a minimalist who likes keeping things simple and efficient. I have a deep love for technology, with a particular passion for Linux and all things open-source. Shell scripting is one of my favorite ways to automate and streamline tasks, and I enjoy finding creative solutions through code. When I'm not immersed in tech, you’ll find me listening to music, which is a constant source of inspiration and relaxation for me.
-
->“The only way to do great work is to love what you do.” – Steve Jobs
-
-projects
---------
-
-- [https://krak3n.my](https://krak3n.my): a lightweight musl + clang + busybox linux distribution
-- [https://alicelinux.emmett1.my](https://alicelinux.emmett1.my): a minimal musl + clang + libressl + busybox based linux distribution
-- [https://venomlinux.org](https://venomlinux.org): a lightweight sourcebased linux distribution
-- [https://codeberg.org/emmett1/spm](https://codeberg.org/emmett1/spm): a simple package manager
-- [https://codeberg.org/emmett1/crux-musl](https://codeberg.org/emmett1/crux-musl): CRUX but musl instead of glibc
-
-contact
--------
-
-- email: root at emmett1 dot my
-- irc: emmett1 at #crux #opencrux #krak3n (libera)
-- telegram: [https://t.me/emmett1](https://t.me/emmett1)
-
-coffee
-------
-
-- [paypal](https://paypal.me/syazwanemmett)
-- [ko-fi](https://ko-fi.com/emmett1)
-- [buymeacoffee](https://buymeacoffee.com/emmett1)
diff --git a/index.sh b/index.sh
@@ -0,0 +1,186 @@
+#!/bin/sh
+# index.sh - generate index.html for current directory
+
+humansize() {
+ size=$1
+ if [ "$size" -lt 1024 ]; then
+ echo "${size} B"
+ elif [ "$size" -lt $((1024*1024)) ]; then
+ awk "BEGIN { printf \"%.1f KB\", $size/1024 }"
+ elif [ "$size" -lt $((1024*1024*1024)) ]; then
+ awk "BEGIN { printf \"%.1f MB\", $size/1024/1024 }"
+ else
+ awk "BEGIN { printf \"%.1f GB\", $size/1024/1024/1024 }"
+ fi
+}
+
+genhtml() {
+ OUTPUT="index.html"
+
+ title=$([ -f about.txt ] && echo home || echo ${PWD##*/})
+
+ {
+ echo "<!DOCTYPE html>"
+ echo "<html lang=\"en\">"
+ echo "<head>"
+ echo " <meta charset=\"UTF-8\">"
+ echo " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">"
+ echo " <title>$title | emmett1.my</title>"
+ echo " <link rel=\"icon\" href=\"/assets/pixelfox.png\" type=\"image/png\">"
+ echo " <style>
+ body { font-family: monospace; background: #1e1e1e; color: #e0e0e0; margin: 0; padding: 1em; max-width: 60em; margin-left: auto; margin-right: auto; font-size: 14px; }
+ table { width: 100%; border-collapse: collapse; }
+ th { padding: 0.4em 0.6em; border-bottom: 1px solid #393939; font-size: 0.9em; text-align: left; }
+ td { padding: 0.4em 0.6em; border-bottom: 1px solid #2a2a2a; }
+ th.name, td.name { text-align: left; }
+ th.meta, td.meta { text-align: right; white-space: nowrap; }
+ td.meta .date { display: inline-block; min-width: 150px; margin-right: 12px; text-align: right; }
+ td.meta .size { display: inline-block; width: 80px; text-align: right; }
+ a { color: #4ea1ff; text-decoration: none; }
+ a:hover { text-decoration: underline; }
+ pre.readme { margin-top: 2em; padding: 1em; background: #2a2a2a; border-radius: 4px; white-space: pre-wrap; }
+ footer { margin-top: 2em; text-align: center; font-size: 0.9em; color: #888; }
+ code { background: #333; color: #ffcc66; padding: 0.1em 0.3em; border-radius: 3px; font-family: monospace; }
+ pre code { background: none; color: inherit; padding: 0; border-radius: 0; }
+ @media (max-width: 600px) {
+ thead { display: none; }
+ tbody tr { display: block; padding: 0.6em 0; border-bottom: 1px solid #2a2a2a; }
+ td { display: block; border: none; padding: 0.2em 0; }
+ td.name { font-weight: 600; }
+ td.meta { display: flex; justify-content: space-between; font-size: 0.9em; color: #bbb; }
+ td.meta .date, td.meta .size { min-width: 0; margin: 0; width: auto; text-align: left; }
+ }
+ </style>"
+ echo "</head>"
+ echo "<body>"
+ echo "<h1>index of $title</h1>"
+ echo "<table>"
+ echo "<thead><tr><th class=\"name\">name</th><th class=\"meta\">last modified & size</th></tr></thead>"
+ echo "<tbody>"
+
+ # List files
+ for f in *; do
+ case $f in
+ *.html) continue;;
+ esac
+ [ "$f" = "." ] && continue
+ [ "$f" = ".." ] && continue
+ [ "$f" = "README" ] && continue
+ [ "$f" = "LICENSE" ] && continue
+ [ "$f" = "index.sh" ] && continue
+ [ "$f" = "assets" ] && continue
+
+ if [ -e "$f" ]; then
+ mod=$(date -r "$f" +"%Y-%m-%d %H:%M")
+ if [ -d "$f" ]; then
+ size="-"
+ else
+ bytes=$(stat -c%s "$f")
+ size=$(humansize "$bytes")
+ fi
+
+ if [ -f "$f" ] && echo "$f" | grep -qE '\.txt$'; then
+ txt_html="${f}.html"
+ {
+ echo "<!DOCTYPE html>"
+ echo "<html lang=\"en\">"
+ echo "<head>"
+ echo " <meta charset=\"UTF-8\">"
+ echo " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">"
+ echo " <title>$f | emmett1.my</title>"
+ cat <<'EOF'
+<style>
+ body { font-family: monospace; background: #1e1e1e; color: #e0e0e0; margin: 0; padding: 1em; max-width: 60em; margin-left: auto; margin-right: auto; font-size: 14px; }
+ a { color: #4ea1ff; text-decoration: none; }
+ a:hover { text-decoration: underline; }
+ pre { padding: 1em; background: #2a2a2a; border-radius: 4px; white-space: pre-wrap; }
+ footer { margin-top: 2em; text-align: center; font-size: 0.9em; color: #888; }
+ blockquote { margin: 0.5em 0; padding-left: 1em; border-left: 3px solid #4ea1ff; color: #ccc; }
+ img { max-width: 100%; margin: 0.5em 0; display: block; }
+ code { background: #333; color: #ffcc66; padding: 0.1em 0.3em; border-radius: 3px; font-family: monospace; }
+ pre code { background: none; color: inherit; padding: 0; border-radius: 0; }
+</style>
+EOF
+ echo "</head>"
+ echo "<body>"
+ echo "<h1>$f</h1>"
+ in_code=0
+ while IFS= read -r line || [ -n "$line" ]; do
+ if [ "$line" = '```' ]; then
+ if [ $in_code -eq 0 ]; then
+ printf '<pre><code>'
+ in_code=1
+ else
+ echo '</code></pre>'
+ in_code=0
+ fi
+ continue
+ fi
+
+ if [ $in_code -eq 1 ]; then
+ printf '%s\n' "$line" | sed -e 's/&/\&/g' -e 's/</\</g' -e 's/>/\>/g'
+ continue
+ fi
+
+ # Images
+ if printf '%s\n' "$line" | grep -q '!\['; then
+ line=$(printf '%s' "$line" | sed -E 's/!\[([^]]*)\]\(([^)]*)\)/<img src="\2" alt="\1">/g')
+ fi
+
+ # Blockquotes
+ if printf '%s\n' "$line" | grep -q '^>'; then
+ safe=$(printf '%s' "$line" | sed -e 's/&/\&/g' -e 's/</\</g' -e 's/>/\>/g')
+ line="<blockquote>${safe#> }</blockquote>"
+ fi
+
+ # Plain text (escape, inline code, URLs)
+ if ! echo "$line" | grep -qE '<(img|blockquote)'; then
+ line=$(printf '%s' "$line" | sed -e 's/&/\&/g' -e 's/</\</g' -e 's/>/\>/g')
+ line=$(printf '%s' "$line" | sed -E 's/`([^`]+)`/<code>\1<\/code>/g')
+ line=$(printf '%s' "$line" | sed -E 's#(https?://[^ ]+)#<a href="\1">\1</a>#g')
+ fi
+
+ # Preserve empty lines
+ if [ -z "$line" ]; then
+ echo "<br>"
+ else
+ echo "$line<br>"
+ fi
+ done < "$f"
+
+ echo "<footer><a href=\"index.html\">back to index</a> — generated by index.sh on $(date)</footer>"
+ echo "</body>"
+ echo "</html>"
+ } > "$txt_html"
+
+ echo "<tr><td class=\"name\"><a href=\"$txt_html\">$f</a></td><td class=\"meta\"><span class=\"date\">$mod</span><span class=\"size\">$size</span></td></tr>"
+ else
+ echo "<tr><td class=\"name\"><a href=\"$f\">$f$([ -d $f ] && echo /)</a></td><td class=\"meta\"><span class=\"date\">$mod</span><span class=\"size\">$size</span></td></tr>"
+ fi
+ fi
+ done
+
+ echo "</tbody>"
+ echo "</table>"
+
+ if [ -f README ]; then
+ echo "<pre class=\"readme\">"
+ cat README
+ echo "</pre>"
+ fi
+
+ echo "<footer>generated by index.sh on $(date)</footer>"
+ echo "</body>"
+ echo "</html>"
+ } > "$OUTPUT"
+}
+
+genhtml
+
+for d in *; do
+ [ -d "$d" ] || continue
+ (
+ cd "$d"
+ genhtml
+ )
+done
diff --git a/links.md b/links.md
@@ -1,8 +0,0 @@
-This is some interesting links for me, and you should have a look at it too :D
-
-- [https://blog.z3bra.org](https://blog.z3bra.org): monochromatic blog
-- [https://suckless.org](https://suckless.org): less suck softwares
-- [https://kisscommunity.org](https://kisscommunity.org): simple kiss linux distribution
-- [https://crux.nu](https://crux.nu): lightweight linux distribution
-- [https://github.com/oasislinux/oasis](https://github.com/oasislinux/oasis): a small statically-linked linux system
-- [https://arachsys.github.io/#linux-distribution](https://arachsys.github.io/#linux-distribution): a small linux distribution
-\ No newline at end of file
diff --git a/links.txt b/links.txt
@@ -0,0 +1,8 @@
+this is some interesting links for me, and you should have a look at it too :D
+
+- https://blog.z3bra.org
+- https://suckless.org
+- https://kisscommunity.org
+- https://crux.nu
+- https://github.com/oasislinux/oasis
+- https://arachsys.github.io/#linux-distribution
+\ No newline at end of file
diff --git a/posts.md b/posts.md
@@ -1,2 +0,0 @@
-coming soon
------------
diff --git a/posts/README b/posts/README
@@ -0,0 +1 @@
+here lies my notes, guide, tips, tricks or whatever people call it :D
+\ No newline at end of file
diff --git a/posts/introduction.md b/posts/introduction.md
diff --git a/posts/placebo.txt b/posts/placebo.txt
@@ -0,0 +1 @@
+just a dummy post file, will be removed when theres actual post soon.
+\ No newline at end of file
diff --git a/projects.txt b/projects.txt
@@ -0,0 +1,7 @@
+here some of my active projects
+
+- https://krak3n.my: a lightweight musl + clang + busybox linux distribution
+- https://alicelinux.emmett1.my: a minimal musl + clang + libressl + busybox based linux distribution
+- https://venomlinux.org: a lightweight sourcebased linux distribution
+- https://codeberg.org/emmett1/spm: a simple package manager
+- https://codeberg.org/emmett1/crux-musl: CRUX but musl instead of glibc
+\ No newline at end of file