Changes between Version 9 and Version 11 of Ticket #5336


Ignore:
Timestamp:
07/21/2017 05:18:08 PM (22 months ago)
Author:
kvas
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5336

    • Property Cc juliandoucette added
  • Ticket #5336 – Description

    v9 v11  
    1010=== What to change === 
    1111 
    12 Add a section to `settings.ini` called `[extra-paths]` with the following variables: 
    13 - `includes` -- list of strings, separated by newlines, each of which is an additional path where includes can be loaded from, 
    14 - `pages` -- same for content pages, 
    15 - `templates` -- same for templates, 
    16 - `filters` -- same for Jinja filters, 
    17 - `globals` -- same for Jinja globals. 
     12Add a section to `settings.ini` called `[paths]` with one option in it: `additional-paths`. The value of this option will be a list of strings, separated by newlines, each of which is an additional root (or source, in CMS internal terms), from where includes, globals and templates can be loaded. 
    1813 
    1914==== Notes ==== 
    2015 
    2116- The additional paths should apply to generation and preview equally. 
    22 - Currently generation uses Mercurial a committed revision (last revision of `default` branch or something else if specified) instead of the directory content as a source. The directories added by `extra-paths` option would need to refer to the local file system, not to the repository (usually the wouldn't exist in the repository). This further complicates current confusing behavior but should become ok once we uncomplicate that (TODO). 
     17- Currently generation uses Mercurial a committed revision (last revision of `default` branch or something else if specified) instead of the directory content as a source. The directories added by `additional-paths` option would need to refer to the local file system, not to the repository (usually the wouldn't exist in the repository). This further complicates current confusing behavior but should become ok once we uncomplicate that (TODO). 
    2318 
    2419==== Example ==== 
     
    2722 
    2823{{{ 
    29 [extra-paths] 
    30 includes= 
    31     node_modules/website-defaults/includes 
    32     other-website/includes 
    33 filters=node_modules/website-defaults/includes 
     24[paths] 
     25additional-paths = 
     26    node_modules/common_stuff 
     27    node_modules/rare_stuff 
    3428}}} 
    3529 
     
    3832 
    3933Then: 
    40 1. CMS should check `includes/examlpe` 
    41 2. If it doesn't find `example` there then it should check the paths specified in `extra-paths/includes`, if any. 
     341. CMS should check `includes/example` 
     352. If it doesn't find `example` there then it should look for `includes/example` under paths specified in `paths/additional-paths`, if any.