Browse Source

Initial commit.

master
h34ting4ppliance 10 months ago
commit
b2ff6378b8
10 changed files with 170 additions and 0 deletions
  1. +1
    -0
      .gitignore
  2. +113
    -0
      buildsite
  3. +6
    -0
      footer.html
  4. +28
    -0
      header.html
  5. +6
    -0
      src/a.md
  6. +5
    -0
      src/changes.md
  7. +5
    -0
      src/index.md
  8. +4
    -0
      src/r.md
  9. +1
    -0
      static/assets/ayyyy.txt
  10. +1
    -0
      static/poggers.txt

+ 1
- 0
.gitignore View File

@ -0,0 +1 @@
out/

+ 113
- 0
buildsite View File

@ -0,0 +1,113 @@
#!/bin/sh
#
# Builds the website.
#
extract () {
files=""
directories=""
paths=""
while read -r line; do
fn="${line##*/}"
dr="${line%%$fn}"
dr="${dr##./src/}"
fn="${fn%%'.md'}"
files="${files}${fn}
"
directories="${directories}${dr}
"
paths="${paths}${dr}${fn}
"
done
case "$1" in
"d")
printf "$directories" ;;
"f")
printf "$files" ;;
"p")
printf "$paths" ;;
esac
}
mk_templates () {
paths=$( find ./src/ -type f -name "*.md" )
printf "$paths\n" | extract d | {
while read -r line; do
mkdir -p "./out/$line"
done
}
printf "$paths\n" | extract p | {
while read -r line; do
cat header.html > ./out/$line.html
markdown2 ./src/$line.md >> ./out/$line.html
cat footer.html >> ./out/$line.html
done
}
}
cp_static () {
cp -r ./static/* ./out/
}
eee () {
paths=$( find ./src/ -type f -name "*.md" )
printf "$paths\n"
printf "$paths\n" | extract p
}
usage () {
cat << EOF
Usage: buildsite [CWD] [OPTIONS]...
Options:
-s only copy static files
-m only render markdown
-h display this epic usage message
CWD is the root where all files are stored.
EOF
}
main () {
todo="a"
cwd=""
while [ "$1" != "" ]; do
case "$1" in
"-s")
todo="s" ;;
"-m")
todo="m" ;;
"-h")
usage
exit 0 ;;
*)
if [ -z "$cwd" ]; then
cwd="$1"
else
usage
exit 1
fi
;;
esac
shift 1
done
[ -z "$cwd" ] || cd $cwd
case "$todo" in
"a")
cp_static
mk_templates
;;
"s")
cp_static
;;
"m")
mk_templates
;;
esac
}
main $@

+ 6
- 0
footer.html View File

@ -0,0 +1,6 @@
</div>
<hr>
<span style="font-family: monospace; font-weight: bold">-- EOF --</span>
</body>
</html>

+ 28
- 0
header.html View File

@ -0,0 +1,28 @@
<html>
<head>
<title>Matthilde's Home</title>
<style>
body
{
margin: 10%;
text-align: center;
}
div#content
{
max-width: 700px;
margin-top: 30px;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
}
</style>
</head>
<body>
<h1>Matthilde's Home Page</h1>
<h3 style="font-weight: normal"><i>Welcome, sit down and get comfi uwu</i></h3>
<hr>
<h3 style="font-weight: normal">[ <a href="/">Home</a> | <a href="/a.html">About</a> | <a href="/b/">Blog</a> | <a href="/r.html">Rice</a> | <a href="/p.html">Portfolio</a> ]</p></h4>
<div id="content">

+ 6
- 0
src/a.md View File

@ -0,0 +1,6 @@
# About me
I am a 16 years old computer hobbyist and professional procrastinator. I like programming.
- [GitHub Profile](https://www.github.com/h34ting4ppliance)
- [Self-hosted Gitea](https://git.h3liu.ml)

+ 5
- 0
src/changes.md View File

@ -0,0 +1,5 @@
# Why did you changed it again
Simply because I tried to make something cool in the previous version of my website. Turns out it looked like shit so I went back to a more simple design.
Also no more Bludit for the blog. It now uses a static blog generator I have wrote in POSIX shell script. Hope you will finally enjoy the website experience kek.

+ 5
- 0
src/index.md View File

@ -0,0 +1,5 @@
# Welcome to my site
This is the 4th time I redesign my website and I hope this is gonna be the last time for a while that I redesign it.
[why lol](changes.html)

+ 4
- 0
src/r.md View File

@ -0,0 +1,4 @@
# Rice
Ok so here is my rice:
![Rice](/assets/rice.png)

+ 1
- 0
static/assets/ayyyy.txt View File

@ -0,0 +1 @@
AYyyyyyyyyyyyyyy

+ 1
- 0
static/poggers.txt View File

@ -0,0 +1 @@
Yo

Loading…
Cancel
Save