Download the PHP package shdev/spress-plugin-assets without Composer

On this page you can find all versions of the php package shdev/spress-plugin-assets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package spress-plugin-assets

Assets plugin for Spress

Spress 2 ready

This plugin has the aim to bring the most features of jekyll-assets to SPRESS.

**This plugin requires Spress >= 2.2.

How to install?

Go to your site folder and input the following command:

As as soft dependency you need ImageMagick

Under macOS I used Homebrew to install it with

How to use?

Store your assets in src/assets with your folder structure

For example this structure

In config.yml you can set the following options. Here the default values are displayed.

asset_output_path the path where the file is stored during building.

asset_output_web_prefix is the path prefix for the link.

asset_defaults_gravity is the default gravity for cropping a image if nothing is given in asset-filter options

asset_defaults_quality is the default quality for images. I would recommend 90. If this is null imagemagick is not necessary as dependency.

For example if you use a CDN you want the assets in an own build-folder and the URL prefix contains information about your CDN.

In your template you use the path relative to src/assets for your items with the asset filters.

Filter asset_path

This filter gives the path of

Renders the URL

and writes the file

You see the output file is enriched with a hash value. It's a md5 sum which depends on the content of the file and some other information.

Filter img

Renders the HTML

and writes the file

Filter css

Renders the HTML

and writes the file

Filter js

Renders the HTML

and writes the file

Filter options for img|css|js

If you want to set some attributes to the tags use the attr options. This options only effects the render output.

Example with img

Renders the HTML

Filter options for all tags if the file extension is jpg|jpeg|png|gif

Like the shining example jekyll-assets it uses ImageMagick for image manipulation.

You can use it with every filter but it should only usefull with img and asset_path

This options of the convert-command are used:

Also when crop is used a +repage will appended, look here repage for more information

Here an example with all options at once

This creates a new images which is quadratic.

Renders the HTML

and writes the file

Be informed different image transformation options lead to other hash values used for the file.

So

will not create the file

Cache folder

For a better performance the plugin cached all files in the folder .cache/assets. This saved time for the image manipulation. It will not clear old unused file. So please clean it up from time to time.

asset boost on apache webserver

As an extra you can asset boost your site if it runs with an apache webserver with the following .htaccess options.

I generate the gzip files as an after build step.

Wished features for the next releases


All versions of spress-plugin-assets with dependencies

PHP Build Version
Package Version
Requires spress/spress-installer Version 2.0.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shdev/spress-plugin-assets contains the following files

Loading the files please wait ....