Skip to content

Commit

Permalink
v2.0.0 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x authored Nov 18, 2018
1 parent 998de6c commit 3aa2f4d
Show file tree
Hide file tree
Showing 10 changed files with 614 additions and 293 deletions.
8 changes: 3 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# editorconfig.org

root = true

[*]
Expand All @@ -10,8 +8,8 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.php]
indent_size = 4

[resources/views/**.php]
indent_size = 2
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Vendor (e.g. Composer)
vendor

# Visual Studio
.vscode

# macOS
.DS_Store
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Brandon Nifong

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
62 changes: 22 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,39 @@

[![Latest Stable Version](https://poser.pugx.org/log1x/blade-svg-sage/v/stable)](https://packagist.org/packages/log1x/blade-svg-sage) [![Total Downloads](https://poser.pugx.org/log1x/blade-svg-sage/downloads)](https://packagist.org/packages/log1x/blade-svg-sage)

Blade SVG for Sage is a wrapper for [Blade SVG](https://github.com/adamwathan/blade-svg) by Adam Wathan allowing you to easily use SVG's in your Blade templates, either as inline SVG or using SVG sprites when using Sage 9.
Blade SVG for Sage is a wrapper for [Blade SVG](https://github.com/adamwathan/blade-svg) by Adam Wathan allowing you to easily use SVG's in your Blade templates, either as an inline SVG or SVG sprite when using Sage 9.

## Installation

#### Composer
Install via Composer from your theme directory:

```
$ composer require log1x/blade-svg-sage
```
## Requirements

## Setup
* [Sage](https://github.com/roots/sage) >= 9.0
* [PHP](https://secure.php.net/manual/en/install.php) >= 7.0
* [Composer](https://getcomposer.org/download/)

Edit `app/filters.php` on your Sage theme and use these filters to modify the default configuration (as in the examples below):
## Installation

```
add_filter('bladesvg_spritesheet_path', function () {
return \BladeSvgSage\get_dist_path('images/svg/icons');
});
```
Install via Composer:

```
add_filter('bladesvg_image_path', function () {
return \BladeSvgSage\get_dist_path('images/svg/icons');
});
```bash
$ composer require log1x/blade-svg-sage
```

```
add_filter('bladesvg_inline', function () {
return true;
});
```
## Configuration

```
add_filter('bladesvg_class', function () {
return 'svg';
});
```
Use the provided configuration filter below to modify the default configuration.

```
add_filter('bladesvg_sprite_prefix', function () {
return '';
```php
add_filter('bladesvg', function () {
return [
'svg_path' => 'resources/svg',
'spritesheet_path' => 'resources/svg/spritesheet.svg',
'spritesheet_url' => '',
'sprite_prefix' => '',
'inline' => true,
'class' => ''
];
});
```

## Usage
```
<ul>
<li>@svg('phone')</li>
<li>{{ \BladeSvgSage\svg_image('phone-alt') }}</li>
</ul>
```

For more examples of usage, please refer to the original [blade-svg readme](https://github.com/adamwathan/blade-svg/blob/master/readme.md).
Please refer to the original [Blade SVG documentation](https://github.com/adamwathan/blade-svg#basic-usage) for usage examples.
49 changes: 30 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
{
"name": "log1x/blade-svg-sage",
"type": "package",
"license": "MIT",
"homepage": "https://github.com/log1x/blade-svg-sage",
"authors": [
{
"name": "Brandon Nifong",
"email": "[email protected]"
}
],
"require": {
"nothingworks/blade-svg": "^0.2.1",
"wikimedia/relpath": "^2.1"
},
"autoload": {
"files": [
"src/helpers.php",
"src/blade-svg-sage.php"
]
"name": "log1x/blade-svg-sage",
"type": "package",
"license": "MIT",
"description": "Composer package to add support for Blade SVG by Adam Wathan to Roots Sage.",
"homepage": "https://github.com/log1x/blade-svg-sage",
"authors": [
{
"name": "Brandon Nifong",
"email": "[email protected]"
}
],
"keywords": [
"roots",
"sage",
"wordpress",
"blade",
"svg"
],
"support": {
"issues": "https://github.com/Log1x/blade-svg-sage/issues"
},
"require": {
"php": ">=7.0",
"nothingworks/blade-svg": "^0.3.0"
},
"autoload": {
"files": [
"src/BladeSvgSage.php",
"src/helpers.php"
]
}
}
Loading

0 comments on commit 3aa2f4d

Please sign in to comment.