https://github.com/timber/sugar
Some bonus functionality for Timber
https://github.com/timber/sugar
php timber twig wordpress
Last synced: 3 months ago
JSON representation
Some bonus functionality for Timber
- Host: GitHub
- URL: https://github.com/timber/sugar
- Owner: timber
- License: gpl-2.0
- Created: 2014-05-12T20:59:20.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-06-01T01:54:34.000Z (about 9 years ago)
- Last Synced: 2025-04-03T11:43:51.615Z (3 months ago)
- Topics: php, timber, twig, wordpress
- Language: PHP
- Size: 57.6 KB
- Stars: 45
- Watchers: 13
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Timber Sugar
[](https://travis-ci.org/timber/sugar)
[](https://coveralls.io/r/timber/sugar?branch=master)Some bonus functionality for Timber. Install it in `wp-content/plugins` and activate via the WordPress admin. Featuring...
### `dummy`
Throw some dummy lorem ipsum where you need it...
```html+djangoSome title
{{dummy(500)|wpautop}}
```
... this outputs 500 words of random lorem ipsum.###### Use it as a filter
```html+django{{post.title|dummy(15)}}
```
... this outputs 15 words of lorem ipsum _if_ post.title is empty### `twitterify`
Take a string with @handles and #hashTags and make them links:
```html+django
{{tweet.content|twitterify}}
```Outputs...
```html
You should follow @TimberWP
if you love #wordpress
```