mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Migrating Hugo to Afero for filesystem calls.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"path"
|
||||
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
)
|
||||
|
||||
type Publisher interface {
|
||||
@@ -34,7 +35,7 @@ func (fs *Filesystem) Publish(path string, r io.Reader) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
return helpers.WriteToDisk(translated, r)
|
||||
return helpers.WriteToDisk(translated, r, hugofs.DestinationFS)
|
||||
}
|
||||
|
||||
func (fs *Filesystem) Translate(src string) (dest string, err error) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
)
|
||||
|
||||
const ALIAS = "<!DOCTYPE html><html><head><link rel=\"canonical\" href=\"{{ .Permalink }}\"/><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /><meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" /></head></html>"
|
||||
@@ -68,5 +69,5 @@ func (h *HTMLRedirectAlias) Publish(path string, permalink template.HTML) (err e
|
||||
return
|
||||
}
|
||||
|
||||
return helpers.WriteToDisk(path, buffer)
|
||||
return helpers.WriteToDisk(path, buffer, hugofs.DestinationFS)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user