1.0.4 • Published 4 years ago

@gauntface/html-asset-manager v1.0.4

Weekly downloads
19
License
Apache-2.0
Repository
github
Last release
4 years ago

HTML Asset Manager

Build and Test Publish

Run go-html-asset-manager commands easily from node.

Install

go get -u github.com/gauntface/go-html-asset-manager/cmds/htmlassets/
go get -u github.com/gauntface/go-html-asset-manager/cmds/genimgs/

API

const ham = require('@gauntface/html-asset-manager');

// manage assets
await ham.manageAssets({
  config: path.join('~/example-project/asset-manage.json'),
  output: true,
  vimeo: process.env['VIMEO_TOKEN'],
  debug: 'example-file.html',
});

// generage images
await ham.generateImages({
  config: path.join('~/example-project/asset-manage.json'),
  output: true,
});

Config File

{
  "html-dir": "public/",
  "assets": {
    "static-dir": "public/",
    "generated-dir": "public/generated/",
    "json-dir": "data/"
  },
  "gen-assets": {
    "static-dir": "static/",
    "output-dir": "static/generated/",
    "max-width": 800,
    "max-density": 3
  },
  "img-to-picture": [
    {
      "id": "l-blog",
      "max-width": 800,
      "source-sizes": [
        "(min-width: 800px) 800px",
        "100vw"
      ]
    },
    {
      "id": "c-blog-item__img",
      "max-width": 200,
      "source-sizes": [
        "(min-width: 800px) 200px",
        "20vw"
      ]
    }
  ],
  "ratio-wrapper": ["l-blog"]
}
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago