-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97cc84f
commit d4bdd1f
Showing
10 changed files
with
1,028 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
_site | ||
.sass-cache | ||
.jekyll-cache | ||
.jekyll-metadata | ||
vendor | ||
|
||
Gemfile | ||
Gemfile.lock | ||
gems.rb | ||
gems.locked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: Home | ||
nav_order: 0 | ||
permalink: / | ||
--- | ||
|
||
# Inpsyde Assets | ||
|
||
## Introduction | ||
Inpsyde Assets is a Composer package (not a plugin) that allows to deal with scripts and styles in a WordPress site. | ||
|
||
## Installation | ||
|
||
```bash | ||
$ composer require inpsyde/assets | ||
``` | ||
|
||
## Minimum Requirements and Dependencies | ||
|
||
* PHP 7.2+ | ||
* WordPress latest-2 | ||
|
||
When installed for development, via Composer, Inpsyde Assets also requires: | ||
|
||
* phpunit/phpunit (BSD-3-Clause) | ||
* brain/monkey (MIT) | ||
* inpsyde/php-coding-standards | ||
|
||
## License and Copyright | ||
|
||
Copyright (c) Inpsyde GmbH. | ||
|
||
The team at [Inpsyde](https://inpsyde.com) is engineering the Web since 2006. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
title: Inpsyde Assets | ||
description: >- | ||
Inpsyde Assets is a Composer package (not a plugin) that allows to deal with scripts and styles in a WordPress site. | ||
baseurl: /assets # Your repo name with a leading slash. | ||
|
||
# Aux links for the upper right navigation | ||
aux_links: | ||
"Inpsyde Assets on GitHub": | ||
- https://github.com/inpsyde/assets | ||
|
||
# Footer "Edit this page on GitHub" link text | ||
gh_edit_repository: https://github.com/inpsyde/assets # Your repo GitHub URL | ||
|
||
# Everything above is repo specific. | ||
|
||
############################################################### | ||
|
||
# This section is repo specific. These can be omitted if defaults make sense. | ||
|
||
gh_edit_branch: master # The default branch of the repo. Default: main | ||
gh_edit_source: docs # The directory containing the docs. Default: docs | ||
|
||
############################################################### | ||
|
||
# Everything below should be copy and pasted into package repos | ||
remote_theme: inpsyde/jekyll-syde-theme | ||
|
||
############################################################### | ||
|
||
# Everything below should be copy and pasted into package repos | ||
# To be replaced by jekyll-inpsyde-theme's `_config.yml` when GitHub Pages supports Jekyll v4. | ||
|
||
plugins: | ||
- jekyll-remote-theme | ||
- jekyll-seo-tag | ||
- jekyll-sitemap | ||
- jemoji | ||
|
||
permalink: pretty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
nav_order: 2 | ||
--- | ||
# Asset Factory | ||
{: .no_toc } | ||
## Table of contents | ||
{: .no_toc .text-delta } | ||
1. TOC | ||
{:toc} | ||
--- | ||
|
||
## `AssetFactory` | ||
Instead of creating instances by hand, it's sometimes easier to use configuration via array or file to manage your specific assets. | ||
|
||
**:warning: Note:** The `AssetFactory` is replaced step by step via Loaders. Methods are set to `@deprecated` which have been moved to a Loader. | ||
|
||
## `AssetFactory::create()` | ||
|
||
To create a single Asset from an array, you can do following: | ||
|
||
```php | ||
<?php | ||
use Inpsyde\Assets\AssetFactory; | ||
use Inpsyde\Assets\Asset; | ||
use Inpsyde\Assets\Style; | ||
|
||
/** @var Style $asset */ | ||
$asset = AssetFactory::create( | ||
[ | ||
'handle' => 'foo', | ||
'url' => 'www.example.com/assets/style.css', | ||
'location' => Asset::FRONTEND, | ||
'type' => Style::class | ||
], | ||
); | ||
``` |
Oops, something went wrong.