summaryrefslogtreecommitdiffstats
path: root/output
diff options
context:
space:
mode:
Diffstat (limited to 'output')
-rw-r--r--output/outputType.go8
-rw-r--r--output/outputType_test.go1
2 files changed, 8 insertions, 1 deletions
diff --git a/output/outputType.go b/output/outputType.go
index e3df96f0b..ad66b4b68 100644
--- a/output/outputType.go
+++ b/output/outputType.go
@@ -27,6 +27,7 @@ var (
Name: "AMP",
MediaType: media.HTMLType,
BaseName: "index",
+ Path: "amp",
}
CSSType = Type{
@@ -43,7 +44,7 @@ var (
JSONType = Type{
Name: "JSON",
- MediaType: media.HTMLType,
+ MediaType: media.JSONType,
BaseName: "index",
IsPlainText: true,
}
@@ -52,6 +53,7 @@ var (
Name: "RSS",
MediaType: media.RSSType,
BaseName: "index",
+ NoUgly: true,
}
)
@@ -112,3 +114,7 @@ func GetTypes(keys ...string) (Types, error) {
return types, nil
}
+
+func (t Type) BaseFilename() string {
+ return t.BaseName + "." + t.MediaType.Suffix
+}
diff --git a/output/outputType_test.go b/output/outputType_test.go
index a55b9a81a..3eb56d8d3 100644
--- a/output/outputType_test.go
+++ b/output/outputType_test.go
@@ -30,6 +30,7 @@ func TestDefaultTypes(t *testing.T) {
require.Equal(t, media.RSSType, RSSType.MediaType)
require.Empty(t, RSSType.Path)
require.False(t, RSSType.IsPlainText)
+ require.True(t, RSSType.NoUgly)
}
func TestGetType(t *testing.T) {