iilab / contentascode

Content as Code
http://iilab.github.io/contentascode
GNU General Public License v3.0
34 stars 7 forks source link

Allow smart linking for multi-source projects #39

Open jmatsushita opened 8 years ago

jmatsushita commented 8 years ago

When a project contains several subrepos (like the contentascode spike developed for the open integrity project) it would be good to allow linking across parent repo and subrepo in a way that is simple for instance

With the baseurl problem (when sites are served from scheme://host/folder/) this needs some kind of pre-processing.

jmatsushita commented 8 years ago

There's also the relative linking question when permalinks are activated such that with a file structure

.
├── in_root.md
└── folder
    ├── in_folder.md
    └── also_in_folder.md

Without permalinks the links written like this work (which is the most intuitive)

in_root.md

[Link to in folder](folder/in_folder.md)

folder/in_folder.md

[Link to root](../in_root.md)
[Link to also in folder](also_in_folder.md)

However when activating permalinks because the generated tree creates an additional level of folders:

.
├── in_root
│   └── index.md
└── folder
    ├── in_folder
    │   └── index.md
    └── also_in_folder
        └── index.md

Therefore the links need to be modified in this way:

in_root.md

[Link to in folder](folder/in_folder)

folder/in_folder.md

[Link to root](../../in_root)
[Link to also in folder](../also_in_folder)

The ability to link without the extension is great but the complexity of the linking is not. So the smart linking should also be aware of whether permalinks are activated or not, and allow to use the following syntax and transform it as needed:

in_root.md

[Link to in folder](folder/in_folder)

folder/in_folder.md

[Link to root](../in_root)
[Link to also in folder](also_in_folder)