| -rw-r--r-- | config/config.go | 23 | ||||
| -rw-r--r-- | config/config.local.yaml | 22 | ||||
| -rw-r--r-- | config/config.prod.yaml | 22 | ||||
| -rw-r--r-- | config/config.stage.yaml | 22 | ||||
| -rw-r--r-- | internal/glightbox/extension.go | 11 | ||||
| -rw-r--r-- | internal/glightbox/html_renderer.go | 42 | ||||
| -rw-r--r-- | internal/router/handlers/lang-blog-title.go | 2 | ||||
| -rw-r--r-- | internal/router/handlers/lang.go | 10 | ||||
| -rw-r--r-- | internal/router/router.go | 42 | ||||
| -rw-r--r-- | views/layouts/general-page.html | 16 | ||||
| -rw-r--r-- | views/messages/new-post.html | 2 | ||||
| -rw-r--r-- | views/pages/global-map.html | 14 | ||||
| -rw-r--r-- | views/pages/home-page.html | 2 | ||||
| -rw-r--r-- | views/partials/catalogue-blog-cards.html | 2 |
14 files changed, 54 insertions, 178 deletions
diff --git a/config/config.go b/config/config.go index 536a333..ebe0367 100644 --- a/config/config.go +++ b/config/config.go @@ -20,9 +20,6 @@ type Config struct { Mail MailConfig `json:"Mail" yaml:"mail" validate:"required"` CanonicalEndpoint string `json:"CanonicalEndpoint" yaml:"canonicalEndpoint" validate:"required"` Meta MetaConfig `json:"Meta" yaml:"meta"` - PhotoStorage PhotoStorageConfig `json:"PhotoStorage" yaml:"photoStorage"` - StaticStorage PhotoTypeConfig `json:"StaticStorage" yaml:"staticStorage"` - AllowOrigins []string `json:"AllowOrigins" yaml:"allowOrigins"` } type BlogPagesConfig struct { @@ -161,26 +158,6 @@ type MetaConfig struct { GoogleSiteVerification string `json:"GoogleSiteVerification" yaml:"googleSiteVerification"` } -type PhotoStorageConfig struct { - Full PhotoTypeConfig `json:"Full" yaml:"full" validate:"required"` - Webp PhotoTypeConfig `json:"Webp" yaml:"webp"` - Thumbnail1600p PhotoTypeConfig `json:"Thumbnail1600p" yaml:"thumbnail1600p"` - Thumbnail1200p PhotoTypeConfig `json:"Thumbnail1200p" yaml:"thumbnail1200p"` - Thumbnail800p PhotoTypeConfig `json:"Thumbnail800p" yaml:"thumbnail800p"` - Thumbnail560p PhotoTypeConfig `json:"Thumbnail560p" yaml:"thumbnail560p"` - Thumbnail320p PhotoTypeConfig `json:"Thumbnail320p" yaml:"thumbnail320p"` - HomePageGifs HomePageGifsConfig `json:"HomePageGifs" yaml:"homePageGifs"` -} - -type PhotoTypeConfig struct { - BaseUrl string `json:"BaseUrl" yaml:"baseUrl" validate:"url,required"` -} - -type HomePageGifsConfig struct { - BaseUrl string `json:"BaseUrl" yaml:"baseUrl" validate:"url,required"` - Indexes []string `json:"Indexes" yaml:"indexes"` -} - func LoadConfig(path string, config *Config) error { fileBytes, err := os.ReadFile(path) if err != nil { diff --git a/config/config.local.yaml b/config/config.local.yaml index d312504..c02dc2d 100644 --- a/config/config.local.yaml +++ b/config/config.local.yaml @@ -46,25 +46,3 @@ mail: trigger: onNewPost: "* * * * *" canonicalEndpoint: 'http://127.0.0.1:3000' -photoStorage: - full: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/full/%s - webp: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp/%s.webp - thumbnail1600p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-1600p/%s.webp - thumbnail1200p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-1200p/%s.webp - thumbnail800p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-800p/%s.webp - thumbnail560p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-560p/%s.webp - thumbnail320p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-320p/%s.webp - homePageGifs: - baseUrl: https://f003.backblazeb2.com/file/sayana-static/home-page-gifs/otter-%s.gif - indexes: ['1', '2', '3'] -staticStorage: - baseUrl: https://f003.backblazeb2.com/file/sayana-static -allowOrigins: - - https://f003.backblazeb2.com diff --git a/config/config.prod.yaml b/config/config.prod.yaml index 2c5a159..b40ba57 100644 --- a/config/config.prod.yaml +++ b/config/config.prod.yaml @@ -47,25 +47,3 @@ mail: canonicalEndpoint: 'https://${FQDN}' meta: googleSiteVerification: '${GOOGLE_SITE_VERIFICATION}' -photoStorage: - full: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/full/%s - webp: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp/%s.webp - thumbnail1600p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-1600p/%s.webp - thumbnail1200p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-1200p/%s.webp - thumbnail800p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-800p/%s.webp - thumbnail560p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-560p/%s.webp - thumbnail320p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-320p/%s.webp - homePageGifs: - baseUrl: https://f003.backblazeb2.com/file/sayana-static/home-page-gifs/otter-%s.gif - indexes: ['1', '2', '3'] -staticStorage: - baseUrl: https://f003.backblazeb2.com/file/sayana-static -allowOrigins: - - https://f003.backblazeb2.com diff --git a/config/config.stage.yaml b/config/config.stage.yaml index 0889c19..efa94ae 100644 --- a/config/config.stage.yaml +++ b/config/config.stage.yaml @@ -45,25 +45,3 @@ mail: trigger: onNewPost: "0/3 * * * *" canonicalEndpoint: 'https://${FQDN}' -photoStorage: - full: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/full/%s - webp: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp/%s.webp - thumbnail1600p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-1600p/%s.webp - thumbnail1200p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-1200p/%s.webp - thumbnail800p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-800p/%s.webp - thumbnail560p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-560p/%s.webp - thumbnail320p: - baseUrl: https://f003.backblazeb2.com/file/sayana-photos/webp-320p/%s.webp - homePageGifs: - baseUrl: https://f003.backblazeb2.com/file/sayana-static/home-page-gifs/otter-%s.gif - indexes: ['1', '2', '3'] -staticStorage: - baseUrl: https://f003.backblazeb2.com/file/sayana-static -allowOrigins: - - https://f003.backblazeb2.com diff --git a/internal/glightbox/extension.go b/internal/glightbox/extension.go index e9a9f3e..7fd17b1 100644 --- a/internal/glightbox/extension.go +++ b/internal/glightbox/extension.go @@ -1,7 +1,6 @@ package glightbox import ( - "github.com/SayaAndy/saya-today-web/config" "github.com/yuin/goldmark" "github.com/yuin/goldmark/parser" "github.com/yuin/goldmark/renderer" @@ -9,12 +8,10 @@ import ( ) // Extension that combines parser and renderer -type GLightboxExtension struct { - photoStorage config.PhotoStorageConfig -} +type GLightboxExtension struct{} -func NewGLightboxExtension(photoStorage config.PhotoStorageConfig) goldmark.Extender { - return &GLightboxExtension{photoStorage} +func NewGLightboxExtension() goldmark.Extender { + return &GLightboxExtension{} } func (e *GLightboxExtension) Extend(m goldmark.Markdown) { @@ -25,7 +22,7 @@ func (e *GLightboxExtension) Extend(m goldmark.Markdown) { ) m.Renderer().AddOptions( renderer.WithNodeRenderers( - util.Prioritized(NewGLightboxHTMLRenderer(e.photoStorage), 500), + util.Prioritized(NewGLightboxHTMLRenderer(), 500), ), ) } diff --git a/internal/glightbox/html_renderer.go b/internal/glightbox/html_renderer.go index b2cd855..f71a8f2 100644 --- a/internal/glightbox/html_renderer.go +++ b/internal/glightbox/html_renderer.go @@ -8,7 +8,6 @@ import ( "strings" "time" - "github.com/SayaAndy/saya-today-web/config" "github.com/SayaAndy/saya-today-web/internal/tailwind" "github.com/yuin/goldmark" "github.com/yuin/goldmark/ast" @@ -22,10 +21,9 @@ type GLightboxHTMLRenderer struct { html.Config md goldmark.Markdown anchorMatchRe *regexp.Regexp - photoStorage config.PhotoStorageConfig } -func NewGLightboxHTMLRenderer(photoStorage config.PhotoStorageConfig, opts ...html.Option) renderer.NodeRenderer { +func NewGLightboxHTMLRenderer(opts ...html.Option) renderer.NodeRenderer { r := &GLightboxHTMLRenderer{ Config: html.NewConfig(), md: goldmark.New( @@ -46,12 +44,11 @@ func NewGLightboxHTMLRenderer(photoStorage config.PhotoStorageConfig, opts ...ht ), ), ), - anchorMatchRe: regexp.MustCompile(`(?s)<\s*a(\s+[^<]*)(href\s*=\s*["'].*?["'])\s*([^<]*)>(.*?)<\s*\/\s*a\s*>`), - photoStorage: photoStorage, } for _, opt := range opts { opt.SetHTMLOption(&r.Config) } + r.anchorMatchRe = regexp.MustCompile(`(?s)<\s*a(\s+[^<]*)(href\s*=\s*["'].*?["'])\s*([^<]*)>(.*?)<\s*\/\s*a\s*>`) return r } @@ -114,32 +111,19 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte, anchorlessCaptionHTML := r.anchorMatchRe.ReplaceAll(captionHTML, []byte("<span class=\"linklike\" $1 $3>$4</span>")) elements = append(elements, fmt.Sprintf(` - <a href="%[7]s" class="glightbox grid-item %[1]s grid-item-%[2]s p-1" - data-gallery="gallery" data-title="%[3]s" %[4]s> + <a href="https://f003.backblazeb2.com/file/sayana-photos/full/%s" class="glightbox grid-item %s grid-item-%s p-1" + data-gallery="gallery" data-title="%s" %s> <picture> - <source media="(width < 800px)" srcset="%[8]s" /> - <source media="(width < 2400px)" srcset="%[9]s" /> - <source media="(width < 3200px)" srcset="%[10]s" /> - <source media="(width < 4000px)" srcset="%[11]s" /> - <source media="(width >= 4000px)" srcset="%[12]s" /> - <img src="%[9]s" /> + <source media="(width < 800px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-320p/%s.webp" /> + <source media="(width < 2400px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-560p/%s.webp" /> + <source media="(width < 3200px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-800p/%s.webp" /> + <source media="(width < 4000px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-1200p/%s.webp" /> + <source media="(width >= 4000px)" srcset="https://f003.backblazeb2.com/file/sayana-photos/webp-1600p/%s.webp" /> + <img src="https://f003.backblazeb2.com/file/sayana-photos/webp-560p/%s.webp" /> </picture> - <span class="grid-tooltip-text"><p>%[5]s</p></span> - <span class="grid-item-index">%[6]d</span> - </a>`, - strings.Join(tagClassList, " "), - galleryID, - dayDate.Format("2006-01-02 15:04:05 -07:00"), - dataDescriptionAttribute, - anchorlessCaptionHTML, - i+1, - fmt.Sprintf(r.photoStorage.Full.BaseUrl, fullImageUrl), - fmt.Sprintf(r.photoStorage.Thumbnail1600p.BaseUrl, imageUrlWithoutExt), - fmt.Sprintf(r.photoStorage.Thumbnail1200p.BaseUrl, imageUrlWithoutExt), - fmt.Sprintf(r.photoStorage.Thumbnail800p.BaseUrl, imageUrlWithoutExt), - fmt.Sprintf(r.photoStorage.Thumbnail560p.BaseUrl, imageUrlWithoutExt), - fmt.Sprintf(r.photoStorage.Thumbnail320p.BaseUrl, imageUrlWithoutExt), - )) + <span class="grid-tooltip-text"><p>%s</p></span> + <span class="grid-item-index">%d</span> + </a>`, fullImageUrl, strings.Join(tagClassList, " "), galleryID, dayDate.Format("2006-01-02 15:04:05 -07:00"), dataDescriptionAttribute, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, imageUrlWithoutExt, anchorlessCaptionHTML, i+1)) if glightboxDescId != "" { elements = append(elements, fmt.Sprintf(` diff --git a/internal/router/handlers/lang-blog-title.go b/internal/router/handlers/lang-blog-title.go index 49744c1..f1be0a5 100644 --- a/internal/router/handlers/lang-blog-title.go +++ b/internal/router/handlers/lang-blog-title.go @@ -74,7 +74,7 @@ func (r *BlogPageHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, return []router.MetaField{ {Property: "og:title", Content: metadata.Title}, {Property: "og:description", Content: fmt.Sprintf("%s [%s]", metadata.ShortDescription, metadata.ActionDate)}, - {Property: "og:image", Content: fmt.Sprintf(supplements.PhotoStorage.Thumbnail320p.BaseUrl, metadata.Thumbnail)}, + {Property: "og:image", Content: fmt.Sprintf("https://f003.backblazeb2.com/file/sayana-photos/webp-320p/%s.webp", metadata.Thumbnail)}, {Property: "og:url", Content: fmt.Sprintf("%s/%s/blog/%s", templateMap["CanonicalEndpoint"], lang, c.Params("title"))}, {Property: "og:type", Content: "website"}, {Name: "twitter:card", Content: "summary_large_image"}, diff --git a/internal/router/handlers/lang.go b/internal/router/handlers/lang.go index 25b5036..c618353 100644 --- a/internal/router/handlers/lang.go +++ b/internal/router/handlers/lang.go @@ -53,10 +53,7 @@ func (r *HomeHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, lan return []router.MetaField{ {Property: "og:title", Content: supplements.Localization[lang].HomePage.Header}, {Property: "og:description", Content: supplements.Localization[lang].HomePage.HomePageDescription}, - {Property: "og:image", Content: fmt.Sprintf( - supplements.PhotoStorage.HomePageGifs.BaseUrl, - supplements.PhotoStorage.HomePageGifs.Indexes[rand.Int()%len(supplements.PhotoStorage.HomePageGifs.Indexes)], - )}, + {Property: "og:image", Content: fmt.Sprintf("https://f003.backblazeb2.com/file/sayana-static/home-page-gifs/otter-%d.gif", rand.Int()%3+1)}, {Property: "og:url", Content: fmt.Sprintf("%s/%s", templateMap["CanonicalEndpoint"], lang)}, {Property: "og:type", Content: "website"}, }, nil @@ -66,10 +63,7 @@ func (r *HomeHandler) RenderBody(c *fiber.Ctx, supplements *router.Supplements, templateMap["Title"] = supplements.Localization[lang].HomePage.Header templateMap["FilledHeartCount"] = uint(40) templateMap["OutlineHeartCount"] = uint(40) - templateMap["GifUrl"] = fmt.Sprintf( - supplements.PhotoStorage.HomePageGifs.BaseUrl, - supplements.PhotoStorage.HomePageGifs.Indexes[rand.Int()%len(supplements.PhotoStorage.HomePageGifs.Indexes)], - ) + templateMap["GifName"] = fmt.Sprintf("otter-%d.gif", rand.Int()%3+1) templateMap["FunFacts"] = supplements.FactGiver.Give(lang) return fiber.StatusOK, nil } diff --git a/internal/router/router.go b/internal/router/router.go index 926d21a..e8fb47a 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -101,8 +101,6 @@ type Supplements struct { TemplateManager *templatemanager.TemplateManager MarkdownRenderer goldmark.Markdown Meta config.MetaConfig - PhotoStorage config.PhotoStorageConfig - StaticStorage config.PhotoTypeConfig } type Router struct { @@ -158,7 +156,7 @@ func NewRouter(cfg *config.Config) (*Router, error) { supplements.MarkdownRenderer = goldmark.New( goldmark.WithExtensions( - glightbox.NewGLightboxExtension(cfg.PhotoStorage), + glightbox.NewGLightboxExtension(), tailwind.NewTailwindExtension(), ), goldmark.WithParserOptions( @@ -219,8 +217,6 @@ func NewRouter(cfg *config.Config) (*Router, error) { } supplements.Meta = cfg.Meta - supplements.PhotoStorage = cfg.PhotoStorage - supplements.StaticStorage = cfg.StaticStorage enablePrintRoutes := false if cfg.LogLevel <= slog.LevelDebug { @@ -233,7 +229,7 @@ func NewRouter(cfg *config.Config) (*Router, error) { }) app.Use(cors.New(cors.Config{ - AllowOrigins: strings.Join(cfg.AllowOrigins, ","), + AllowOrigins: "https://f003.backblazeb2.com", AllowMethods: "GET,POST,OPTIONS", AllowHeaders: "Origin, Content-Type, Accept", })) @@ -303,13 +299,11 @@ func (r *Router) InitRoutes() (err error) { } defaultMap := fiber.Map{ - "L": r.supplements.Localization[lang], - "Lang": lang, - "Path": trimmedPath, - "QueryString": queryString, - "CanonicalEndpoint": r.canonicalEndpoint, - "StaticStorageBaseUrl": r.supplements.StaticStorage.BaseUrl, - "ThumbnailBaseUrl": r.supplements.PhotoStorage.Thumbnail320p.BaseUrl, + "L": r.supplements.Localization[lang], + "Lang": lang, + "Path": trimmedPath, + "QueryString": queryString, + "CanonicalEndpoint": r.canonicalEndpoint, } statusCode, err := currentRoute.Render(c, r.supplements, lang, defaultMap) @@ -429,12 +423,10 @@ func (r *Router) generalPage(c *fiber.Ctx, route Route, lang string) error { } valueMap := fiber.Map{ - "L": r.supplements.Localization[lang], - "Lang": lang, - "QueryString": queryString, - "CanonicalEndpoint": r.canonicalEndpoint, - "StaticStorageBaseUrl": r.supplements.StaticStorage.BaseUrl, - "ThumbnailBaseUrl": r.supplements.PhotoStorage.Thumbnail320p.BaseUrl, + "L": r.supplements.Localization[lang], + "Lang": lang, + "QueryString": queryString, + "CanonicalEndpoint": r.canonicalEndpoint, } var err error @@ -511,13 +503,11 @@ func (r *Router) generalPageSegment(c *fiber.Ctx, part string) error { var statusCode int defaultMap := fiber.Map{ - "L": r.supplements.Localization[lang], - "Lang": lang, - "Path": strings.Trim(path, "/"), - "QueryString": queryString, - "CanonicalEndpoint": r.canonicalEndpoint, - "StaticStorageBaseUrl": r.supplements.StaticStorage.BaseUrl, - "ThumbnailBaseUrl": r.supplements.PhotoStorage.Thumbnail320p.BaseUrl, + "L": r.supplements.Localization[lang], + "Lang": lang, + "Path": strings.Trim(path, "/"), + "QueryString": queryString, + "CanonicalEndpoint": r.canonicalEndpoint, } switch part { diff --git a/views/layouts/general-page.html b/views/layouts/general-page.html index 1265266..b620566 100644 --- a/views/layouts/general-page.html +++ b/views/layouts/general-page.html @@ -13,8 +13,8 @@ {{- end }} {{- end }} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"> - <link rel="stylesheet" href="{{ .StaticStorageBaseUrl }}/libs/leaflet/1.9.4/leaflet.css"> - <link rel="stylesheet" href="{{ .StaticStorageBaseUrl }}/libs/glightbox/3.3.0/css/glightbox.min.css"> + <link rel="stylesheet" href="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet/1.9.4/leaflet.css"> + <link rel="stylesheet" href="https://f003.backblazeb2.com/file/sayana-static/libs/glightbox/3.3.0/css/glightbox.min.css"> <link href="/output.css" rel="stylesheet"> {{- with .LinkedData }} <script type="application/ld+json"> @@ -49,7 +49,7 @@ } </script> - <script src="{{ .StaticStorageBaseUrl }}/libs/glightbox/3.3.0/js/glightbox.min.js"></script> + <script src="https://f003.backblazeb2.com/file/sayana-static/libs/glightbox/3.3.0/js/glightbox.min.js"></script> <script> function sfc32(a, b, c, d) { @@ -133,7 +133,7 @@ const frameCenters = new Array(4); for (i = 1; i <= 4; i++) { let frame = document.createElement("img"); - frame.src = `{{ .StaticStorageBaseUrl }}/themes/ram/ram-frame${i}.webp`; + frame.src = `https://f003.backblazeb2.com/file/sayana-static/themes/ram/ram-frame${i}.webp`; frame.classList.add("ram-frame", "theme-decor", "z-0", "absolute"); let x, y; outerLoop: @@ -288,10 +288,10 @@ <div class="grow bg-split-right"></div> - <script src="{{ .StaticStorageBaseUrl }}/libs/htmx/2.0.6/htmx.min.js"></script> - <script src="{{ .StaticStorageBaseUrl }}/libs/leaflet/1.9.4/leaflet.js"></script> - <script src="{{ .StaticStorageBaseUrl }}/libs/imagesloaded/5.0.0/imagesloaded.pkgd.min.js"></script> - <script src="{{ .StaticStorageBaseUrl }}/libs/packery/3.0.0/dist/packery.pkgd.min.js"></script> + <script src="https://f003.backblazeb2.com/file/sayana-static/libs/htmx/2.0.6/htmx.min.js"></script> + <script src="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet/1.9.4/leaflet.js"></script> + <script src="https://f003.backblazeb2.com/file/sayana-static/libs/imagesloaded/5.0.0/imagesloaded.pkgd.min.js"></script> + <script src="https://f003.backblazeb2.com/file/sayana-static/libs/packery/3.0.0/dist/packery.pkgd.min.js"></script> <script> // Enable fitWidth-like attribute for Packery. Source: https://codepen.io/desandro/pen/kVmLYz diff --git a/views/messages/new-post.html b/views/messages/new-post.html index 98f0b52..f1338f7 100644 --- a/views/messages/new-post.html +++ b/views/messages/new-post.html @@ -2,7 +2,7 @@ <p>{{ .L.Mail.NewPost.Intro }}</p> <table> <tr> - <td rowspan="3"><a href="https://{{ .ClientHost }}/{{ .Lang }}/blog/{{ .Post.FileName }}"><img src="{{ printf .ThumbnailBaseUrl .Post.Metadata.Thumbnail }}"></a></td> + <td rowspan="3"><a href="https://{{ .ClientHost }}/{{ .Lang }}/blog/{{ .Post.FileName }}"><img src="https://f003.backblazeb2.com/file/sayana-photos/webp-320p/{{ .Post.Metadata.Thumbnail }}.webp"></a></td> <td class="darkened" style="font-size: 24px"><a style="color: #273de1 !important;" href="https://{{ .ClientHost }}/{{ .Lang }}/blog/{{ .Post.FileName }}">{{ .Post.Metadata.Title }}</a></td> </tr> <tr> diff --git a/views/pages/global-map.html b/views/pages/global-map.html index 1547ada..9a0d752 100644 --- a/views/pages/global-map.html +++ b/views/pages/global-map.html @@ -13,9 +13,9 @@ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"> {{ block "header" . }}{{ end }} <link href="/output.css" rel="stylesheet"> - <link rel="stylesheet" href="{{ .StaticStorageBaseUrl }}/libs/leaflet/1.9.4/leaflet.css"> - <link rel="stylesheet" href="{{ .StaticStorageBaseUrl }}/libs/leaflet.markercluster/1.4.1/MarkerCluster.css"> - <link rel="stylesheet" href="{{ .StaticStorageBaseUrl }}/libs/leaflet.markercluster/1.4.1/MarkerCluster.Default.css"> + <link rel="stylesheet" href="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet/1.9.4/leaflet.css"> + <link rel="stylesheet" href="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet.markercluster/1.4.1/MarkerCluster.css"> + <link rel="stylesheet" href="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet.markercluster/1.4.1/MarkerCluster.Default.css"> </head> <body data-theme="ram" class="font-m-plus text-main-hard overflow-hidden bg-interlocked-hexagons h-dvh"> @@ -81,9 +81,9 @@ <div id="map-container" class="bg-paper bg-background-dark flex z-10 w-full h-full"></div> - <script src="{{ .StaticStorageBaseUrl }}/libs/htmx/2.0.6/htmx.min.js"></script> - <script src="{{ .StaticStorageBaseUrl }}/libs/leaflet/1.9.4/leaflet.js"></script> - <script src="{{ .StaticStorageBaseUrl }}/libs/leaflet.markercluster/1.4.1/leaflet.markercluster.js"></script> + <script src="https://f003.backblazeb2.com/file/sayana-static/libs/htmx/2.0.6/htmx.min.js"></script> + <script src="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet/1.9.4/leaflet.js"></script> + <script src="https://f003.backblazeb2.com/file/sayana-static/libs/leaflet.markercluster/1.4.1/leaflet.markercluster.js"></script> <script> const themeWheel = document.getElementById('theme-wheel'); @@ -278,7 +278,7 @@ title: title, }).bindPopup(` <div class="flex flex-row justify-center justify-items-center"> - <img onclick="location.href='${link}';" class="cursor-pointer object-cover rounded-[10%] select-none w-12 h-12 mr-1" src='{{ printf .ThumbnailBaseUrl "${thumbnail}" }}'> + <img onclick="location.href='${link}';" class="cursor-pointer object-cover rounded-[10%] select-none w-12 h-12 mr-1" src="https://f003.backblazeb2.com/file/sayana-photos/webp-320p/${thumbnail}.webp"> <span><b><a href="${link}">${title}</a></b><br><a href="https://www.openstreetmap.org/#map=13/${x}/${y}">${x}, ${y}</a></span> </div>`); diff --git a/views/pages/home-page.html b/views/pages/home-page.html index 8f74b8e..63259c8 100644 --- a/views/pages/home-page.html +++ b/views/pages/home-page.html @@ -55,7 +55,7 @@ {{- range $_ := iterate .OutlineHeartCount }} <div class="home-page-heart z-50">♡</div> {{- end }} - <img src="{{ .GifUrl }}" + <img src="https://f003.backblazeb2.com/file/sayana-static/home-page-gifs/{{ .GifName }}" class="home-page-gif z-49 -rotate-12 max-w-[70%] max-h-[70%] border-4 border-background-dark border-inset"> </div> diff --git a/views/partials/catalogue-blog-cards.html b/views/partials/catalogue-blog-cards.html index 0492c38..7096c0d 100644 --- a/views/partials/catalogue-blog-cards.html +++ b/views/partials/catalogue-blog-cards.html @@ -2,7 +2,7 @@ <hr class="first-of-type:hidden border-t-2 border-dotted border-main-hard"> <div class="w-full flex flex-row items-stretch"> <div class="relative min-h-24 flex flex-col w-28 overflow-hidden shrink-0 mask-r-from-70% mask-r-to-100%"> - <img onclick="return changeUrl('{{ .ArticleLink }}');" class="h-full min-h-24 w-full cursor-pointer select-none object-cover block absolute" src="{{ printf $.ThumbnailBaseUrl .Thumbnail }}"> + <img onclick="return changeUrl('{{ .ArticleLink }}');" class="h-full min-h-24 w-full cursor-pointer select-none object-cover block absolute" src="https://f003.backblazeb2.com/file/sayana-photos/webp-320p/{{ .Thumbnail }}.webp"> <div class="w-full h-6 flex flex-row mt-auto relative"> <div class="flex-1/2 flex flex-row justify-center select-none bg-linear-180 {{ if .Liked }}from-accent-deep/40 to-accent-deep/80 text-background-dark{{ else }}from-accent-light/40 to-accent-light/80 text-main-hard{{ end }}"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="-2 -2 28 28" id="Smiley-Thumbs-Up--Streamline-Freehand"> |