diff --git a/Dockerfile b/Dockerfile index 2539050..93cbac1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ COPY html/ html/ COPY css/ css/ COPY static/ static/ COPY tmpl/ tmpl/ +COPY ssh pgp.asc . COPY aliases.txt aliases.txt EXPOSE 3000 CMD ["./app"] diff --git a/aliases.txt b/aliases.txt index 9c1cc38..a9a409e 100644 --- a/aliases.txt +++ b/aliases.txt @@ -1,5 +1,3 @@ -ssh /static/ssh -pgp /static/pgp.asc termux.sh https://git.gmoker.com/ange/termux/raw/branch/main/install.sh -dotfiles.sh https://git.gmoker.com/ange/.dotfiles +dotfiles.sh https://git.gmoker.com/ange/dotfiles arch.sh https://git.gmoker.com/ange/arch diff --git a/html/contact.html b/html/contact.html index d2be560..29254f2 100644 --- a/html/contact.html +++ b/html/contact.html @@ -2,7 +2,21 @@
{{template "head.tmpl" .}} - + {{template "header.tmpl" .}} diff --git a/html/resume.html b/html/resume.html index 216aa7d..79905d4 100644 --- a/html/resume.html +++ b/html/resume.html @@ -10,7 +10,7 @@ diff --git a/js/copy.js b/js/copy.js deleted file mode 100644 index f323f72..0000000 --- a/js/copy.js +++ /dev/null @@ -1,13 +0,0 @@ -function copyElem(id, r='') { - navigator.clipboard.writeText( - document.getElementById(id).innerText.replaceAll(r, ''), - ); -} - -function copyFile(id) { - fetch(document.getElementById(id).childNodes[0].href).then(f => { - f.text().then(t => { - navigator.clipboard.writeText(t); - }) - }) -} diff --git a/static/pgp.asc b/pgp.asc similarity index 100% rename from static/pgp.asc rename to pgp.asc diff --git a/src/route.go b/src/route.go index 1b92eca..19ce2c3 100644 --- a/src/route.go +++ b/src/route.go @@ -16,8 +16,9 @@ var routes = []struct { handler http.HandlerFunc }{ {[]string{"GET"}, url(""), index}, + {[]string{"GET"}, url("/(pgp.asc|ssh)"), static}, {[]string{"GET"}, url("/static/.+"), static}, - {[]string{"GET"}, url("/(.+\\.(css|js))"), file}, + {[]string{"GET"}, url("/(.+\\.css)"), css}, {[]string{"GET"}, url("/([^/]+)"), html}, } diff --git a/src/views.go b/src/views.go index 0c5677f..cf8d4b5 100644 --- a/src/views.go +++ b/src/views.go @@ -13,8 +13,8 @@ func static(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, r.URL.Path) } -func file(w http.ResponseWriter, r *http.Request) { - http.ServeFile(w, r, filepath.Join(getParam(r, 1), getParam(r, 0))) +func css(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, filepath.Join("css", getParam(r, 0))) } func html(w http.ResponseWriter, r *http.Request) { diff --git a/static/ssh b/ssh similarity index 100% rename from static/ssh rename to ssh diff --git a/tmpl/header.tmpl b/tmpl/header.tmpl index e602fcf..e39ba9f 100644 --- a/tmpl/header.tmpl +++ b/tmpl/header.tmpl @@ -1,7 +1,7 @@