title |
---|
Liquid Filters |
Because Jekyll uses Liquid for template processing, jekyll-octopod does so, too. Along with the standard liquid tags and filters, Jekyll adds a few of its own and jekyll-octopod adds a few more which are documented on this page.
Escapes some text for CDATA
{% raw %}
{{ page.content | cdata_escape }}
{% endraw %}
Escapes HTML entities in JSON strings.
{% raw %}
{{ page.some_string | j }}
{% endraw %}
Replaces relative urls with full urls
{% raw %}
{{ "about.html" | expand_urls }} => "/about.html"
{{ "about.html" | expand_urls:site.url }} => "http://example.com/about.html"
{% endraw %}
Removes unwanted tags from shownotes
{% raw %}
{{ page.content | remove_script_and_audio }}
{% endraw %}
changes url from requesting https to http
{% raw %}
{{ url | http_only }} => "http://..."
{% endraw %}
Formats a Time to be RSS compatible.
{% raw %}
{{ site.time | time_to_rssschema }} => "Wed, 15 Jun 2005 19:00:00 GMT"
{% endraw %}
Returns the first argument if it's not nil or empty -- otherwise it returns the second one.
{% raw %}
{{ post.author | otherwise:site.author }}
{% endraw %}
Returns the value of a given hash. If no key is given as a second parameter, it first tries "mp3", then "m4a" and then it will return a more or less random value.
{% raw %}
{{ post.audio | audio:"m4a" }} => "my-episode.m4a"
{% endraw %}
Returns the MIME-Type of a given file format.
{% raw %}
{{ "opus" | mime_type }} => "ogg; codecs=opus"
{% endraw %}
Returns the size of a given file in bytes. If there is just a filename without a path, this method assumes that the file is an episode audio file which lives in /episodes.
{% raw %}
{{ "example.m4a" | file_size }} => 4242
{% endraw %}
Returns a slug based on the id of a given page.
{% raw %}
{{ page | slug }} => '2012_10_02_octopod'
{% endraw %}
Splits a chapter, like it is written to the post YAML front matter, into the components 'start' -- which refers to a single point in time relative to the beginning of the media file -- and 'title' -- which defines the text to be the title of the chapter.
{% raw %}
{{ '00:00:00.000 Welcome to Octopod!' | split_chapter }} =>
{ 'start' => '00:00:00.000', 'title' => 'Welcome to Octopod!' }
{{ '00:00:00.000 Welcome to Octopod!' | split_chapter:'title' }} => 'Welcome to Octopod!'
{{ '00:00:00.000 Welcome to Octopod!' | split_chapter:'start' }} => '00:00:00.000'
{% endraw %}
Returns an <audio>
tag for a given page with <source>
tags in it for every audio file in the page's YAML front matter.
{% raw %}
{{ page | audio_tag:site }}
{% endraw %}
Returns the web player iframe for the episode of a given page.
{% raw %}
{{ page | web_player_moderator:site }}
{% endraw %}
Returns the web player for the episode of a given page, to be used in the file created for the iframe mentioned above.
{% raw %}
{{ page | web_player:site }}
{% endraw %}
Returns the script tag initializing the web player for the episode of a given page, to be used in the file created for the iframe mentioned above.
{% raw %}
{{ page | web_player_script_tag:site }}
{% endraw %}
Gets a number of seconds and returns a human readable duration string of it.
{% raw %}
{{ 1252251 | string_of_duration }} => "00:03:13"
{% endraw %}
Gets a number of bytes and returns a human readable string of it.
{% raw %}
{{ 1252251 | string_of_size }} => "1.19M"
{% endraw %}
Returns the host of a given url
{% raw %}
{{ 'https://github.com/pattex/octopod' | host_from_url }} => "github.com"
{% endraw %}
Generates the config for disqus integration. If a page object is given, it generates the config variables only for this page. Otherwise, it only generates the global config variables.
{% raw %}
{{ site | disqus_config }}
{{ site | disqus_config:page }}
{% endraw %}
Returns the hex-encoded hash value of a given string. The optional second argument defines the length of the returned string.
{% raw %}
{{ "Octopod" | sha1 }} => "8b20a59c"
{{ "Octopod" | sha1:23 }} => "8b20a59c8e2dcb5e1f845ba"
{% endraw %}
Returns a ready-to-use navigation list of all pages that have navigation
set in their YAML front matter.
The list is sorted by the value of navigation
.
{% raw %}
{{ site | navigation_list:page }}
{% endraw %}
Returns an array of all episode feeds named by the convention episodes.<episode_file_format>.rss
within the root directory.
Also it contains all additional feeds specified by additional_feeds
in the _config.yml
.
If an episode_file_format
or key of additional_feeds
equals the optional parameter, it will be skipped.
{% raw %}
{{ site | episode_feeds }}
{{ site | episode_feeds:mp3 }}
{% endraw %}
Returns HTML links to all episode feeds named by the convention episodes.<episode_file_format>.rss
within the root directory.
Also it returns all additional feeds specified by additional_feeds
in the _config.yml
.
If an episode_file_format
or key of additional_feeds
equals the optional parameter, it will be skipped.
{% raw %}
{{ site | episode_feeds_html:'m4a' }} =>
<link rel="alternate" type="application/rss+xml" title="mp3 Episode RSS-Feed"
href="/episodes.mp3.rss" />
<link rel="alternate" type="application/rss+xml" title="Torrent Feed m4a"
href="http://bitlove.org/octopod/octopod_m4a/feed" />
<link rel="alternate" type="application/rss+xml" title="Torrent Feed mp3"
href="http://bitlove.org/octopod/octopod_mp3/feed" />
{% endraw %}
Returns RSS-XML links to all episode feeds named by the convention episodes.<episode_file_format>.rss
within the root directory.
Also it returns all additional feeds specified by additional_feeds
in the _config.yml
.
If an episode_file_format
or key of additional_feeds
equals the optional parameter, it will be skipped.
{% raw %}
{{ site | episode_feeds_rss:'m4a' }} =>
<atom:link rel="alternate" href="/episodes.mp3.rss"
type="application/rss+xml" title="mp3 Episode RSS-Feed"/>
<atom:link rel="alternate" href="http://bitlove.org/octopod/octopod_m4a/feed"
type="application/rss+xml" title="Torrent Feed m4a"/>
<atom:link rel="alternate" href="http://bitlove.org/octopod/octopod_mp3/feed"
type="application/rss+xml" title="Torrent Feed mp3"/>
{% endraw %}