orchid-writers-blocks-feature

A collection of Template Tags and Components that help you get past the writer's block and make building your site a dream.


About

This plugin adds a collection of useful tags and functions for Pebble to make writing content simpler.

Installation

dependencies {
    orchidRuntime("io.github.copper-leaf.orchid:orchid-writers-blocks-feature:0.21.1")
}
<dependency>
    <groupId>io.github.copper-leaf.orchid</groupId>
    <artifactId>orchid-writers-blocks-feature</artifactId>
    <version>0.21.1</version>
    <type>pom</type>
</dependency>
libraryDependencies += "io.github.copper-leaf.orchid" % "orchid-writers-blocks-feature" % "0.21.1"
@file:DependsOn("io.github.copper-leaf.orchid:orchid-writers-blocks-feature:0.21.1")

Demo

Usage

Tags

Alert

Wrap content in a callout or bootstrap-style alert.

{% alert 'warning' %}
    This is your final warning!
{% endalert %}

Github Gist

Embed a Github Gist.

{% gist 'gistId' %}

Instagram

Embed a photo from Instagram.

{% instagram 'username' 'postId' %}

Spotify

Embed a Spotify track or playlist.

{% spotify 'track | playlist' 'trackOrPlaylistID' %}

Tabs

Embed a Twitter post, collection, or timeline.

{% tabs %}
    {% tab1 'One' %}Tab Content One{% endtab1 %}
    {% tab2 'Two' %}Tab Content Two{% endtab2 %}
{% endtabs %}

Twitter

Embed a Twitter post, collection, or timeline.

{% twitter 'username' %}
or
{% twitter 'username' 'tweetId' %}

Youtube

Embed a Youtube video.

{% youtube 'videoId' %}

Functions

Encode Spaces

Converts spaces to HTML-encoded non-breaking spaces to preserve spacing.

{{ encodeSpaces('text to encode') }}

Newline to BR

Converts newlines to BR tags to force HTML line breaks.

{{ nl2br('text to encode') }}

Pluralize

Attempts to convert a word to its English plural form.

{{ pluralize('word', 2) }}

Components

Google Analytics/Tag Manager

The googleAnalytics and googleTagManager add the relevant tracking scripts to your pages as a meta component. By default components are only added in production builds.

Both the googleAnalytics and googleTagManager meta-components work pretty similarly, and are added to your site as follows:

# config.yml
theme:
    metaComponents:
      - type: 'googleAnalytics'
        propertyId: 'UA-XXXXX-Y' # Your Google Analytics Property ID
        productionOnly: true # set to false to add the component in debug builds (for verifying correctness)
# config.yml
theme:
    metaComponents:
      - type: 'googleTagManager'
        containerId: 'GTM-XXXX' # Your GTM container ID
        productionOnly: true # set to false to add the component in debug builds (for verifying correctness)