Convert your webpage to platformOS one
This CLI consists of commands that are performing single operations on a webpage.
This is the order they should be run on:
posify download -u url
(after download is complete, go into the directory,cd <domain>
)posify urls
posify forms
Optionally, if not sure that assets are correctly optimized (usually they are not):
posify optimize:css
posify optimize:js
posify optimize:images
All paths are lowercased to guarantee compatibility. Some webpages were using methods incompatible with mac OS.
So path https://example.com/IMAGES/bg.jpg
will become a file app/assets/images/bg.jpg
Some pages have both: Images/bg.jpg
and images/avatar.jpg
on the same page, but because Images
and images
directories cannot coexist in the same place on mac OS, it caused some assets to be in the wrong place.
$ npm install -g posify
$ posify help [COMMAND]
$ posify (-v|--version|version)
Example:
$ posify help
$ posify help download
$ posify -v
posify/0.1.1 darwin-x64 node-v12.16.1
posify download --url http://example.com
posify forms
posify help [COMMAND]
posify optimize:css
posify optimize:images
posify optimize:js
posify urls
Download a complete webpage with assets
USAGE
$ posify download --url http://example.com
OPTIONS
-c, --concurrency=concurrency [default: 5] Max concurrent connections
-u, --url=url (required) URL of webpage to download
DESCRIPTION
Downloads resources needed to display a webpage.
It will download files only within the same root domain.
For example, if you download https://my.example.site.example.com,
only files within example.com will be downloaded.
EXAMPLES
posify download -c 25 -u http://example.com
See code: src/commands/download.js
Installs Simpleform module
USAGE
$ posify forms
DESCRIPTION
Install Simpleform module. It sends email to the app owner when form is submitted.
This command will create modules/ directory in current directory.
You should run this command in root directory of the project (where you see app/)
See code: src/commands/forms.js
display help for posify
USAGE
$ posify help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
Minify CSS files
USAGE
$ posify optimize:css
DESCRIPTION
Makes your CSS files smaller and production ready
Ignores files that end with .min.css
See code: src/commands/optimize/css.js
Optimize images to make them smaller - mac OS only
USAGE
$ posify optimize:images
OPTIONS
-q, --quality=quality [default: 70-85] Quality range
DESCRIPTION
Optimize jpeg/jpg, png, gif, svg and webp files to make them web-ready
Requires ImageOptim to be installed in the system.
Install via brew: "brew update && brew cask install imageoptim"
Install with GUI: https://imageoptim.com/mac
See code: src/commands/optimize/images.js
Minify JS code
USAGE
$ posify optimize:js
DESCRIPTION
Makes your JS files smaller and production ready
Ignores files that end with .min.js
See code: src/commands/optimize/js.js
Update relative paths to use platformOS CDN
USAGE
$ posify urls
DESCRIPTION
Find and replace urls in html files, mostly needed for assets and forms.
It will also remove any onsubmit attributes from forms.
See code: src/commands/urls.js