init
This commit is contained in:
commit
483c8249e2
65
Makefile
Normal file
65
Makefile
Normal file
@ -0,0 +1,65 @@
|
||||
all: website fix-permissions
|
||||
|
||||
# Extensions:
|
||||
# th - template with html code
|
||||
# ph - page with html code
|
||||
# pm - page with markdown code
|
||||
# ps - page with shell code
|
||||
# pa - page with asciidoctor code
|
||||
|
||||
PH_FILES != find src -type f -name "*.ph" | sed 's|src/||g'
|
||||
PM_FILES != find src -type f -name "*.pm" | sed 's|src/||g'
|
||||
PS_FILES != find src -type f -name "*.ps" | sed 's|src/||g'
|
||||
PA_FILES != find src -type f -name "*.pa" | sed 's|src/||g'
|
||||
|
||||
STATIC_FILES = src/assets
|
||||
|
||||
$(PH_FILES):
|
||||
echo "Create: src/$@ => www/${@:S/ph/html/}"
|
||||
cat src/header.th > www/${@:S/ph/html/}
|
||||
cat src/$@ >> www/${@:S/ph/html/}
|
||||
cat src/footer.th >> www/${@:S/ph/html/}
|
||||
|
||||
$(PM_FILES):
|
||||
echo "Create: src/$@ => www/${@:S/pm/html/}"
|
||||
mkdir -p "$$(dirname www/${@})"
|
||||
cat src/header.th > www/${@:S/pm/html/}
|
||||
discount -f fencedcode src/$@ >> www/${@:S/pm/html/}
|
||||
cat src/footer.th >> www/${@:S/pm/html/}
|
||||
|
||||
$(PS_FILES):
|
||||
echo "Create: src/$@ => www/${@:S/ps/html/}"
|
||||
mkdir -p "$$(dirname www/${@})"
|
||||
cat src/header.th > www/${@:S/ps/html/}
|
||||
ksh src/$@ >> www/${@:S/ps/html/}
|
||||
cat src/footer.th >> www/${@:S/ps/html/}
|
||||
|
||||
$(PA_FILES):
|
||||
echo "Create: src/$@ => www/${@:S/pa/html/}"
|
||||
mkdir -p "$$(dirname www/${@})"
|
||||
cat src/header.th > www/${@:S/pa/html/}
|
||||
asciidoctor -e \
|
||||
-r asciidoctor-diagram \
|
||||
-a imagesdir=/tmp/adoc-tmp \
|
||||
-a stylesheet! \
|
||||
-a data-uri \
|
||||
-o - src/$@ >> www/${@:S/pa/html/}
|
||||
cat src/footer.th >> www/${@:S/pa/html/}
|
||||
|
||||
website: prepare copy-static-files $(PH_FILES) $(PM_FILES) $(PS_FILES) $(PA_FILES)
|
||||
|
||||
prepare:
|
||||
echo "Mkdir: www"
|
||||
mkdir -p www
|
||||
|
||||
copy-static-files: prepare
|
||||
rsync -r --partial --delete --out-format="Copy: src/%f => www/%f" $(STATIC_FILES) www/
|
||||
|
||||
clean:
|
||||
rm -rf www
|
||||
|
||||
fix-permissions: website
|
||||
chown -R sdk:www www
|
||||
chmod -R ug+Xrw www
|
||||
|
||||
|
1529
src/assets/style.css
Normal file
1529
src/assets/style.css
Normal file
File diff suppressed because it is too large
Load Diff
2
src/footer.th
Normal file
2
src/footer.th
Normal file
@ -0,0 +1,2 @@
|
||||
</body>
|
||||
</html>
|
6
src/header.th
Normal file
6
src/header.th
Normal file
@ -0,0 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>My Homepage</title>
|
||||
<link rel="stylesheet" href="https://classless.de/classless.css">
|
||||
</head>
|
||||
<body>
|
18
src/index.ps
Normal file
18
src/index.ps
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/ksh
|
||||
|
||||
echo "<h1>CODEVOID</h1>
|
||||
|
||||
<h2>Posts</h2>
|
||||
|
||||
<ol>"
|
||||
|
||||
cd src/posts
|
||||
ls -1 | while read line
|
||||
do
|
||||
echo "<li><a href=\"posts/${line%%.*}.html\">${line%%.*}</a></li>"
|
||||
done
|
||||
|
||||
|
||||
echo "</ol>"
|
||||
|
||||
|
14
src/posts/2023-10-22-Hello-World-md.pm
Normal file
14
src/posts/2023-10-22-Hello-World-md.pm
Normal file
@ -0,0 +1,14 @@
|
||||
# Hello World!
|
||||
|
||||
This is a test page written im Markdown. It's quite easy to write `code` examples.
|
||||
It even has code blocks
|
||||
|
||||
```
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
printf("Hello World!\n");
|
||||
return 0;
|
||||
}
|
||||
```
|
12
src/posts/2023-10-23-Hello-World-sh.ps
Normal file
12
src/posts/2023-10-23-Hello-World-sh.ps
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/ksh
|
||||
|
||||
echo "<h1>Hello World (shell version)</h1>"
|
||||
echo "This page is generated by a shell script."
|
||||
echo "<br><br>"
|
||||
echo "<b>Here's a tree:</b><br>"
|
||||
echo "<pre>"
|
||||
tree | while read line
|
||||
do
|
||||
echo "$line"
|
||||
done
|
||||
echo "</pre>"
|
34
src/posts/2023-10-24-Hello-World-adoc.pa
Normal file
34
src/posts/2023-10-24-Hello-World-adoc.pa
Normal file
@ -0,0 +1,34 @@
|
||||
= Hello World, adoc version!
|
||||
|
||||
Ahh, the full blown super duper asciidoctor with diagram support.
|
||||
|
||||
So, this:
|
||||
[source,graphviz]
|
||||
----
|
||||
[graphviz, "dot_example", "svg"]
|
||||
\----
|
||||
graph ethane {
|
||||
C_0 -- H_0 [type=s];
|
||||
C_0 -- H_1 [type=s];
|
||||
C_0 -- H_2 [type=s];
|
||||
C_0 -- C_1 [type=s];
|
||||
C_1 -- H_3 [type=s];
|
||||
C_1 -- H_4 [type=s];
|
||||
C_1 -- H_5 [type=s];
|
||||
\----
|
||||
----
|
||||
|
||||
Generates this:
|
||||
[graphviz, "dot_example", "svg"]
|
||||
----
|
||||
graph ethane {
|
||||
C_0 -- H_0 [type=s];
|
||||
C_0 -- H_1 [type=s];
|
||||
C_0 -- H_2 [type=s];
|
||||
C_0 -- C_1 [type=s];
|
||||
C_1 -- H_3 [type=s];
|
||||
C_1 -- H_4 [type=s];
|
||||
C_1 -- H_5 [type=s];
|
||||
}
|
||||
----
|
||||
|
Loading…
Reference in New Issue
Block a user