aboutsummaryrefslogtreecommitdiffhomepage
path: root/config/privacy
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2018-05-23 12:26:10 +0200
committerBjørn Erik Pedersen <[email protected]>2018-05-23 16:52:08 +0200
commit9ad46a20357a7e28b405feef5c8f7d4501186da6 (patch)
tree18034f49654b236429dd804b4f1f0a84f7a1787d /config/privacy
parent4256de3392d320a5a47fcab49882f2a3249c2163 (diff)
downloadhugo-9ad46a20357a7e28b405feef5c8f7d4501186da6.tar.gz
hugo-9ad46a20357a7e28b405feef5c8f7d4501186da6.zip
Add instagram_simple shortcode
Fixes #4748
Diffstat (limited to 'config/privacy')
-rw-r--r--config/privacy/privacyConfig.go4
-rw-r--r--config/privacy/privacyConfig_test.go4
2 files changed, 8 insertions, 0 deletions
diff --git a/config/privacy/privacyConfig.go b/config/privacy/privacyConfig.go
index 4da7efbea..ee7b7be2c 100644
--- a/config/privacy/privacyConfig.go
+++ b/config/privacy/privacyConfig.go
@@ -53,6 +53,10 @@ type GoogleAnalytics struct {
// Instagram holds the privacy configuration settings related to the Instagram shortcode.
type Instagram struct {
Service `mapstructure:",squash"`
+
+ // If simple mode is enabled, a static and no-JS version of the Instagram
+ // image card will be built.
+ Simple bool
}
// SpeakerDeck holds the privacy configuration settings related to the SpeakerDeck shortcode.
diff --git a/config/privacy/privacyConfig_test.go b/config/privacy/privacyConfig_test.go
index bca53f167..f945ac8c2 100644
--- a/config/privacy/privacyConfig_test.go
+++ b/config/privacy/privacyConfig_test.go
@@ -36,6 +36,7 @@ disable = true
respectDoNotTrack = true
[privacy.instagram]
disable = true
+simple = true
[privacy.speakerDeck]
disable = true
[privacy.tweet]
@@ -45,6 +46,7 @@ disable = true
[privacy.youtube]
disable = true
privacyEnhanced = true
+simple = true
`
cfg, err := config.FromConfigString(tomlConfig, "toml")
assert.NoError(err)
@@ -57,12 +59,14 @@ privacyEnhanced = true
assert.True(pc.GoogleAnalytics.Disable)
assert.True(pc.GoogleAnalytics.RespectDoNotTrack)
assert.True(pc.Instagram.Disable)
+ assert.True(pc.Instagram.Simple)
assert.True(pc.SpeakerDeck.Disable)
assert.True(pc.Tweet.Disable)
assert.True(pc.Vimeo.Disable)
assert.True(pc.YouTube.PrivacyEnhanced)
assert.True(pc.YouTube.Disable)
+ assert.True(pc.YouTube.Simple)
}
func TestDecodeConfigFromTOMLCaseInsensitive(t *testing.T) {