Shortcodes
See original GitHub issueI’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:
- Created 6 years ago
- Reactions:12
- Comments:26 (13 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
v0.5.0 is out, with Shortcodes!
https://v0-5-0.11ty.io/docs/shortcodes/
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