Skip to content

Commit 69583fd

Browse files
committed
🐛 k5 section label/heading broken, thanks @twiro
closes #10 Signed-off-by: Bruno Meilick <[email protected]>
1 parent 7934d79 commit 69583fd

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

composer.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Kirby Section to display recently modified content pages",
44
"license": "MIT",
55
"type": "kirby-plugin",
6-
"version": "5.0.1",
6+
"version": "5.0.2",
77
"authors": [
88
{
99
"name": "Bruno Meilick",
@@ -37,12 +37,6 @@
3737
"getkirby/cms": "<5.0.0"
3838
},
3939
"scripts": {
40-
"fix": "php-cs-fixer fix",
41-
"test": [
42-
"mkdir -p tests/logs",
43-
"@putenv XDEBUG_MODE=coverage",
44-
"phpunit --configuration ./phpunit.xml"
45-
],
4640
"dist": [
4741
"composer install --no-dev --optimize-autoloader",
4842
"git rm -rf --cached .; git add .;"

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@
4747
'sections' => [
4848
'recentlymodified' => [
4949
'props' => [
50-
'headline' => function (string $headline = 'Recently Modified') {
51-
return t($headline);
50+
'label' => function (?string $text = null): ?string {
51+
return $text ? t($text, $text) : null;
5252
},
53-
'query' => function (?string $query = null) {
53+
'headline' => function (?string $text = null): ?string {
54+
return $text ? t($text, $text) : null;
55+
},
56+
'query' => function (?string $query = null): array {
5457
$query = $query ?? option('bnomei.recently-modified.query');
5558
$parentId = is_a($this->model(), \Kirby\Cms\Page::class) ? $this->model()->id() : '';
5659
$pages = site()->recentlyModified($query, $parentId);

src/components/sections/RecentlyModified.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<template>
22
<section class="k-section k-links-section">
33
<header class="k-section-header">
4-
<h2 class="k-headline">{{ headline }}</h2>
4+
<h2 class="k-label k-section-label">
5+
<span class="k-label-text">{{ this.labelOrHeadline }}</span>
6+
</h2>
57
</header>
68
<k-collection
79
:items="links"
@@ -14,16 +16,23 @@
1416
export default {
1517
data() {
1618
return {
17-
headline: "Recently Modified",
19+
label: undefined,
20+
headline: undefined,
1821
layout: "list",
1922
links: []
2023
}
2124
},
2225
created() {
2326
this.load().then(response => {
24-
this.headline = response.headline;
27+
this.label = response.label?.length > 0 ? response.label : undefined;
28+
this.headline = response.headline?.length > 0 ? response.headline : undefined;
2529
this.links = response.query; // resolved query = list
2630
});
31+
},
32+
computed: {
33+
labelOrHeadline () {
34+
return this.label ?? this.headline ?? "Recently Modified";
35+
}
2736
}
2837
};
2938
</script>

vendor/composer/installed.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php return array(
22
'root' => array(
33
'name' => 'bnomei/kirby3-recently-modified',
4-
'pretty_version' => '5.0.1',
5-
'version' => '5.0.1.0',
4+
'pretty_version' => '5.0.2',
5+
'version' => '5.0.2.0',
66
'reference' => null,
77
'type' => 'kirby-plugin',
88
'install_path' => __DIR__ . '/../../',
@@ -11,8 +11,8 @@
1111
),
1212
'versions' => array(
1313
'bnomei/kirby3-recently-modified' => array(
14-
'pretty_version' => '5.0.1',
15-
'version' => '5.0.1.0',
14+
'pretty_version' => '5.0.2',
15+
'version' => '5.0.2.0',
1616
'reference' => null,
1717
'type' => 'kirby-plugin',
1818
'install_path' => __DIR__ . '/../../',

0 commit comments

Comments
 (0)