From d3382f65204faf799bb6124731aa4056d5b8e770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 22 Aug 2015 10:47:56 +0200 Subject: [PATCH] README: clarify expected contents of the assets file (#8066) --- README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 13b4ee6..bf15bf8 100644 --- a/README.md +++ b/README.md @@ -64,24 +64,27 @@ file transfer and chromium zip. The *meta* section in the manifest }, ...} -And here is what is supposed to be the content of `assets.zip`: +The assets.zip file will be downloaded and uncompressed right into the +application root folder; beware this could overwrite files, it is advised +to use subdirectories (typically the zip file should contain its files in +a assets/ directory). -- `index.js`: Some extra script to be loaded dynamically in the application -- `index.css`: A css stylesheet that will be injected as well -- `*.[png,woff,...]`: images, fonts & other static files +The zip file structure could look like this: -In the `www/index.json` pages content, you must specify url to you assets using -relative path prefixed with `assets/`, like so: +- `assets/index.js`: Some extra script to be loaded dynamically in the application +- `assets/index.css`: A css stylesheet that will be injected as well +- `assets/*.[png,woff,...]`: images, fonts & other static files + + +In the manifest pages content, you must specify URLs to you assets using paths +relative to the root of the assets.zip. If it contains an image in +assets/dijon.jpg, it should be referenced like this: { "title": "Ma ville", "content": "

Bienvenue !

" } -In stylesheets however, you should only be able to give relative references , as -such: - - background: img(../img/bg.png) top left repeat; Don't forget to enable CORS on the server that will distribute the assets.