Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorNoah Campbell <noahcampbell@gmail.com>2013-08-31 04:18:05 +0400
committerNoah Campbell <noahcampbell@gmail.com>2013-08-31 07:45:42 +0400
commitb14b61af37f0428545af0d191a27170434e4aad2 (patch)
treee85c3091019449c87ce4059675a892f554876a0d /target
parentbc3c2290027359206f3569bcd51447443f7b40bb (diff)
Externalize the writing of content to a target
Introducing the target module in hugo. This provides the simple interface for writing content given a label (filename) and a io.Reader containing the content to be written. If site.Target is not set, it defaults back to the original behavior of writing to file system. In hugolib/site_url_test.go I have an InMemoryTarget for testing purposes and use it to see if the final output of a render matches.
Diffstat (limited to 'target')
-rw-r--r--target/file.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/target/file.go b/target/file.go
new file mode 100644
index 000000000..a80d73dbe
--- /dev/null
+++ b/target/file.go
@@ -0,0 +1,9 @@
+package target
+
+import (
+ "io"
+)
+
+type Publisher interface {
+ Publish(string, io.Reader) error
+}