OLD | NEW |
1 # CMS # | 1 # CMS # |
2 | 2 |
3 We use this CMS for [adblockplus.org](https://github.com/adblockplus/web.adblock
plus.org/) | 3 We use this CMS for [adblockplus.org](https://github.com/adblockplus/web.adblock
plus.org/) |
4 and related websites. It converts a directory with content data into static | 4 and related websites. It converts a directory with content data into static |
5 files. You are free to use it for other projects but please keep in mind that we | 5 files. You are free to use it for other projects but please keep in mind that we |
6 make no stability guarantees whatsoever and might change functionality any time. | 6 make no stability guarantees whatsoever and might change functionality any time. |
7 | 7 |
8 ## How to use ## | 8 ## How to use ## |
9 | 9 |
10 ### Running the test server ### | 10 ### Running the test server ### |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 * A current copy of the | 64 * A current copy of the |
65 [cms repository](https://github.com/adblockplus/cms/) (can be | 65 [cms repository](https://github.com/adblockplus/cms/) (can be |
66 [downloaded as ZIP file](https://github.com/adblockplus/cms/archive/master.zip
) | 66 [downloaded as ZIP file](https://github.com/adblockplus/cms/archive/master.zip
) |
67 or cloned via `git clone https://github.com/adblockplus/cms.git`) | 67 or cloned via `git clone https://github.com/adblockplus/cms.git`) |
68 | 68 |
69 Run the following command from the directory of the `cms` repository: | 69 Run the following command from the directory of the `cms` repository: |
70 | 70 |
71 python -m cms.bin.generate_static_pages www_directory target_directory | 71 python -m cms.bin.generate_static_pages www_directory target_directory |
72 | 72 |
73 Here `www_directory` should be replaced by the path to your content directory. | 73 Here `www_directory` should be replaced by the path to your content directory. |
74 `target_directory` is the path where static files will be placed.. | 74 `target_directory` is the path where static files will be placed. |
| 75 |
| 76 Note: Localized versions of pages will only be generated when their translations |
| 77 are at least 30% complete. (Measured by comparing the total number |
| 78 of translatable strings on a page to the number of strings that have been |
| 79 translated for a given locale.) This is different from the test server which |
| 80 will include less complete translations. |
75 | 81 |
76 ### Syncing translations ### | 82 ### Syncing translations ### |
77 | 83 |
78 Before syncing translations ensure the following: | 84 Before syncing translations ensure the following: |
79 | 85 |
80 - The `crowdin-project-name` setting has been set in the site's configuration. | 86 - The `crowdin-project-name` setting has been set in the site's configuration. |
81 - The `urllib3` Python module is installed. | 87 - The `urllib3` Python module is installed. |
82 | 88 |
83 Now to sync with Crowdin type the following: | 89 Now to sync with Crowdin type the following: |
84 | 90 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 filter is invoked. For more information on Jinja2 filters see | 322 filter is invoked. For more information on Jinja2 filters see |
317 [official documentation](http://jinja.pocoo.org/docs/dev/api/#writing-filters). | 323 [official documentation](http://jinja.pocoo.org/docs/dev/api/#writing-filters). |
318 | 324 |
319 ### Custom functions and variables ### | 325 ### Custom functions and variables ### |
320 | 326 |
321 The `globals` directory can define custom Jinja2 globals which will be available | 327 The `globals` directory can define custom Jinja2 globals which will be available |
322 in all Jinja2 templates. Typically, this is used for custom functions. The file | 328 in all Jinja2 templates. Typically, this is used for custom functions. The file |
323 name should match the name of the function or variable to be defined, and export | 329 name should match the name of the function or variable to be defined, and export |
324 a variable with that name. E.g. `globals/myfunction.py` can define a function | 330 a variable with that name. E.g. `globals/myfunction.py` can define a function |
325 called `myfunction` that will become available to all Jinja2 templates. | 331 called `myfunction` that will become available to all Jinja2 templates. |
OLD | NEW |