Hi,
24 hours into playing with Kirby and learning PHP from scratch!
So here’s the relevant set up:
site/config/config.php
is
return [
'debug' => true,
'content' => [
'extension' => 'md'
],
'markdown' => [
'extra' => true
],
];
And contents of content/2_articles/1_article_one
is:
Title: Article One
----
Text:
## Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Donec sodales pulvinar magna eget vulputate. In hac habitasse platea dictumst. Praesent faucibus malesuada est vel interdum. Aenean ut mauris semper lacus efficitur iaculis.
Pellentesque velit ipsum, laoreet eu accumsan sed, sodales eu nisi. Nulla hendrerit erat sed magna sollicitudin congue. Sed massa eros, fermentum id dictum eu, imperdiet ac ante. Maecenas nisl erat, consectetur quis ipsum vel, vulputate laoreet turpis. Suspendisse non nisl sed mi dapibus fringilla.
Pellentesque ac consectetur turpis. Praesent ultrices augue et ligula tempor, a interdum purus consequat. Donec sit amet dictum ipsum, vel vestibulum lectus. Vestibulum purus odio, vestibulum a mauris quis, facilisis interdum nisi. Fusce rhoncus neque non lorem euismod, eu volutpat ante consectetur. Maecenas in mollis tellus.
And I got it to work:
By following the instructions from Markdown doesn´t render:
Hence, article.php
is:
<?php snippet('header') ?>
<main class="main">
<h1><?= $page->title() ?></h1>
<?= $page->text()->kt() ?>
</main>
<?php snippet('footer') ?>
Which, I note, was for Kirby 3.
I went to $page to learn more about $page->text()->kt()
but was puzzled to not be able to find $page->text()
there.
So wanted to check if I’m using the right code for Kirby 4 (I assume since I’m working with the most recent starterkit and plainkit, it probably is Kirby 4?) or if I should be using something else to render Markdown?
Thanks!