Created
July 19, 2019 15:52
-
-
Save ianlandsman/e0e2db02c8a4f205af67a489b04f8628 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'author' => 'Ian Landsman', // Default author, if not provided in a post | |
'sort' => '-date', | |
'path' => 'j/{filename}', | |
'linkedContent' => function($journal){ | |
$content = str_replace('<p>+++</p>', '<div class="text-center" style="margin-bottom:1rem;">●</div>', $journal->getContent()); | |
$paragraphs = explode('<p>', $content); | |
$results = ''; | |
foreach($paragraphs as $paragraph){ | |
if(!empty($paragraph)){ | |
$hash = md5($paragraph); | |
$results .= '<a name="'.$hash.'"></a><p>'.str_replace('</p>', ' <a href="'.$journal->getUrl().'#'.$hash.'" class="text-sm text-grey">#</a>',$paragraph); | |
} | |
} | |
return $results; | |
} | |
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment