Custom Post Processor File Location

Joseph Crawford's Avatar

Joseph Crawford

30 Sep, 2013 05:56 PM


Is there any way for the custom processor to actually know the location of the md file that is being processed?

I ask because I use PieCrust ( and each post can have it's own asset directory.

For instance if my post is located in ```posts/2013/01/01/``` then the assets directory would be ```posts/2013/01/01/this-is-a-test-assets/```

This is the location of where the images are so in my md files I have a lot of ```{{ assets['image_name'] }}``` which need to be replaced with proper paths. I guess I could hard code the base-path to my blog posts and then parse the yaml header to determine the location based on date and title, just wasn't sure if there was a better or easier way to determine location without creating the dependency in the script.

  1. Support Staff 1 Posted by Brett on 30 Sep, 2013 05:59 PM

    Brett's Avatar

    You can use the environment variables passed to each script:


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac