Closed Kristinita closed 4 years ago
Again apologies for leaving you hanging for so long. You put a lot of effort into these issues, and I feel bad for not responding promptly.
I think what you're trying to do works today with the move
field. Try this:
imports:
pelican-plugins: plugins/
git module pelican-plugins:
url: https://github.com/getpelican/pelican-plugins
move:
pelican-open_graph: open_graph
pick:
- open_graph
- sitemap
Status: CONFIRMED :heavy_check_mark:
I tested move
, but I didn’t understand that the value for pick
should be moved name, not original. This is a little confusing intuitively.
Thanks.
Yes, rules fields are always applied in the order they're given in the docs, with copy
/move
first and export
last. It's done that way because we get parsed YAML as a dictionary, which doesn't tell us the order in which keys were written. But that's definitely unexpected, and I should make the docs more explicit about it.
9258b573100c8efc208668741151be621567707b
1. Summary
It would be nice, if peru can rename downloaded folders without using third-party tools.
2. Examples in other implementations
2.1. git
Change name of folder when cloning from GitHub:
Repository clone to
kiragoddess
, notpelican-kiragoddess
folder.2.2. Python
Aliasing modules:
3. Argumentation
I use plugins for Pelican — static sites generator. Names of some plugins begin to
pelican-
orpelican_
:That use some plugins, user needs to remove
pelican-
orpelican_
from plugin folder name. For example, if folder name isopen_graph
, Pelican will works; elsepelican-open_graph
— no.4. Example of expected behavior
For
peru.yaml
:New
peru.yaml
:Folder
pelican-open_graph
will rename toopen_graph
.Thanks.