Replies: 1 comment
-
UPDATE: I'm currently getting the filename in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I'm trying to make my own customized version of the auth_attach plugin made by GiovanH. I want to implement rules like this:
STATIC
path, it automatically adds{static}
before the path because the file will be in a defined path.CONTENT
path, it automatically adds{attach}
before the path because the file will not be in the compiled output.{filename}
before the path.Since relative linking is based on the path to the current Markdown file, this requires that you get the path to the Markdown file itself, but I found this to be more difficult than I thought.
Markdown itself doesn't provide the path, and from the code it looks like the path is already abstracted during Markdown initialization.
My current implementation uses the path to be recorded in the
content_object_init
signal, but after testing, I found thatcontent_object_init
comes after Markdown processes the file.I'm currently trying to replace it with
article_generator_preread
, which is supposed to be a signal before the Markdown file is read, but here's another problem:source_path is not passed as a parameter to article_generator_preread and I can't get that.
Is there a suitable way to solve this problem that would allow me to get the path of the currently processed Markdown during Markdown processing?
Also, I'd like to know why pelican can't just automatically
{static}/{attach}/{filename}
markup based on the rules above? Is there a scenario I'm not expecting? Thanks.Beta Was this translation helpful? Give feedback.
All reactions