Files
liquid/_filters/prepend.md
2021-04-28 13:43:02 -04:00

725 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: " }} ```

prepend can also accept a variable as its argument.

Input

```liquid {%- raw -%} {% assign url = "example.com" %} {{ "/index.html" | prepend: url }} {% endraw %} ```

Output

```text {% assign url = "example.com" %} {{ "/index.html" | prepend: url }} ```