feat: title on pages
This commit is contained in:
@@ -9,6 +9,11 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
sourceSetSteps = 300
|
||||
sourceSetMax = 1500
|
||||
)
|
||||
|
||||
func UIDFromPath(path string) (uid string, err error) {
|
||||
var b bytes.Buffer
|
||||
// NewWriter with NoDict (nil) creates a raw DEFLATE compressor
|
||||
@@ -57,14 +62,11 @@ func PathFromUID(uid string) (string, error) {
|
||||
func SourceSet(src string) string {
|
||||
sb := strings.Builder{}
|
||||
|
||||
const steps = 300
|
||||
const max = 1500
|
||||
|
||||
i := 1
|
||||
for {
|
||||
width := i * steps
|
||||
width := i * sourceSetSteps
|
||||
sb.WriteString(fmt.Sprintf("%s?w=%d %dw, ", src, width, width))
|
||||
if width >= max {
|
||||
if width >= sourceSetMax {
|
||||
return sb.String()
|
||||
}
|
||||
sb.WriteRune(',')
|
||||
|
||||
Reference in New Issue
Block a user