Skip to content

Commit 0b6c195

Browse files
committed
Update readme
1 parent e77e3d0 commit 0b6c195

File tree

4 files changed

+34
-29
lines changed

4 files changed

+34
-29
lines changed

.editorconfig

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
# This file is for unifying the coding style for different editors and IDEs
2-
# editorconfig.org
3-
41
[*]
5-
charset = utf-8
6-
indent_style = space
7-
indent_size = 2
82
end_of_line = lf
9-
insert_final_newline = true
3+
charset = utf-8
104
trim_trailing_whitespace = true
11-
12-
[*.php]
5+
insert_final_newline = true
6+
indent_style = space
137
indent_size = 4
8+
max_line_length = 80
149

15-
[*.md,*.txt]
16-
trim_trailing_whitespace = false
17-
insert_final_newline = false
10+
[*.yml]
11+
indent_size = 2
1812

19-
[composer.json]
20-
indent_size = 4
13+
[*.md]
14+
trim_trailing_whitespace = false

.github/title.png

27.5 KB
Loading

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"printWidth": 80,
3+
"semi": true,
4+
"singleQuote": true,
5+
"trailingComma": "none",
6+
"bracketSpacing": true,
7+
"bracketSameLine": false,
8+
"phpVersion": "7.4",
9+
"trailingCommaPHP": false,
10+
"htmlWhitespaceSensitivity": "css",
11+
"proseWrap": "never"
12+
}

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Kirby Conditional Snippets
1+
![Kirby snippetWhen Helper](.github/title.png)
22

3-
Helper function for Kirby to embed snippets only when a condition is met.
3+
**snippetWhen** is a helper function for [Kirby 3](https://getkirby.com) to conditionally embed snippets.
44

55
## Installation
66

@@ -20,23 +20,22 @@ git submodule add https://github.com/hananils/kirby-snippetwhen-helper.git site/
2020
composer require hananils/kirby-snippetwhen-helper
2121
```
2222

23-
## Usage
23+
# Usage
2424

25-
### snippetWhen($snippet, $condition, $expected, $data)
25+
## snippetWhen($snippet, $condition, $expected, $data)
2626

27-
- `$snippet`: the name of the snippet
28-
- `$condition`: a condition that either evaluates to `true` or `false`
29-
- `$expected`: the expected result of the condition, defaults to `true`
30-
- `$data`: data object passed to the snippet
27+
Conditionally embeds a snippet:
28+
29+
- **`$snippet`:** the name of the snippet
30+
- **`$condition`:** a condition that either evaluates to `true` or `false`
31+
- **`$expected`:** the expected result of the condition, defaults to `true`
32+
- **`$data`:** data object passed to the snippet
3133

3234
```php
33-
snippetWhen('article', $page->category()->isNotEmpty())
35+
snippetWhen('article', $page->category()->isNotEmpty());
3436
```
3537

36-
## License
37-
38-
MIT
39-
40-
## Credits
38+
# License
4139

42-
- hana+nils · Büro für Gestaltung
40+
This plugin is provided freely under the [MIT license](LICENSE.md) by [hana+nils · Büro für Gestaltung](https://hananils.de).
41+
We create visual designs for digital and analog media.

0 commit comments

Comments
 (0)