add front-comments

This commit is contained in:
isUnknown 2024-03-09 15:09:31 +01:00
parent 8a457885b2
commit ed81ac26d2
11 changed files with 377 additions and 50 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
.git
# System files # System files
# ------------ # ------------

330
assets/dist/style.css vendored

File diff suppressed because one or more lines are too long

View file

@ -24,7 +24,7 @@
"require": { "require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0", "php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"getkirby/cms": "^4.0", "getkirby/cms": "^4.0",
"adrienpayet/front-comments": "^0.8.2" "adrienpayet/front-comments": "^0.8.9"
}, },
"config": { "config": {
"allow-plugins": { "allow-plugins": {

48
composer.lock generated
View file

@ -4,15 +4,15 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "9740251b02e150964c114e2f27c45d5b", "content-hash": "4439e672d6e47d4b53afb46c041a4fd6",
"packages": [ "packages": [
{ {
"name": "adrienpayet/front-comments", "name": "adrienpayet/front-comments",
"version": "0.8.2", "version": "0.8.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://framagit.org/isUnknown/kirby-front-comments", "url": "https://framagit.org/isUnknown/kirby-front-comments",
"reference": "d1a5d28580d8705f80460197fbd0be77039a5e47" "reference": "cc9b03f63b02c0b461fbdbf419c224a96288abb1"
}, },
"require": { "require": {
"getkirby/composer-installer": "^1.1" "getkirby/composer-installer": "^1.1"
@ -33,7 +33,7 @@
], ],
"description": "Kirby plugin for adding comments anywhere in front-end pages.", "description": "Kirby plugin for adding comments anywhere in front-end pages.",
"homepage": "https://framagit.org/isUnknown/kirby-front-comments", "homepage": "https://framagit.org/isUnknown/kirby-front-comments",
"time": "2024-03-08T10:29:48+00:00" "time": "2024-03-09T14:04:18+00:00"
}, },
{ {
"name": "christian-riesen/base32", "name": "christian-riesen/base32",
@ -301,16 +301,16 @@
}, },
{ {
"name": "getkirby/cms", "name": "getkirby/cms",
"version": "4.0.3", "version": "4.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/getkirby/kirby.git", "url": "https://github.com/getkirby/kirby.git",
"reference": "a537a4d95c8db03ecaf3ebfd5c6a7747357fde7c" "reference": "6b7ac66c55ecac20d6b580ef01a667d1806d5c72"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/getkirby/kirby/zipball/a537a4d95c8db03ecaf3ebfd5c6a7747357fde7c", "url": "https://api.github.com/repos/getkirby/kirby/zipball/6b7ac66c55ecac20d6b580ef01a667d1806d5c72",
"reference": "a537a4d95c8db03ecaf3ebfd5c6a7747357fde7c", "reference": "6b7ac66c55ecac20d6b580ef01a667d1806d5c72",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -400,7 +400,7 @@
"type": "custom" "type": "custom"
} }
], ],
"time": "2024-01-10T10:28:21+00:00" "time": "2024-03-06T11:38:42+00:00"
}, },
{ {
"name": "getkirby/composer-installer", "name": "getkirby/composer-installer",
@ -826,16 +826,16 @@
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.28.0", "version": "v1.29.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4",
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -849,9 +849,6 @@
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": { "thanks": {
"name": "symfony/polyfill", "name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "url": "https://github.com/symfony/polyfill"
@ -888,7 +885,7 @@
"portable" "portable"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0"
}, },
"funding": [ "funding": [
{ {
@ -904,7 +901,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-01-26T09:26:14+00:00" "time": "2024-01-29T20:11:03+00:00"
}, },
{ {
"name": "symfony/polyfill-intl-idn", "name": "symfony/polyfill-intl-idn",
@ -995,16 +992,16 @@
}, },
{ {
"name": "symfony/polyfill-intl-normalizer", "name": "symfony/polyfill-intl-normalizer",
"version": "v1.28.0", "version": "v1.29.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
"reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" "reference": "bc45c394692b948b4d383a08d7753968bed9a83d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d",
"reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "reference": "bc45c394692b948b4d383a08d7753968bed9a83d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1015,9 +1012,6 @@
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": {
"dev-main": "1.28-dev"
},
"thanks": { "thanks": {
"name": "symfony/polyfill", "name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "url": "https://github.com/symfony/polyfill"
@ -1059,7 +1053,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0"
}, },
"funding": [ "funding": [
{ {
@ -1075,7 +1069,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-01-26T09:26:14+00:00" "time": "2024-01-29T20:11:03+00:00"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",

View file

@ -1,4 +1,4 @@
title: Articles title: texts
columns: columns:
- width: 1/2 - width: 1/2

View file

@ -6,7 +6,7 @@ image:
columns: columns:
- width: 1/3 - width: 1/3
sections: sections:
articles: texts:
type: pages type: pages
templates: templates:
- linear - linear

View file

@ -1,5 +1,5 @@
<?php <?php
return function ($site) { return function ($site) {
return $site->find('articles')->children(); return $site->find('texts')->children();
}; };

View file

@ -7,17 +7,17 @@ return [
'site' => [ 'site' => [
'label' => 'Accueil', 'label' => 'Accueil',
'current' => function ($current) { 'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString(); $path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'site'); return Str::contains($path, 'site');
} }
], ],
'articles' => [ 'texts' => [
'icon' => 'pen', 'icon' => 'pen',
'label' => 'Articles', 'label' => 'texts',
'link' => 'pages/articles', 'link' => 'pages/texts',
'current' => function ($current) { 'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString(); $path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/articles'); return Str::contains($path, 'pages/texts');
} }
], ],
'-', '-',
@ -26,8 +26,8 @@ return [
'label' => 'À propos', 'label' => 'À propos',
'link' => 'pages/a-propos', 'link' => 'pages/a-propos',
'current' => function ($current) { 'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString(); $path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/a-propos'); return Str::contains($path, 'pages/a-propos');
} }
], ],
'newsletter' => [ 'newsletter' => [
@ -35,13 +35,14 @@ return [
'label' => 'Lettre', 'label' => 'Lettre',
'link' => 'pages/lettre', 'link' => 'pages/lettre',
'current' => function ($current) { 'current' => function ($current) {
$path = Kirby::instance()->request()->path()->toString(); $path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/lettre'); return Str::contains($path, 'pages/lettre');
} }
], ],
'-', '-',
'users', 'users',
'comments',
'system' 'system'
] ]
] ]
]; ];

