pelican icon indicating copy to clipboard operation
pelican copied to clipboard

Introduce a "disable root content" generation setting

Open andreamoro opened this issue 2 years ago • 6 comments

TL;DR Introduce a DISABLE_ROOT_CONTENT = True setting. Or provide a similar strategy not to generate content in the root folder (e.g. LOCALE = '')

Long version; I'm using the i18n-subsite plugin to generate the content for the same website, localised in two languages, but with content being completely independent (but sometimes interlinked). This is a migration from a previous projects which were previously hosting both language in the same site, and I'd love to maintain the same structure, while producing two nested subfolders in the /output/ folder when content is processed.

Irrespective of the many attempts, I couldn't make this happening, thus leaving as the only solution the creation of two separate projects. The immediate drawback is the necessity to maintain two copies of the same theme (perhaps this can be shared), but certainly I don't see how I will be able to localise it while leaving the po file in each folder.

In such a case, it would be interesting having the opportunity to disable the "root" folder content creation, leaving the subsites being processed as the plugin does.

andreamoro avatar Nov 29 '21 12:11 andreamoro

I'm having trouble understanding the request. What do you expect pelican to do with such a setting? For a site with no plugins, what should happen if I set that to True?

avaris avatar Nov 29 '21 14:11 avaris

Well given that pelican can't be responsible for people settings, if no plugins in charge of generate content, given a True I would still let Pelican stick on not generating content. Probably not ideal, but ones has to be so responsible to use the tool at its full capability without blaming.

andreamoro avatar Nov 29 '21 15:11 andreamoro

Well, then... Shouldn't this be a job for the plugin that is supposed to take over content generation (i.e. i18n_subsites)?

Personally, I would not be in favor of an option that literally tells pelican to "do nothing" :).

avaris avatar Nov 29 '21 16:11 avaris

Well, I cannot argue on your thoughts, but a couple of things to consider: a) the plugin is still in the old format, and need to be uniformed to the new standard at some point b) I'm not entirely sure the plugin works before or after the site content is generated? It might be the content in the root is generated before? I guess you have more experience than me here.

I will be happy to make a quick dirty patch, and eventually consider a pull, but I didn't have a chance to look into the source code in details yet. Where is the code

andreamoro avatar Nov 29 '21 16:11 andreamoro

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your participation and understanding.

stale[bot] avatar Apr 19 '22 01:04 stale[bot]

Hi @andreamoro. The relevant plugin code can be found here: https://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites

Your assistance with modernizing it would likely be appreciated by the community. Do you need anything further related to this issue?

justinmayer avatar Jul 21 '22 10:07 justinmayer