Skip to content

Commit a56c462

Browse files
committed
initial commit
0 parents  commit a56c462

13 files changed

+347
-0
lines changed

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Brad Frost, http://bradfrostweb.com & Dave Olsen, http://dmolsen.com
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

composer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "pattern-lab/drupal-twig-components",
3+
"description": "A collection of Twig components to be used with Drupal- and Twig-related StarterKits.",
4+
"keywords": ["drupal", "pattern lab", "twig"],
5+
"homepage": "http://patternlab.io",
6+
"license": "MIT",
7+
"type": "patternlab-plugin",
8+
"authors": [
9+
{
10+
"name": "Dave Olsen",
11+
"email": "[email protected]",
12+
"homepage": "http://dmolsen.com",
13+
"role": "Lead Developer"
14+
}
15+
],
16+
"support": {
17+
"issues": "https://github.com/pattern-lab/plugin-drupal-twig-components/issues",
18+
"wiki": "http://patternlab.io/docs/",
19+
"source": "https://github.com/pattern-lab/plugin-drupal-twig-components/releases"
20+
},
21+
"extra": {
22+
"patternlab": {
23+
"dist": {
24+
"sourceDir": [
25+
{ "filters/*": "_twig-components/filters/*" },
26+
{ "functions/*": "_twig-components/functions/*" },
27+
{ "tags/*": "_twig-components/tags/*" },
28+
{ "tests/*": "_twig-components/tests/*" }
29+
]
30+
},
31+
}
32+
}
33+
}

dist/filters/clean_class.filter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$filter = new Twig_SimpleFilter('clean_class', function ($string) {
4+
return $string;
5+
});

dist/filters/clean_id.filter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$filter = new Twig_SimpleFilter('clean_id', function ($string) {
4+
return $string;
5+
});

dist/filters/format_date.filter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$filter = new Twig_SimpleFilter('format_date', function ($string) {
4+
return $string;
5+
});

dist/filters/placeholder.filter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$filter = new Twig_SimpleFilter('placeholder', function ($string) {
4+
return $string;
5+
});

dist/filters/safe_join.filter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$filter = new Twig_SimpleFilter('safe_join', function ($string) {
4+
return $string;
5+
});

dist/filters/t.filter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$filter = new Twig_SimpleFilter('t', function ($string) {
4+
return $string;
5+
});

dist/filters/without.filter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$filter = new Twig_SimpleFilter('without', function ($string) {
4+
return $string;
5+
});

dist/functions/link.function.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
$function = new Twig_SimpleFunction(
4+
'link',
5+
function ($title, $url, $attributes) {
6+
if (isset($attributes) && isset($attributes['class'])) {
7+
$classes = join(' ', $attributes['class']);
8+
return '<a href="' . $url . '" class="' . $classes . '">' . $title . '</a>';
9+
} else {
10+
return '<a href="' . $url . '">' . $title . '</a>';
11+
}
12+
},
13+
array('is_safe' => array('html'))
14+
);

0 commit comments

Comments
 (0)