summaryrefslogtreecommitdiff
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--internal/router/router.go8
-rw-r--r--views/pages/blog-page.html9
-rw-r--r--views/pages/global-map.html4
-rw-r--r--views/partials/general-page-header.html4
4 files changed, 16 insertions, 9 deletions
diff --git a/internal/router/router.go b/internal/router/router.go
index 65e35a4..964a953 100644
--- a/internal/router/router.go
+++ b/internal/router/router.go
@@ -394,6 +394,11 @@ func (r *Router) Listen() error {
case "unix":
unixConfig := r.endpoint.Config.(*config.UnixConfig)
endpoint, _ := strings.CutPrefix(unixConfig.Path, "unix://")
+
+ if err := os.Remove(endpoint); err != nil && !errors.Is(err, os.ErrNotExist) {
+ return fmt.Errorf("error while cleaning up existing unix socket: %w", err)
+ }
+
ln, err := net.Listen("unix", endpoint)
if err != nil {
return fmt.Errorf("error while initializing unix listener: %w", err)
@@ -642,8 +647,7 @@ func (r *Router) getAndValidateLang(c *fiber.Ctx, langSetting LangSetting, defau
return lang, nil
}
}
- c.Set(fiber.HeaderContentType, fiber.MIMETextPlainCharsetUTF8)
- return "", c.Status(fiber.ErrBadRequest.Code).SendString(fmt.Sprintf("lang value is invalid: '%s' is not considered an available language", lang))
+ return "", fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("lang value is invalid: '%s' is not considered an available language", lang))
}
func GetPathFromReferer(c *fiber.Ctx) (path string, pathParts []string, queryString string, err error) {
diff --git a/views/pages/blog-page.html b/views/pages/blog-page.html
index a5e80d8..d8cfbff 100644
--- a/views/pages/blog-page.html
+++ b/views/pages/blog-page.html
@@ -1,7 +1,10 @@
{{ define "body" }}
<div class="absolute w-full h-full inset-0 inset-shadow-[0_0_0.4rem_black] pointer-events-none z-20"></div>
<article class="relative bg-paper bg-background-light flex flex-col px-8 py-4 overflow-y-auto">
- <h1 class="max-xs:block [@media(max-height:32rem)]:block hidden font-gentium text-2xl font-bold italic text-main-hard tracking-[.0125rem] mb-1">{{ .Title }}</h1>
+ <h1 class="max-xs:flex flex-row content-center [@media(max-height:32rem)]:block hidden font-gentium text-2xl font-bold italic text-main-hard tracking-[.0125rem] mb-1">
+ <div hx-get="/api/v1/like" hx-target="this" hx-swap="outerHTML" hx-trigger="load"></div>
+ {{ .Title }}
+ </h1>
<p class="block grow text-lg font-gentium text-secondary">
<b>{{ .L.Metadata.Published }}</b>:
<time datetime="{{ .PublishedDate }}" hx-get="/api/v1/tz" hx-vals='js:{timestamp: "{{ .PublishedDate }}", tz: clientTimeZone}' hx-target="this" hx-swap="innerHTML" hx-trigger="load">
@@ -21,9 +24,9 @@
function initLocationMap(id, x, y, relativeErrorMeters = 0) {
map = L.map(id).setView([x, y], 8);
- L.tileLayer('https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png', {
+ L.tileLayer('https://tiles.stadiamaps.com/tiles/outdoors/{z}/{x}/{y}{r}.png', {
maxZoom: 20,
- attribution: '<a href="https://github.com/cyclosm/cyclosm-cartocss-style/releases" title="CyclOSM - Open Bicycle render">CyclOSM</a> | Map data: &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
+ attribution: '&copy; <a href="https://stadiamaps.com/" target="_blank">Stadia Maps</a>, &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> &copy; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>',
}).addTo(map);
if (relativeErrorMeters != 0) {
diff --git a/views/pages/global-map.html b/views/pages/global-map.html
index 248d0b9..fe7d747 100644
--- a/views/pages/global-map.html
+++ b/views/pages/global-map.html
@@ -389,9 +389,9 @@
function initLocationMap() {
map = L.map('map-container').setView([{{ .MapLocationLat }}, {{ .MapLocationLong }}], 4);
- L.tileLayer('https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png', {
+ L.tileLayer('https://tiles.stadiamaps.com/tiles/outdoors/{z}/{x}/{y}{r}.png', {
maxZoom: 20,
- attribution: '<a href="https://github.com/cyclosm/cyclosm-cartocss-style/releases" title="CyclOSM - Open Bicycle render">CyclOSM</a> | Map data: &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
+ attribution: '&copy; <a href="https://stadiamaps.com/" target="_blank">Stadia Maps</a>, &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> &copy; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>',
zoomControl: false
}).addTo(map);
diff --git a/views/partials/general-page-header.html b/views/partials/general-page-header.html
index 995ebf3..3b8a6c8 100644
--- a/views/partials/general-page-header.html
+++ b/views/partials/general-page-header.html
@@ -1,9 +1,9 @@
<title>{{ .Title }} // SAYA.UZ</title>
<div class="flex flex-row mb-2">
{{ block "header" . }}{{ end }}
- <p
+ <h1
class="text-4xl font-m-plus font-bold italic text-shadow-[0_2px_2px_var(--color-main-soft)] text-left my-auto"
>
{{ .Title }}
- </p>
+ </h1>
</div>