diff options
author | Alexandros <onedrawingperday@users.noreply.github.com> | 2018-06-09 12:13:36 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-06-09 11:13:36 +0200 |
commit | 65deb72dc4c9299416cf2d9defddb96dba4101fd (patch) | |
tree | 77b302c85e7be1402570fc2c525b1939d0853f56 | |
parent | dc4226a8b27e03e31068fc945daab885d3819d04 (diff) |
tplimpl: Remove speakerdeck shortcode
Fixes #4830
-rw-r--r-- | config/privacy/privacyConfig.go | 6 | ||||
-rw-r--r-- | config/privacy/privacyConfig_test.go | 3 | ||||
-rw-r--r-- | docs/content/en/about/hugo-and-gdpr.md | 4 | ||||
-rw-r--r-- | docs/content/en/content-management/shortcodes.md | 29 | ||||
-rw-r--r-- | docs/themes/gohugoioTheme/src/js/hljs.js | 2 | ||||
-rw-r--r-- | hugolib/embedded_shortcodes_test.go | 29 | ||||
-rw-r--r-- | hugolib/testhelpers_test.go | 1 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates.autogen.go | 4 | ||||
-rwxr-xr-x | tpl/tplimpl/embedded/templates/shortcodes/speakerdeck.html | 4 |
9 files changed, 1 insertions, 81 deletions
diff --git a/config/privacy/privacyConfig.go b/config/privacy/privacyConfig.go index a058c3593..1eff528d5 100644 --- a/config/privacy/privacyConfig.go +++ b/config/privacy/privacyConfig.go @@ -30,7 +30,6 @@ type Config struct { Disqus Disqus GoogleAnalytics GoogleAnalytics Instagram Instagram - SpeakerDeck SpeakerDeck Twitter Twitter Vimeo Vimeo YouTube YouTube @@ -65,11 +64,6 @@ type Instagram struct { Simple bool } -// SpeakerDeck holds the privacy configuration settings related to the SpeakerDeck shortcode. -type SpeakerDeck struct { - Service `mapstructure:",squash"` -} - // Twitter holds the privacy configuration settingsrelated to the Twitter shortcode. type Twitter struct { Service `mapstructure:",squash"` diff --git a/config/privacy/privacyConfig_test.go b/config/privacy/privacyConfig_test.go index 8d9c9f14f..5ced6d9d9 100644 --- a/config/privacy/privacyConfig_test.go +++ b/config/privacy/privacyConfig_test.go @@ -39,8 +39,6 @@ useSessionStorage = true [privacy.instagram] disable = true simple = true -[privacy.speakerDeck] -disable = true [privacy.twitter] disable = true enableDNT = true @@ -67,7 +65,6 @@ simple = true assert.True(pc.GoogleAnalytics.UseSessionStorage) assert.True(pc.Instagram.Disable) assert.True(pc.Instagram.Simple) - assert.True(pc.SpeakerDeck.Disable) assert.True(pc.Twitter.Disable) assert.True(pc.Twitter.EnableDNT) assert.True(pc.Twitter.Simple) diff --git a/docs/content/en/about/hugo-and-gdpr.md b/docs/content/en/about/hugo-and-gdpr.md index 502061311..ef68d5690 100644 --- a/docs/content/en/about/hugo-and-gdpr.md +++ b/docs/content/en/about/hugo-and-gdpr.md @@ -46,8 +46,6 @@ useSessionStorage = false [privacy.instagram] disable = false simple = false -[privacy.speakerDeck] -disable = false [privacy.twitter] disable = false enableDNT = false @@ -71,8 +69,6 @@ disable = true disable = true [privacy.instagram] disable = true -[privacy.speakerDeck] -disable = true [privacy.twitter] disable = true [privacy.vimeo] diff --git a/docs/content/en/content-management/shortcodes.md b/docs/content/en/content-management/shortcodes.md index e56873312..edb7168cc 100644 --- a/docs/content/en/content-management/shortcodes.md +++ b/docs/content/en/content-management/shortcodes.md @@ -268,34 +268,6 @@ Assuming that standard Hugo pretty URLs are turned on. <a href="/about/#who:c28654c202e73453784cfd2c5ab356c0">Who</a> ``` -### `speakerdeck` - -To embed slides from [Speaker Deck][], click on "< /> Embed" (under Share right next to the template on Speaker Deck) and copy the URL: - -``` -<script async class="speakerdeck-embed" data-id="4e8126e72d853c0060001f97" data-ratio="1.33333333333333" src="//speakerdeck.com/assets/embed.js"></script> -``` - -#### `speakerdeck` Example Input - -Extract the value from the field `data-id` and pass it to the shortcode: - -{{< code file="speakerdeck-example-input.md" >}} -{{</* speakerdeck 4e8126e72d853c0060001f97 */>}} -{{< /code >}} - -#### `speakerdeck` Example Output - -{{< output file="speakerdeck-example-input.md" >}} -{{< speakerdeck 4e8126e72d853c0060001f97 >}} -{{< /output >}} - -#### `speakerdeck` Example Display - -For the preceding `speakerdeck` example, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup. - -{{< speakerdeck 4e8126e72d853c0060001f97 >}} - ### `tweet` You want to include a single tweet into your blog post? Everything you need is the URL of the tweet: @@ -418,7 +390,6 @@ To learn more about creating custom shortcodes, see the [shortcode template docu [sctemps]: /templates/shortcode-templates/ [scvars]: /variables/shortcodes/ [shortcode template documentation]: /templates/shortcode-templates/ -[Speaker Deck]: https://speakerdeck.com/ [templatessection]: /templates/ [Vimeo]: https://vimeo.com/ [YouTube Videos]: https://www.youtube.com/ diff --git a/docs/themes/gohugoioTheme/src/js/hljs.js b/docs/themes/gohugoioTheme/src/js/hljs.js index 05e9acefe..c2252e783 100644 --- a/docs/themes/gohugoioTheme/src/js/hljs.js +++ b/docs/themes/gohugoioTheme/src/js/hljs.js @@ -12,7 +12,7 @@ hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml')); hljs.registerLanguage('html', require('highlight.js/lib/languages/handlebars')); hljs.registerLanguage("go", function(e) { - var t = { keyword: "code output note warning break default func interface select case map struct chan else goto package switch const fallthrough if range end type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune id autoplay Get", literal: "file download copy true false iota nil Pages with", built_in: "append cap close complex highlight copy imag len make new panic print println real recover delete Site Data tweet speakerdeck youtube ref relref vimeo instagram gist figure innershortcode" }; + var t = { keyword: "code output note warning break default func interface select case map struct chan else goto package switch const fallthrough if range end type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune id autoplay Get", literal: "file download copy true false iota nil Pages with", built_in: "append cap close complex highlight copy imag len make new panic print println real recover delete Site Data tweet youtube ref relref vimeo instagram gist figure innershortcode" }; return { aliases: ["golang","hugo"], k: t, i: "</", c: [e.CLCM, e.CBCM, { cN: "string", v: [e.QSM, { b: "'", e: "[^\\\\]'" }, { b: "`", e: "`" }] }, { cN: "number", v: [{ b: e.CNR + "[dflsi]", r: 1 }, e.CNM] }, { b: /:=/ }, { cN: "function", bK: "func", e: /\s*\{/, eE: !0, c: [e.TM, { cN: "params", b: /\(/, e: /\)/, k: t, i: /["']/ }] }] } }); diff --git a/hugolib/embedded_shortcodes_test.go b/hugolib/embedded_shortcodes_test.go index 3de93eef9..36ffe76c5 100644 --- a/hugolib/embedded_shortcodes_test.go +++ b/hugolib/embedded_shortcodes_test.go @@ -160,35 +160,6 @@ title: Shorty } } -func TestShortcodeSpeakerdeck(t *testing.T) { - t.Parallel() - - for _, this := range []struct { - in, expected string - }{ - { - `{{< speakerdeck 4e8126e72d853c0060001f97 >}}`, - "(?s)<script async class='speakerdeck-embed' data-id='4e8126e72d853c0060001f97'.*?>.*?</script>", - }, - } { - - var ( - cfg, fs = newTestCfg() - th = testHelper{cfg, fs, t} - ) - - writeSource(t, fs, filepath.Join("content", "simple.md"), fmt.Sprintf(`--- -title: Shorty ---- -%s`, this.in)) - writeSource(t, fs, filepath.Join("layouts", "_default", "single.html"), `{{ .Content }}`) - - buildSingleSite(t, deps.DepsCfg{Fs: fs, Cfg: cfg}, BuildCfg{}) - - th.assertFileContentRegexp(filepath.Join("public", "simple", "index.html"), this.expected) - } -} - func TestShortcodeYoutube(t *testing.T) { t.Parallel() diff --git a/hugolib/testhelpers_test.go b/hugolib/testhelpers_test.go index 28dd8c125..231200a7b 100644 --- a/hugolib/testhelpers_test.go +++ b/hugolib/testhelpers_test.go @@ -151,7 +151,6 @@ respectDoNotTrack = true anonymizeIP = true [privacy.instagram] simple = true -[privacy.speakerDeck] [privacy.twitter] enableDNT = true [privacy.vimeo] diff --git a/tpl/tplimpl/embedded/templates.autogen.go b/tpl/tplimpl/embedded/templates.autogen.go index 44a330622..7226751b2 100644 --- a/tpl/tplimpl/embedded/templates.autogen.go +++ b/tpl/tplimpl/embedded/templates.autogen.go @@ -384,10 +384,6 @@ if (!doNotTrack) { {{ end }}`}, {`shortcodes/ref.html`, `{{ if len .Params | eq 2 }}{{ ref .Page (.Get 0) (.Get 1) }}{{ else }}{{ ref .Page (.Get 0) }}{{ end }}`}, {`shortcodes/relref.html`, `{{ if len .Params | eq 2 }}{{ relref .Page (.Get 0) (.Get 1) }}{{ else }}{{ relref .Page (.Get 0) }}{{ end }}`}, - {`shortcodes/speakerdeck.html`, `{{- $pc := .Page.Site.Config.Privacy.SpeakerDeck -}} -{{- if not $pc.Disable -}} -<script async class='speakerdeck-embed' data-id='{{ index .Params 0 }}' data-ratio='1.33333333333333' src='//speakerdeck.com/assets/embed.js'></script> -{{- end -}}`}, {`shortcodes/twitter.html`, `{{- $pc := .Page.Site.Config.Privacy.Twitter -}} {{- if not $pc.Disable -}} {{- if $pc.Simple -}} diff --git a/tpl/tplimpl/embedded/templates/shortcodes/speakerdeck.html b/tpl/tplimpl/embedded/templates/shortcodes/speakerdeck.html deleted file mode 100755 index 5a3ca2620..000000000 --- a/tpl/tplimpl/embedded/templates/shortcodes/speakerdeck.html +++ /dev/null @@ -1,4 +0,0 @@ -{{- $pc := .Page.Site.Config.Privacy.SpeakerDeck -}} -{{- if not $pc.Disable -}} -<script async class='speakerdeck-embed' data-id='{{ index .Params 0 }}' data-ratio='1.33333333333333' src='//speakerdeck.com/assets/embed.js'></script> -{{- end -}}
\ No newline at end of file |