Skip to content

Commit 805909d

Browse files
committed
Make the github pages faster and add embed
1 parent b91a2e3 commit 805909d

6 files changed

Lines changed: 24 additions & 13 deletions

File tree

.github/workflows/wiiiikiiii.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ jobs:
2424
# Build job
2525
build:
2626
runs-on: ubuntu-latest
27-
container: nimlang/nim
2827
steps:
2928
- uses: actions/checkout@v4
30-
- name: Fix git config
29+
- name: Install wiki engine
3130
run:
32-
git config --global --add safe.directory "*"
31+
wget https://github.com/poggingfish/poggingfish.github.io/releases/download/wiki/wiiiikiiii
32+
chmod +x wiiiikiiii
3333
- name: Run wiiiikiiii
3434
run:
35-
nimble run
35+
./wiiiikiiii
3636
- name: Setup Pages
3737
id: pages
3838
uses: actions/configure-pages@v5

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
# Wiiiikiiii
2-
### A digital garden creation tool
1+
# pogging.fish
2+
3+
Source code for https://pogging.fish
4+
5+
Written in nim.
6+
7+
Install nim and run `nimble run` to build the wiki.

src/wiiiikiiii.nim

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ const donation = "<p><a href='https://bsky.app/profile/pogging.fish'>Follow me o
1212
const tmpl = readFile("wiki/templates/base.html")
1313
let meta = parseFile("wiki/meta.json")
1414

15-
proc applyTemplate(page: string, tags: string = "", date: string = "(meta pages have no date)"): string =
15+
proc applyTemplate(page: string, tags: string = "", date: string = "(meta pages have no date)", name = ""): string =
1616
return multireplace(tmpl,
1717
[("__varHtmlpage__var", page),
1818
("__varTags__var", tags),
1919
("__varCreationdate__var", date),
2020
("__varWikiName__var", pageName),
21+
("__varPageName__var", name),
2122
("__varDonate__var", donation)
2223
]
2324
)
@@ -28,7 +29,7 @@ proc getPostDate(i: string): int =
2829
return 19700101
2930
else:
3031
return d.getInt()
31-
32+
3233
proc customCmp(i: (string, string, string), i2: (string, string, string)): int =
3334
return cmp(
3435
getPostDate(i[0]),
@@ -68,7 +69,7 @@ proc main() =
6869
let basePath = filePath.changeFileExt(".html")
6970
let metadata = meta{string(basePath)}
7071
let original = readFile(string(i))
71-
let name = original.split("\n")[0].replace("#", "")
72+
let name = original.split("\n")[0].replace("#", "").strip()
7273
var tagstring = ""
7374
var first = true
7475
for tag_j in getPostTags(string(basePath)):
@@ -82,7 +83,7 @@ proc main() =
8283
let path = "generated/" & string(basePath)
8384
index.add((string(basePath), name, tagstring))
8485
let mdhtml = markdown(original)
85-
writeFile(string(path), applyTemplate(mdhtml, fmt"<p>{tagstring}</p>", fmt"{intToDate(getPostDate(string(basePath)))}"))
86+
writeFile(string(path), applyTemplate(mdhtml, fmt"<p>{tagstring}</p>", fmt"{intToDate(getPostDate(string(basePath)))}", name))
8687
# Create index page
8788
var indexhtml = "<h2>Looking for something specific? Do CTRL+F to find it!</h2>"
8889
indexhtml &= "tag listing: "
@@ -96,8 +97,8 @@ proc main() =
9697
for tag in getPostTags(i[0]):
9798
tags[tag.getStr()] &= createLink(i)
9899
for i in tags.keys():
99-
writeFile(fmt"generated/tags/{i}.html", applyTemplate(tags[i]))
100-
writeFile("generated/indexpage.html", applyTemplate(indexhtml))
100+
writeFile(fmt"generated/tags/{i}.html", applyTemplate(tags[i], name=i))
101+
writeFile("generated/indexpage.html", applyTemplate(indexhtml, name="Index"))
101102

102103

103104
when isMainModule:

wiki/pages/img/favicon.ico

15 KB
Binary file not shown.

wiki/pages/img/fish.png

28.8 KB
Loading

wiki/templates/base.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<link rel="stylesheet" href="/base.css">
7-
<title>__varWikiName__var</title>
7+
<link rel="icon" type="image/x-icon" href="/img/favicon.ico">
8+
<title>__varPageName__var - __varWikiName__var</title>
9+
<meta content="__varPageName__var" property="og:title" />
10+
<meta content="Read '__varPageName__var' on pogging.fish!" property="og:description" />
11+
<meta content="/img/fish.png" property="og:image" />
12+
<meta content="#43B581" data-react-helmet="true" name="theme-color" />
813
</head>
914

1015
<body>

0 commit comments

Comments
 (0)