diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/glightbox/html_renderer.go | 11 | ||||
| -rw-r--r-- | internal/router/handlers/lang-blog-title.go | 3 | ||||
| -rw-r--r-- | internal/router/router.go | 5 |
3 files changed, 11 insertions, 8 deletions
diff --git a/internal/glightbox/html_renderer.go b/internal/glightbox/html_renderer.go index 7022793..b7b256a 100644 --- a/internal/glightbox/html_renderer.go +++ b/internal/glightbox/html_renderer.go @@ -133,9 +133,9 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte, } w.WriteString(fmt.Sprintf(` -<div class="justify-content-center display-block"> +<div class="items-center flex flex-col"> <hr class="border-t-3 border-dotted border-main-hard mt-1 mb-2 w-[80%%] ml-auto mr-auto"> - <div class="grid masonry-grid-%s mx-auto"> + <div class="grid masonry-grid-%s"> <div class="grid-sizer grid-sizer-%s"></div> %s </div> @@ -144,11 +144,10 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte, w.WriteString(fmt.Sprintf(` <script> - var msnry_%s = new Masonry('.masonry-grid-%s', { + var pckry_%s = new Packery('.masonry-grid-%s', { itemSelector: '.grid-item-%s', columnWidth: '.grid-sizer-%s', - percentPosition: false, - fitWidth: true + percentPosition: false }); var imgLoad_%s_timer; @@ -156,7 +155,7 @@ func (r *GLightboxHTMLRenderer) renderGLightbox(w util.BufWriter, source []byte, function initMasonryLayout_%s(tm) { clearTimeout(imgLoad_%s_timer); - imgLoad_%s_timer = setTimeout(() => msnry_%s.layout(), 100); + imgLoad_%s_timer = setTimeout(() => pckry_%s.layout(), 100); } imgLoad_%s.on('progress', initMasonryLayout_%s); diff --git a/internal/router/handlers/lang-blog-title.go b/internal/router/handlers/lang-blog-title.go index f1be2cd..0f4f564 100644 --- a/internal/router/handlers/lang-blog-title.go +++ b/internal/router/handlers/lang-blog-title.go @@ -74,6 +74,7 @@ func (r *BlogPageHandler) RenderBody(c *fiber.Ctx, supplements *router.Supplemen templateMap["ParsedMarkdown"] = template.HTML(parsedMarkdown) templateMap["PublishedDate"] = metadata.PublishedTime.Format("2006-01-02 15:04:05 -07:00") templateMap["ActionDate"] = metadata.ActionDate + templateMap["ShortDescription"] = metadata.ShortDescription go supplements.ClientCache.View(c.IP(), pathParts[2]) @@ -92,8 +93,6 @@ func (r *BlogPageHandler) RenderHeader(c *fiber.Ctx, supplements *router.Supplem } templateMap["Title"] = metadata.Title - templateMap["PublishedDate"] = metadata.PublishedTime.Format("2006-01-02 15:04:05 -07:00") - templateMap["ActionDate"] = metadata.ActionDate return fiber.StatusOK, nil } diff --git a/internal/router/router.go b/internal/router/router.go index ef3f063..c0556f0 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -340,18 +340,23 @@ func (r *Router) Listen(endpoint string) error { func (r *Router) Close() (err error) { allErrors := make([]error, 0) + slog.Debug("shutting down blog trigger scheduler") if err = r.supplements.BlogTrigger.Close(); err != nil { allErrors = append(allErrors, fmt.Errorf("fail to shutdown blog trigger scheduler: %w", err)) } + slog.Debug("shutting down fiber server") if err = r.app.Shutdown(); err != nil { allErrors = append(allErrors, fmt.Errorf("fail to shutdown fiber server: %w", err)) } + slog.Debug("dumping cache") if err = r.supplements.ClientCache.Close(); err != nil { allErrors = append(allErrors, fmt.Errorf("fail to dump cache: %w", err)) } + slog.Debug("closing db connection") if err = r.supplements.DB.Close(); err != nil { allErrors = append(allErrors, fmt.Errorf("fail to close db connection: %w", err)) } + slog.Debug("closing page cache") r.supplements.PageCache.Close() return errors.Join(allErrors...) } |