This commit is contained in:
Alex
2018-05-30 23:42:32 +03:00
committed by Bjørn Erik Pedersen
parent ceaff7cafc
commit 07b96d16e8
7 changed files with 90 additions and 0 deletions

View File

@@ -77,6 +77,9 @@ type Twitter struct {
// When set to true, the Tweet and its embedded page on your site are not used
// for purposes that include personalized suggestions and personalized ads.
EnableDNT bool
// If simple mode is enabled, a static and no-JS version of the Tweet will be built.
Simple bool
}
// Vimeo holds the privacy configuration settingsrelated to the Vimeo shortcode.

View File

@@ -44,6 +44,7 @@ disable = true
[privacy.twitter]
disable = true
enableDNT = true
simple = true
[privacy.vimeo]
disable = true
simple = true
@@ -69,6 +70,7 @@ simple = true
assert.True(pc.SpeakerDeck.Disable)
assert.True(pc.Twitter.Disable)
assert.True(pc.Twitter.EnableDNT)
assert.True(pc.Twitter.Simple)
assert.True(pc.Vimeo.Disable)
assert.True(pc.Vimeo.Simple)
assert.True(pc.YouTube.PrivacyEnhanced)

View File

@@ -30,6 +30,7 @@ type Config struct {
Disqus Disqus
GoogleAnalytics GoogleAnalytics
Instagram Instagram
Twitter Twitter
}
// Disqus holds the functional configuration settings related to the Disqus template.
@@ -52,6 +53,14 @@ type Instagram struct {
DisableInlineCSS bool
}
// Twitter holds the functional configuration settings related to the Twitter shortcodes.
type Twitter struct {
// The Simple variant of Twitter is decorated with a basic set of inline styles.
// This means that if you want to provide your own CSS, you want
// to disable the inline CSS provided by Hugo.
DisableInlineCSS bool
}
func DecodeConfig(cfg config.Provider) (c Config, err error) {
m := cfg.GetStringMap(servicesConfigKey)

View File

@@ -35,6 +35,8 @@ shortname = "DS"
id = "ga_id"
[services.instagram]
disableInlineCSS = true
[services.twitter]
disableInlineCSS = true
`
cfg, err := config.FromConfigString(tomlConfig, "toml")
assert.NoError(err)