Changes between Version 1 and Version 7 of Ticket #5336


Ignore:
Timestamp:
07/18/2017 11:12:43 PM (2 years ago)
Author:
kvas
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5336

    • Property Cc ire added; iaderinokun removed
  • Ticket #5336 – Description

    v1 v7  
    66    - If CMS would allow me to load from additional paths 
    77 
     8So we need to add a possibility to add additional source paths to the standard paths that the CMS uses (`${siteroot}/pages`, `${siteroot}/globals`, etc). 
     9 
    810=== What to change === 
    911 
    10 Allow me to specify additional global, include, page, and template paths that will resolve if they cannot be found in the default paths. e.g. 
     12Add 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. 
    1118 
    12 If I specify: 
    13 `additional_includes=[node_modules/website-defaults/includes]` 
     19==== Notes ==== 
     20 
     21- 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). 
     23 
     24==== Example ==== 
     25 
     26If I specify the following in `settings.ini`: 
     27 
     28{{{ 
     29[extra-paths] 
     30includes= 
     31    node_modules/website-defaults/includes 
     32    other-website/includes 
     33filters=node_modules/website-defaults/includes 
    1434 
    1535Then I: 
     
    1838Then: 
    19391. CMS should check `includes/examlpe` 
    20 2. If it doesn't find `example` there then it should check the paths specified above 
    21  
    22 ---- 
    23  
    24 - I'm open to suggestion about how and where this should be specified 
    25   - The first thing that comes to mind is settings.ini 
     402. If it doesn't find `example` there then it should check the paths specified in `extra-paths/includes`, if any.