1. Handlebars Helpers
  2. Stubby Short URL

Handlebars Helpers

Stubby Short URL

Returns a Short URL for any given URL.

Stub.by is a URL shortening service that allows you to create short links for any given URL. This helper will return a HTML Short Link for any given URL.

INFO

IMPORTANT:
Stub.by links are valid for a default of 30 days, you need to set the TTL to 0 to make the permanent

See also: Stubby Short Link

Example definition:

{
short_url
:
{{#stubby_short_url 'https://google.com'}}{{/stubby_short_url}}

Substituted definition

{
short_url
:
https://stub.by/IUjBWLu8

Advanced usage

You can optionally add these extra arguments

  • TTL: (Time To Live) the amount of seconds that the shortcode should exist for. Default is 30 days.
  • Max Hits: The maximum hits allowed for the shortcode before it expires.

Example definition:

{
short_url
:
{{#stubby_short_url stub.stubref 600 5}}{{/stubby_short_url}}

Substituted definition

{
short_url
:
https://stub.by/IUjBWLu8

The above shortcode example will remain active for 10 minutes or until it has been accessed 5 times, which ever condition is met first will expire the shortcode.