-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to keep a filesystem hierarchy for pages #686
Comments
On Fri, Jan 18, 2013 at 09:09:49AM -0800, Pachi Burke wrote:
In #671 (which I'm rebasing against |
I'm really new to Pelikan and I'm not sure I get it right, so, |
On Fri, Mar 22, 2013 at 12:37:13PM -0700, Pachi Burke wrote:
For source files whose relative path should not be changed, for example: path/to/source/a/b/c.html → path/to/output/a/b/c.html I use:
This works on a content-class level (e.g. for all |
Thanks for commenting, wking! |
On Fri, Mar 22, 2013 at 01:01:30PM -0700, Pachi Burke wrote:
For the |
Ok. I'll be following Pelican's repo to keep an eye on this changes. |
Can someone explain me how to obtain the behaviour below. I tried the documentation but it wasn't clear at all about how to obtain this. I am using almost only pages, instead of articles, as most of the site is static. I do use nginx for serving the content and I alreadyc configure it to service pretty URLs like Now the trick is to convince pelican to deploy my pages in a hierarcy, as it seems that by default it does not do this. If I can telll it to keep the same hierarcy as the one from the content, the better. Current config:
This seems to keep the directory structure bug also the file extension, and I end-up with things like Note, after I figure these out, I would like to document these, so others will be able to benefit from it. I guess the trick is to play with these config options, but I wasn't able to find documentation regarding available variables that I can use inside these. So far I found (by chance) only the Thanks. |
Hi, I am not sure why is it so hard to fix this. I assume that main developers only use a flat based url scheme I am trying to use the pelican to build a product website... rather than a blog... I still use the blog part as the 'news' section :) I went for this hack inside my pelicanconf.py file ... with pelican 3.4.0 basically it just adds Maybe another option to fix this kind or problems, would be to provide some hook/callback to augment the metdata for each page/article
|
btw, I think that this ticket should be reopened as of version 3.4.0 is no easy to preserve the filesystem hierarchy for pages |
@adiroiban: PATH_METADATA= '(?P<dirname>.*)/(?P<basename>.*)\..*'
PAGE_SAVE_AS= '{dirname}/{basename}.html'
PAGE_URL= '{dirname}/{basename}.html' for example:
As for "provide some hook/callback to augment the metdata for each page/article", plugin system allows you to do that. |
@avaris this will work, as long as I have no page in root.... your expression does not match Trying I will look into the plugin system in order to augment page metadata. Thanks! |
@adiroiban: ah, you're right. but since you're using PATH_METADATA= '(?P<path_no_ext>.*)\..*'
PAGE_SAVE_AS= '{path_no_ext}.html'
PAGE_URL= '{path_no_ext}.html' |
Thanks! Yet, that should do the trick, as long as I don't want a different file name... which I don't. Just for reference:
|
Since the answer to this question should be more visible, I documented the aforementioned solution via b8f2326. |
This breaks the automatic translation system, unfortunately.
strips two-letter language postfixes from the filename, so they get the same keys again. Buts its a bit hacky. |
The usecase is the following: being able to migrate a website with an existing directory structure.
The directory hierarchy can't be changed for SEO and other reasons.
For instance, the site has a file /news/recent/programming/newsweek20100312.htm and it could be processed as a pelican page, but currently it isn't possible to tell that the folder structure in /content/pages/ is preserved so the /news/recent/programming hierarchy could be achieved.
As a hack, I could use the category metadata changing the PAGE_SAVE_AS and PAGE_URL settings, but this only gets one more nesting level.
Proposal: Add a PRESERVE_CONTENT_HIERARCHY (= True) directive so the directory structure in content/pages/ is replicated when building pages.
The text was updated successfully, but these errors were encountered: