Skip to content

Commit

Permalink
First working version for Kirby 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
seehat committed Oct 11, 2021
1 parent c8b383b commit 2230f16
Show file tree
Hide file tree
Showing 14 changed files with 2,079 additions and 5,028 deletions.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": [
["prismjs", {
"languages": ["markdown"],
"theme": "twilight",
"css": true
}]
]
}
15 changes: 0 additions & 15 deletions bili.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "amteich/kirby-helpsection",
"description": "Panel-View to display help for users.",
"type": "kirby-plugin",
"version": "1.1.2",
"version": "2.0.0",
"license": "MIT",
"authors": [
{
Expand Down
100 changes: 50 additions & 50 deletions includes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,60 @@

return [
'routes' => [
[
// Get the first set of pages to display primary nav
'pattern' => 'amteich/helpsection/index',
'action' => function () {
$slug = option('amteich.helpsection.contentfolder', 'helpsection');
$pages = [];
$page = page($slug);
[
// Get the first set of pages to display primary nav
'pattern' => 'amteich/helpsection/index',
'action' => function () {
$slug = option('amteich.helpsection.contentfolder', 'helpsection');
$pages = [];
$page = page($slug);

if ($page == null) {
return [
'status' => 'failed',
'error' => "Please create a new content-folder <code>$slug</code> to show it here.",
];
}
if ($page == null) {
return [
'status' => 'failed',
'error' => "Please create a new content-folder <code>$slug</code> to show it here.",
];
}

foreach (page($slug)->children()->listed() as $page) {
$pagedata = [
'title' => (string)$page->title(),
'id' => (string)$page->id(),
];
foreach (page($slug)->children()->listed() as $page) {
$pagedata = [
'title' => (string)$page->title(),
'id' => (string)$page->id(),
];

if ($page->hasListedChildren()) {
$children = $page->children()->listed();
$childrendata = [];
foreach ($children as $child) {
$childrendata[] = [
'title' => (string)$child->title(),
'id' => (string)$child->id(),
'slug' => (string)$child->id(),
'hasChildren' => (bool)$child->hasChildren(),
'rendered' => (string)$child->render(),
];
}
$pagedata['children'] = $childrendata;
}
if ($page->hasListedChildren()) {
$children = $page->children()->listed();
$childrendata = [];
foreach ($children as $child) {
$childrendata[] = [
'title' => (string)$child->title(),
'id' => (string)$child->id(),
'slug' => (string)$child->id(),
'hasChildren' => (bool)$child->hasChildren(),
'rendered' => (string)$child->render(),
];
}
$pagedata['children'] = $childrendata;
}

$pages[] = $pagedata;
}
$pages[] = $pagedata;
}

return [
'slug' => $slug,
'pages' => $pages,
'status' => 'ok',
];
},
],
[
// Get the first set of pages to display primary nav
'pattern' => 'amteich/helpsection/page/(:all)',
'action' => function ($slug) {
return [
'rendered' => page($slug)->render(),
];
}
],
return [
'slug' => $slug,
'pages' => $pages,
'status' => 'ok',
];
},
],
[
// Get the first set of pages to display primary nav
'pattern' => 'amteich/helpsection/page/(:all)',
'action' => function ($slug) {
return [
'rendered' => page($slug)->render(),
];
}
],
],
];
128 changes: 1 addition & 127 deletions index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 2230f16

Please sign in to comment.