Files
liquid/filters/prepend.md
2016-11-08 16:23:33 -05:00

713 B

title, description
title description
prepend Liquid filter that prepends a string to the beginning of another string.

Adds the specified string to the beginning of another string.

Input

```liquid {% raw %} {{ "apples, oranges, and bananas" | prepend: "Some fruit: " }} {% endraw %} ```

Output

```text {{ "apples, oranges, and bananas" | prepend: "Some fruit: " }} ```

You can also prepend variables:

Input

```liquid {% raw %} {% assign url = "liquidmarkup.com" %}

{{ "/index.html" | prepend: url }} {% endraw %}


<p class="code-label">Output</p>
```text
{% assign url = "liquidmarkup.com" %}

{{ "/index.html" | prepend: url }}