all repos — homestead @ a2200662dd6a3142e48580050006856278404061

Code for my website

fix incorrect style hash calculation

Alan Pearce
commit

a2200662dd6a3142e48580050006856278404061

parent

90935f0741435753afe81c6af03be63380a55393

2 files changed, 10 insertions(+), 0 deletions(-)

jump to
M internal/buffer/buffer.gointernal/buffer/buffer.go
@@ -64,6 +64,12 @@ b.len = 0
b.pos = 0 } +func (b *Buffer) SeekStart() error { + _, err := b.Seek(0, io.SeekStart) + + return err +} + // Seek moves the read position by offset bytes relative to whence (Start, Current, End) func (b *Buffer) Seek(offset int64, whence int) (int64, error) { var newpos int
M internal/builder/builder.gointernal/builder/builder.go
@@ -230,6 +230,10 @@ // it would be nice to set LastMod here, but using the latest post
// date would be wrong as the homepage has its own content file // without a date, which could be newer sitemap.AddPath("/", time.Time{}) + err = buf.SeekStart() + if err != nil { + return nil, err + } h, _ = getHTMLStyleHash(buf) r.Hashes = append(r.Hashes, h)