question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m wondering how shortcodes might be handled. I really like how Hugo uses shortcodes (https://gohugo.io/content-management/shortcodes/) but they would be even better if they could be run through node scripts (Hugo is written in Golang and has no support for this currently).

Essentially, I’d expect to be able to write little snippets that take arguments, referencing a script that outputs markup and injects it back as part of the processed template. E.g.

{{shortcodeName arg1="foo" arg2="bar"}}

would run a script called shortcodeName.js that takes “foo” and “bar” then exports/returns markup with those values processed somehow.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:26 (13 by maintainers)

github_iconTop GitHub Comments

6reactions
zachleatcommented, Jul 5, 2018

v0.5.0 is out, with Shortcodes!

https://v0-5-0.11ty.io/docs/shortcodes/

5reactions
zachleatcommented, Jan 4, 2018

Also considering something more future-compatible with some form of (no JS at runtime) web components. I think it’s very important to maintain a 0-JS output by default here. I don’t want this to turn into a JS framework.

Discussion here https://twitter.com/zachleat/status/947206049228083201

Highlights https://w3c.github.io/webcomponents/spec/custom/# https://developers.google.com/web/fundamentals/web-components/customelements https://github.com/skatejs/skatejs/blob/master/packages/ssr/README.md

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shortcode - WordPress Codex
Since Version 2.5 WordPress supports so called Shortcodes. They have been introduced for creating macros to be used in a post's content.
Read more >
WordPress Shortcodes: A Complete Guide
The J Shortcodes plugin is similar to Shortcodes Ultimate, offering a collection of useful elements to style a website, including buttons, boxes ...
Read more >
What Are Shortcodes in WordPress? Explained for Beginners
In a nutshell, a shortcode is a small piece of code, indicated by brackets like [this] , that performs a dedicated function on...
Read more >
Shortcodes Ultimate
A comprehensive collection of Visual Components for WordPress - Shortcodes Ultimate. Shortcodes Pricing Docs Support Account Get Started Toggle Menu.
Read more >
WordPress Shortcodes: Ultimate Guide on How to Create and ...
In a nutshell, Shortcode = Shortcut + Code. Typically, shortcodes use square brackets tags [] to define how they're used. Each shortcode ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found