feat: reworked the template structure
This commit is contained in:
parent
c607d57221
commit
c9808f90f8
24 changed files with 216 additions and 80 deletions
|
@ -29,14 +29,27 @@ $sql_adapter = new MySQLHandler($db_connection, $SERVER_HOST);
|
|||
$adapter = new PostHandler($sql_adapter);
|
||||
|
||||
require_once 'dergdown.php';
|
||||
require_once 'setup/derg_insert.php';
|
||||
|
||||
function dergdown_to_html($text) {
|
||||
function dergdown_to_html($post) {
|
||||
$DergInsert = new DergInsertRenderer($post);
|
||||
$Parsedown = new Dergdown();
|
||||
$Parsedown->setDergRenderer($DergInsert);
|
||||
|
||||
return $Parsedown->text($text);
|
||||
$markdown = $post->markdown;
|
||||
|
||||
if($markdown == '') {
|
||||
$markdown = '
|
||||
{{
|
||||
template: fragments/directory/inline.html
|
||||
}}
|
||||
';
|
||||
}
|
||||
|
||||
return $Parsedown->text($markdown);
|
||||
}
|
||||
function post_to_html($post) {
|
||||
return dergdown_to_html($post->markdown);
|
||||
return dergdown_to_html($post);
|
||||
}
|
||||
$adapter->markdown_engine = "post_to_html";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue