Discussion: Too many internal shortcodes?

#1

As an interested user, I watch the Hugo repo, mostly because I like too see how development is going, and have far too many opinions on things. I’ve noticed recently that there are lots of requests for an official shortcode for service X to be part of Hugo.

The issue with allowing ‘some’ shortcodes in is that a line needs to be drawn as to what should and shouldnt be included. The more internal shortcodes there are, the more code there is to maintain. This is especially obvious as GDPR has recently come into affect, and there have been many changes to the internal shortcodes to account for this.

My proposed fix for this relies on the theme composition from https://github.com/gohugoio/hugo/pull/4467. If there was an addition theme, which contained no content pages, but just the shortcodes which originally lived in the hugo binary itself, then users could not only choose if they wanted them, but they could also be edited outside the hugo release cycle. This might be made more interesting with any breaking template changes, if the theme composition doesn’t allow for commit pinning, but that’s separate.

As someone who’s thought through several ways of doing theme composition, and has some really useful generic shortcodes spread around many sites, i’m happy to take up creation / maintenance of this, but I’d like to gauge the community (and Hugo team) opinions on this, and if it’s even remotely a good idea.

Discuss!

0 Likes

Hugo Theme Utils
#2

Here are my thoughts on your proposal:

  • The internal shortcodes are invoked only if a user explicitly invokes them in content files, otherwise they don’t have an impact to Hugo -as far as I know-.

  • The simple variants have been designed and developed to be as minimal as possible and add the least maintenance overhead.

  • I went outside my comfort zone forcing myself to work on the simple variants and I plan to be around to adjust them if such a need arises.

  • Also I’ve seen that theme composition is pretty much the next big thing that Bjørn Erik is currently working on. But only he can give you the feedback you seek, for he calls the shots in Hugo.

  • But if the support forum is an indication then I know first hand that there are people out there who rarely update their Hugo projects. Sometimes it takes months and then they come here demanding answers about why this or that older feature broke.

  • So in my humble opinion if these shortcodes are removed I pretty much expect complaints.

  • Not everyone will find out about the theme you propose. We might make a console message. But then again for automatic deployments that message will still not be good enough.

  • Bottom line. I never had a say about all these shortcodes back when they were introduced. I was never a fan of all these extras and to be honest I never used anything else other than the YouTube shortcode and Google Analytics in a real production website.

  • That’s why I am not a fan of adding more services shortcodes to Hugo.

1 Like

#3

Well guess what… I just opened a GitHub Issue for the removal of the Speaker Deck shortcode.

See here:

https://github.com/gohugoio/hugo/issues/4830

0 Likes

#4

I hope you’ll be around then too :slight_smile: but that future work will hopefully be less work than you had to do with the recent shortcodes/GDPR overhaul. :slight_smile:

0 Likes