View file

@ -8,5 +8,7 @@
<script src="<?= url('assets') ?>/js/script.js" defer></script> <script src="<?= url('assets') ?>/js/script.js" defer></script>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
</head> </head>
<body class="grid"> <body class="grid">

View file

@ -1,4 +1,4 @@
<?php <?php
$left['slug'] = Str::slug($left['label']); $left['slug'] = Str::slug($left['label']);
?> ?>
@ -15,9 +15,9 @@ $left['slug'] = Str::slug($left['label']);
><?= $left['label'] ?></button> ><?= $left['label'] ?></button>
<button <button
class="toggle right" class="toggle right"
:class="activeTab === 'articles' ? 'open' : 'close'" :class="activeTab === 'texts' ? 'open' : 'close'"
@click="toggleTab($data, 'articles')" @click="toggleTab($data, 'texts')"
>articles</button> >textes</button>
</div> </div>
<div class="active-tab"> <div class="active-tab">
<section <section
@ -27,7 +27,7 @@ $left['slug'] = Str::slug($left['label']);
<?= $left['content'] ?> <?= $left['content'] ?>
</section> </section>
<ul <ul
x-show="activeTab === 'articles'" x-show="activeTab === 'texts'"
x-transition.opacity x-transition.opacity
x-transition.duration.500ms> x-transition.duration.500ms>
<?php foreach($kirby->collection('years') as $year): ?> <?php foreach($kirby->collection('years') as $year): ?>