# My custom shortcodes

**URL:** https://discourse.gohugo.io/t/my-custom-shortcodes/7557
**Category:** tips & tricks
**Created:** [July 23, 2017, 2:40pm UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557 "2017-07-23T14:40:19Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![umtksa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/umtksa/32/3722_2.png) [@umtksa](https://discourse.gohugo.io/u/umtksa)
#### Post date: [July 23, 2017, 2:40pm UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/1 "2017-07-23T14:40:19Z")

</div>

Hi all, best feature of Hugo is shortcodes for me.  
I’m using them as html snippets  
Now I’m collecting them on a github reposity.  
feel free to conribute or comment  
[here is the github page](https://github.com/umtksa/hugo-short-code)  
[and demo](https://umtksa.github.io/example.html)

_`Youtube and dailymotion is working on local but its broken when i upload them :/`_

---

<div class="post-metadata">

### Author: ![Leo\_Merkel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/leo_merkel/32/3321_2.png) [@Leo\_Merkel](https://discourse.gohugo.io/u/Leo_Merkel)
#### Post date: [July 23, 2017, 6:41pm UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/2 "2017-07-23T18:41:40Z")

</div>

Good idea. Do you know about the internal Hugo shortcodes which come out of the box? It’s figure, gist, instagram, ref and relref, tweet, vimeo, youtube etc. They’re here: [https://gohugo.io/content-management/shortcodes/#readout](https://gohugo.io/content-management/shortcodes/#readout)

---

<div class="post-metadata">

### Author: ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)
#### Post date: [July 23, 2017, 6:49pm UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/3 "2017-07-23T18:49:24Z")

</div>

I’m working on making a website that will compile hugo shortcodes from around the web and ones that users submit. It’ll include some teaching on what each part does for people to learn and understand more and organization by some categories.

---

<div class="post-metadata">

### Author: ![Leo\_Merkel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/leo_merkel/32/3321_2.png) [@Leo\_Merkel](https://discourse.gohugo.io/u/Leo_Merkel)
#### Post date: [July 23, 2017, 7:06pm UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/4 "2017-07-23T19:06:17Z")

</div>

Great. I use shortcodes a lot and take a look in my archive. If there’s something of interest I’ll give it to you. I assume I can contribute to the repo once it’s online, right?

---

<div class="post-metadata">

### Author: ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)
#### Post date: [July 23, 2017, 7:10pm UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/5 "2017-07-23T19:10:34Z")

</div>

Yea i’m not sure how I’ll manage the contributions, if it’ll be some kind of repo or some other way to contribute.

---

<div class="post-metadata">

### Author: ![Leo\_Merkel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/leo_merkel/32/3321_2.png) [@Leo\_Merkel](https://discourse.gohugo.io/u/Leo_Merkel)
#### Post date: [July 23, 2017, 7:13pm UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/6 "2017-07-23T19:13:43Z")

</div>

I would build a Github or Bitbucket repo. So others can send commit requests and you can decide whether or how to implement. This is how I work with my team which is spread over the country. You can even make a Github pages website from that repo - totally flexible.

Here’s an interesting shortcode for you: [https://gist.github.com/Lego2012/281b51bbdee9b5a4f8851ace24bb85fe](https://gist.github.com/Lego2012/281b51bbdee9b5a4f8851ace24bb85fe)

---

<div class="post-metadata">

### Author: ![Leo\_Merkel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/leo_merkel/32/3321_2.png) [@Leo\_Merkel](https://discourse.gohugo.io/u/Leo_Merkel)
#### Post date: [July 23, 2017, 7:16pm UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/7 "2017-07-23T19:16:16Z")

</div>

Here’s another one which I found during my searches. It’s not completely done by me but the basics by someone I don’t know: [https://gist.github.com/Lego2012/74c9d19b5706af6ce393ca15cd40cde9](https://gist.github.com/Lego2012/74c9d19b5706af6ce393ca15cd40cde9)

---

<div class="post-metadata">

### Author: ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)
#### Post date: [July 23, 2017, 7:17pm UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/8 "2017-07-23T19:17:25Z")

</div>

yea, i guess i could have a repo separate from the website repo… to keep things clear and separate. thanks for the idea

---

<div class="post-metadata">

### Author: ![aklahoti](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/aklahoti/32/11550_2.png) [@aklahoti](https://discourse.gohugo.io/u/aklahoti)
#### Post date: [June 4, 2020, 10:18am UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/9 "2020-06-04T10:18:23Z")

</div>

I generated my blog website ([https://codingnconcepts.com/](https://codingnconcepts.com/)) using hugo static site generator. I am using quite a few shortcodes which I find very useful like

1. Current Year
2. Link to open in a new browser window
3. Highlighter
4. Strikethrough
5. Code Block Output

I have written how to create them from scratch here:-

> **[Useful Hugo Shortcodes](https://codingnconcepts.com/hugo/custom-shortcode-hugo/)**
>
> Learn how to make custom hugo shortcode, some useful hugo shortcode with examples, and how to escape hugo shortcode

---

<div class="post-metadata">

### Author: ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)
#### Post date: [June 4, 2020, 10:55am UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/10 "2020-06-04T10:55:27Z")

</div>

Useful, curious, though:

> This is the most trending post of the year {{\< year \>}}

How do you know that that post will always be the most trending? 🙂

---

<div class="post-metadata">

### Author: ![aklahoti](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/aklahoti/32/11550_2.png) [@aklahoti](https://discourse.gohugo.io/u/aklahoti)
#### Post date: [June 4, 2020, 12:19pm UTC](https://discourse.gohugo.io/t/my-custom-shortcodes/7557/11 "2020-06-04T12:19:05Z")

</div>

Haha, you caught me, l changed the statement of the example in my blog…haha 😉
