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 095735e..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 arch.sh https://git.gmoker.com/ange/arch diff --git a/html/contact.html b/html/contact.html index 3de4dd7..29254f2 100644 --- a/html/contact.html +++ b/html/contact.html @@ -10,7 +10,7 @@ } function copyFile(id) { - fetch(document.getElementById(id).childNodes[0].href).then(f => { + fetch(document.getElementById(id).childNodes[1].href).then(f => { f.text().then(t => { navigator.clipboard.writeText(t); }) 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/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 cb2ca84..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))"), 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 @@ diff --git a/tmpl/vars.tmpl b/tmpl/vars.tmpl index dd7e24d..346008e 100644 --- a/tmpl/vars.tmpl +++ b/tmpl/vars.tmpl @@ -1,5 +1,5 @@ {{define "matrix"}} -@ange:gmoker.com +@ange:gmoker.com {{end}} {{define "discord"}} @@ -15,17 +15,17 @@ {{end}} {{define "wa"}} -+62 853-3355-9453 ++62 853-3355-9453 {{end}} {{define "in"}} -angedhn +angedhn {{end}} {{define "pgp"}} -pgp.asc +pgp.asc {{end}} {{define "ssh"}} -ssh +ssh {{end}}