Relative paths in the content folder don't seem to be preserved. #3362
Replies: 5 comments 2 replies
-
Hi Shaun. This has been covered before in #686 & #2673, but I'd like to find a solution that works for you so I can document it more thoroughly. Would you please try the following settings and let me know whether they provide the behavior you seek? USE_FOLDER_AS_CATEGORY = False
PATH_METADATA = "(?P<path_no_ext>.*)\..*"
ARTICLE_URL = ARTICLE_SAVE_AS = PAGE_URL = PAGE_SAVE_AS = "{path_no_ext}.html" |
Beta Was this translation helpful? Give feedback.
-
Thanks @justinmayer - that seems to do the trick. Alternatively I've noticed that doing this also gets around my issue: Title: First Blog Post
Date: 2024-07-08 13:30
Tags: obsidian, pelican, technical
Category: blog
Slug: blog/first-blog-post Category seems like more of a single-level classification used by many pelican themes as almost like "top level menus". Not sure if I should be using a folder structure in the "slug" component but this does seem to create the expected folder structure. |
Beta Was this translation helpful? Give feedback.
-
Yes, the category is meant for folks who want to separate posts into high-level categories like "Rants", "Reviews", etc. — one category per post, with optional top-level menu items depending on the theme. Multiple tags, on the other hand, can be applied to posts. Folks who want more categories per post can use the More Categories plugin. If you want your blog content to available at We probably should have started the discussion by being clear about the desired outcome, instead of talking about the mechanics of mirroring source & output folder structure. What exactly are you trying to achieve? |
Beta Was this translation helpful? Give feedback.
-
I think I assumed that any folder structure placed in the
I noticed that Pelican makes a distinction between Pages vs Articles (based on if the MD file is placed in a Maybe my confusion stems from my workflow - I don't do any actual work in the pelican path at all. By that I mean I have a custom preprocessor for the original markdown notes which lives in a totally different place on my laptop. If Pelican prefers me to use the "slug" value to specify a folder structure ( So my workflow currently looks like this:
I suppose technically my preference is that I can just drop my folder structure into content and expect a 1:1 mirror in the output of every single file including media assets such as webm, png, etc). I would like to "sans" the HTML part so a user doesn't have to specify the So far I'm really enjoying using Pelican - I've been migrating away from a much heavier wordpress site so this is my first time using a static site generator. (never tried any others like Hugo, Jekyll, 11ty, etc). |
Beta Was this translation helpful? Give feedback.
-
Thanks for taking the time to elaborate. As you probably guessed, Pelican wasn't created with the 1:1 content-to-output mirroring use case in mind. If someone were to submit a pull request to better support that use case out-of-the-box, I think it would be a welcome addition to the project. You should be able to output HTML files without What pages are output to |
Beta Was this translation helpful? Give feedback.
-
Relatively new to Pelican so I'm probably missing something but I can't understand why my folder structure in the
output
area isn't identical to mycontent
heirarchy.Content structure
After running
pelican content
- Output folder:This also means that the URL is:
http://127.0.0.1:8000/first-blog-post.html
rather thanhttp://127.0.0.1:8000/blog/first-blog-post.html
.Beta Was this translation helpful? Give feedback.
All reactions