mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-09-06 11:46:24 -07:00
Make templates dynamic so I don't forget
Also officially bump up version to 3.0 🎉
This commit is contained in:
parent
8e706a313c
commit
e2339f98ef
10 changed files with 56 additions and 9 deletions
12
build.py
12
build.py
|
@ -148,6 +148,18 @@ def build(debugging=False):
|
|||
ldflags = " -ldflags=\"-X main.versionStr=" + version + "{}\""
|
||||
build_cmd = "go build -v -asmflags=" + trimpath
|
||||
|
||||
print("Building error pages from templates")
|
||||
with open("templates/404.html", "r") as tmpl404:
|
||||
tmpl404str = tmpl404.read().strip()
|
||||
with open("html/error/404.html", "w") as page404:
|
||||
page404.write(tmpl404str.format(version))
|
||||
with open("templates/5xx.html", "r") as tmpl5xx:
|
||||
tmpl5xxStr = tmpl5xx.read().strip()
|
||||
with open("html/error/500.html", "w") as page500:
|
||||
page500.write(tmpl5xxStr.format(version=version, title="Error 500: Internal Server error"))
|
||||
with open("html/error/502.html", "w") as page502:
|
||||
page502.write(tmpl5xxStr.format(version=version, title="Error 502: Bad gateway"))
|
||||
|
||||
if debugging:
|
||||
print("Building for", gcos, "with debugging symbols")
|
||||
gcflags = gcflags.format(" -l -N")
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
<h1>404: File not found</h1>
|
||||
<img src="./lol 404.gif" border="0" alt="">
|
||||
<p>The requested file could not be found on this server.</p>
|
||||
<hr><address>http://gochan.org powered by Gochan v3.0.0-beta</address>
|
||||
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v3.0.0
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
|
@ -4,9 +4,9 @@
|
|||
<title>Error 500: Internal Server error</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>500: Internal Server error</h1>
|
||||
<img src="./derpy server.gif" border="0" alt="">
|
||||
<p>The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The <a href="https://en.wikipedia.org/wiki/Idiot">system administrator</a> will try to fix things as soon has he/she/it can.</p>
|
||||
<hr><address>http://gochan.org powered by Gochan v3.0.0-beta</address>
|
||||
<h1>Error 500: Internal Server error</h1>
|
||||
<img src="./server500.gif" border="0" alt="">
|
||||
<p>The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The <a href="https://en.wikipedia.org/wiki/Idiot">system administrator</a> will try to fix things as soon they get around to it, whenever that is. Hopefully soon.</p>
|
||||
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v3.0.0
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
12
html/error/502.html
Normal file
12
html/error/502.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Error 502: Bad gateway</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Error 502: Bad gateway</h1>
|
||||
<img src="./server500.gif" border="0" alt="">
|
||||
<p>The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The <a href="https://en.wikipedia.org/wiki/Idiot">system administrator</a> will try to fix things as soon they get around to it, whenever that is. Hopefully soon.</p>
|
||||
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v3.0.0
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
Before Width: | Height: | Size: 45 KiB |
BIN
html/error/server500.gif
Normal file
BIN
html/error/server500.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
|
@ -22,7 +22,6 @@ server {
|
|||
include fastcgi_params;
|
||||
}
|
||||
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
|
12
templates/404.html
Executable file
12
templates/404.html
Executable file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Error 404: File not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>404: File not found</h1>
|
||||
<img src="./lol 404.gif" border="0" alt="">
|
||||
<p>The requested file could not be found on this server.</p>
|
||||
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v{}
|
||||
</body>
|
||||
</html>
|
12
templates/5xx.html
Executable file
12
templates/5xx.html
Executable file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{title}</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>{title}</h1>
|
||||
<img src="./server500.gif" border="0" alt="">
|
||||
<p>The server encountered an error while trying to serve the page, and we apologize for the inconvenience. The <a href="https://en.wikipedia.org/wiki/Idiot">system administrator</a> will try to fix things as soon they get around to it, whenever that is. Hopefully soon.</p>
|
||||
<hr/>Site powered by <a href="https://github.com/gochan-org/gochan" target="_blank">Gochan</a> v{version}
|
||||
</body>
|
||||
</html>
|
2
version
2
version
|
@ -1 +1 @@
|
|||
3.0.0-beta
|
||||
3.0.0
|
Loading…
Add table
Add a link
Reference in a new issue