@@ -55,8 +55,11 @@ func imageMiddleware(page PageHeader) func(w io.Writer, node ast.Node, entering
|
||||
}
|
||||
|
||||
img.Attribute = &ast.Attribute{Attrs: map[string][]byte{
|
||||
"srcset": []byte(images.SourceSet(src)),
|
||||
"src": []byte(src),
|
||||
"srcset": []byte(images.SourceSet(src)),
|
||||
"fetchpriority": []byte("low"),
|
||||
"loading": []byte("lazy"),
|
||||
"class": []byte("min-h-48"),
|
||||
"src": []byte(src),
|
||||
}}
|
||||
// // img.Attrs["srcset"] =
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
@@ -57,8 +56,6 @@ func (s *Service) getPageHeaders(ctx context.Context, uid string) (page PageHead
|
||||
}
|
||||
}
|
||||
|
||||
slog.Debug("loaded page infos", "cover", coverImage, "content", contentMD)
|
||||
|
||||
page.md, err = s.fs.Read(contentMD.Path())
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
@@ -65,7 +65,7 @@ func PathForLang(ctx context.Context, lang string, pp ...string) string {
|
||||
}
|
||||
}
|
||||
|
||||
return path.Join(append([]string{lang}, pp...)...)
|
||||
return "/" + path.Join(append([]string{lang}, pp...)...)
|
||||
}
|
||||
|
||||
func (s *Service) SupportedLanguages() (languages []string) {
|
||||
|
||||
Reference in New Issue
Block a user