Custom Post Processor File Location

Joseph Crawford's Avatar

Joseph Crawford

30 Sep, 2013 05:56 PM

Hello,

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 (http://bolt80.com/piecrust/) and each post can have it's own asset directory.

For instance if my post is located in ```posts/2013/01/01/this-is-a-test.md``` 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: http://marked2app.com/help/Custom_Processor.html#environmentvariables

    -Brett

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

Generic

? 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