1
0
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:
spf13
2014-11-01 11:57:29 -04:00
parent dfb8482569
commit 141f3e19e0
10 changed files with 74 additions and 36 deletions

View File

@@ -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) {

View File

@@ -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)
}