OLD | NEW |
1 # Generating static files # | 1 # Generating static files # |
2 | 2 |
3 On your production server you should convert the content directory into static | 3 On your production server you should convert the content directory into static |
4 files. To do that you need: | 4 files. To do that you need: |
5 | 5 |
6 * Python 2.7 | 6 * Python 2.7 |
7 * [Jinja2](http://jinja.pocoo.org/) and | 7 * [Jinja2](http://jinja.pocoo.org/) and |
8 [Markdown](https://pypi.python.org/pypi/Markdown) modules (can be installed by | 8 [Markdown](https://pypi.python.org/pypi/Markdown) modules (can be installed by |
9 running `easy_install Jinja2 Markdown` from the command line) | 9 running `easy_install Jinja2 Markdown` from the command line) |
10 * A current copy of the | 10 * A current copy of the |
11 [cms repository](https://github.com/adblockplus/cms/) (can be | 11 [cms repository](https://github.com/adblockplus/cms/) (can be |
12 [downloaded as ZIP file](https://github.com/adblockplus/cms/archive/master.zip
) | 12 [downloaded as ZIP file](https://github.com/adblockplus/cms/archive/master.zip
) |
13 or cloned via `git clone https://github.com/adblockplus/cms.git`) | 13 or cloned via `git clone https://github.com/adblockplus/cms.git`) |
14 | 14 |
15 Run the following command from the directory of the `cms` repository: | 15 Run the following command from the directory of the `cms` repository: |
16 | 16 |
17 python -m cms.bin.generate_static_pages www_directory target_directory | 17 python -m cms.bin.generate_static_pages www_directory target_directory |
18 | 18 |
19 Here `www_directory` should be replaced by the path to your content directory. | 19 Here `www_directory` should be replaced by the path to your content directory. |
20 `target_directory` is the path where static files will be placed. | 20 `target_directory` is the path where static files will be placed. |
21 | 21 |
| 22 The files can also be generated with relative links instead of asolute links by |
| 23 using the `--relative` option: |
| 24 |
| 25 python -m cms.bin.generate_static_pages www_directory target_directory --rel
ative |
| 26 |
22 Note: Localized versions of pages will only be generated when their translations | 27 Note: Localized versions of pages will only be generated when their translations |
23 are at least 30% complete. (Measured by comparing the total number | 28 are at least 30% complete. (Measured by comparing the total number |
24 of translatable strings on a page to the number of strings that have been | 29 of translatable strings on a page to the number of strings that have been |
25 translated for a given locale.) This is different from the test server which | 30 translated for a given locale.) This is different from the test server which |
26 will include less complete translations. | 31 will include less complete translations. |
OLD | NEW |