Skip to content

Commit

Permalink
Restore docs
Browse files Browse the repository at this point in the history
  • Loading branch information
inpsyde-maticluznar committed Jul 24, 2024
1 parent 97cc84f commit d4bdd1f
Show file tree
Hide file tree
Showing 10 changed files with 1,028 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/.gitignore
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
33 changes: 33 additions & 0 deletions docs/README.md
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.
39 changes: 39 additions & 0 deletions docs/_config.yml
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
36 changes: 36 additions & 0 deletions docs/asset-factory.md
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
],
);
```
Loading

0 comments on commit d4bdd1f

Please sign in to comment.