gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.15k stars 7.48k forks source link

Add built-in shortcodes for common usecases #1576

Closed digitalcraftsman closed 8 years ago

digitalcraftsman commented 8 years ago

Why shouldn't we add a number of shortcodes for the most popular usecases and services. New users could use them out of the box without the need of creating them manually.

Follow the forum discussion for more information.

Just a quick compilation of usecases / services (todo list):

derekperkins commented 8 years ago

@digitalcraftsman - that's a good idea and not particularly difficult to implement. If you could figure out what the input options should be and sample output, that'd make it a piece of cake.

digitalcraftsman commented 8 years ago

@derekperkins - below you find a list of the syntax that user would use to call the shortcodes. Do you think that something could be improved?

Twitter

To embed a single tweet the user needs to pass a username and the id of the tweet:

{{< tweet spf13 666616452582129664 >}}

Speakerdeck

Required is the id of the slide. This id can be found on the right side of the presentation on Speakerdeck under 'Direct link'

{{< speakerdeck 4e8126e72d853c0060001f97 >}}

YouTube

Just the id of the video is required:

{{< youtube w7Ft2ymGmfc >}}

Vimeo

Just the id of the video is required:

{{< vimeo 146022717 >}}

Gists

Gists would need the owner's username and its unique id:

{{< gist digitalcraftsman 85f59771b5ae1e2091a8 >}}
bep commented 8 years ago

A comment for the documentation: You only need quoted parameters if you have spaces or very special chars, so this is better:

{{< youtube w7Ft2ymGmfc >}}
digitalcraftsman commented 8 years ago

Thanks for annotating this. I'll update the examples above.

digitalcraftsman commented 8 years ago

All shortcodes are implemented (including Twitter) and the docs have been written.

derekperkins commented 8 years ago

Awesome!

umtksa commented 7 years ago

how about responsive vimeo and youtube i have some custom shortcodes here

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.