summaryrefslogtreecommitdiffstats
path: root/config/services/servicesConfig.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/services/servicesConfig.go')
-rw-r--r--config/services/servicesConfig.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/config/services/servicesConfig.go b/config/services/servicesConfig.go
index 7306f5274..559848f5c 100644
--- a/config/services/servicesConfig.go
+++ b/config/services/servicesConfig.go
@@ -1,4 +1,4 @@
-// Copyright 2018 The Hugo Authors. All rights reserved.
+// Copyright 2019 The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ const (
disqusShortnameKey = "disqusshortname"
googleAnalyticsKey = "googleanalytics"
+ rssLimitKey = "rssLimit"
)
// Config is a privacy configuration for all the relevant services in Hugo.
@@ -31,6 +32,7 @@ type Config struct {
GoogleAnalytics GoogleAnalytics
Instagram Instagram
Twitter Twitter
+ RSS RSS
}
// Disqus holds the functional configuration settings related to the Disqus template.
@@ -61,6 +63,12 @@ type Twitter struct {
DisableInlineCSS bool
}
+// RSS holds the functional configuration settings related to the RSS feeds.
+type RSS struct {
+ // Limit the number of pages.
+ Limit int
+}
+
// DecodeConfig creates a services Config from a given Hugo configuration.
func DecodeConfig(cfg config.Provider) (c Config, err error) {
m := cfg.GetStringMap(servicesConfigKey)
@@ -76,5 +84,9 @@ func DecodeConfig(cfg config.Provider) (c Config, err error) {
c.Disqus.Shortname = cfg.GetString(disqusShortnameKey)
}
+ if c.RSS.Limit == 0 {
+ c.RSS.Limit = cfg.GetInt(rssLimitKey)
+ }
+
return
}