Projet

Général

Profil

0001-README-clarify-expected-contents-of-the-assets-file-.patch

Frédéric Péters, 22 août 2015 10:48

Télécharger (2 ko)

Voir les différences:

Subject: [PATCH] README: clarify expected contents of the assets file (#8066)

 README.md | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
README.md
64 64

  
65 65
    }, ...}
66 66

  
67
And here is what is supposed to be the content of `assets.zip`:
67
The assets.zip file will be downloaded and uncompressed right into the
68
application root folder; beware this could overwrite files, it is advised
69
to use subdirectories (typically the zip file should contain its files in
70
a assets/ directory).
68 71

  
69
- `index.js`: Some extra script to be loaded dynamically in the application
70
- `index.css`: A css stylesheet that will be injected as well
71
- `*.[png,woff,...]`: images, fonts & other static files
72
The zip file structure could look like this:
72 73

  
73
In the `www/index.json` pages content, you must specify url to you assets using
74
relative path prefixed with `assets/`, like so:
74
- `assets/index.js`: Some extra script to be loaded dynamically in the application
75
- `assets/index.css`: A css stylesheet that will be injected as well
76
- `assets/*.[png,woff,...]`: images, fonts & other static files
77

  
78

  
79
In the manifest pages content, you must specify URLs to you assets using paths
80
relative to the root of the assets.zip. If it contains an image in
81
assets/dijon.jpg, it should be referenced like this:
75 82

  
76 83
    {
77 84
        "title": "Ma ville",
78 85
        "content": "<p>Bienvenue !</p><img src='assets/dijon.jpg' class='momo-image' />"
79 86
    }
80 87

  
81
In stylesheets however, you should only be able to give relative references , as
82
such:
83

  
84
    background: img(../img/bg.png) top left repeat;
85 88

  
86 89
Don't forget to enable CORS on the server that will distribute the assets.
87 90

  
88
-