Sha256: ff6e29890d6d3635c574486cb7079a169d84c71efb91d0c327ab9dc1589f88cc

Contents?: true

Size: 584 Bytes

Versions: 3

Compression:

Stored size: 584 Bytes

Contents

{%- capture api -%}
Unslug the `include.string` replacing `-` and `_` with spaces. If `include.string` is lowercase output will be capitalized.

- **Usage**

```liquid
{% raw %}{% include filters/unslug.html string=page.title %}{% endraw %}
```
{%- endcapture -%}
{%- include api/save.html -%}
{%- assign words = include.string | replace: '-', ' ' | replace: '_', ' ' | split: ' ' -%}
{%- for word in words -%}
  {%- assign word_lowercase = word | downcase -%}
  {%- if word == word_lowercase -%}
{{ word | capitalize }} {%- else -%}
{{ word }} {%- endif -%}
{%- endfor -%}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-any-theme-0.1.2 _includes/filters/unslug.html
jekyll-any-theme-0.1.1 _includes/filters/unslug.html
jekyll-any-theme-0.1.0 _includes/filters/unslug.html