adjust styles
This commit is contained in:
parent
dd217e7a6a
commit
3804d13cb6
34 changed files with 756 additions and 174 deletions
|
|
@ -1,7 +1,11 @@
|
|||
title: Blocs
|
||||
title: Grille
|
||||
image:
|
||||
back: black
|
||||
icon: bars
|
||||
color: white
|
||||
icon: dashboard
|
||||
create:
|
||||
fields:
|
||||
- category
|
||||
|
||||
tabs:
|
||||
contentTab:
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
title: Linéaire
|
||||
image:
|
||||
back: black
|
||||
color: white
|
||||
icon: bars
|
||||
create:
|
||||
fields:
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ title: Année
|
|||
image:
|
||||
icon: calendar
|
||||
back: black
|
||||
color: white
|
||||
|
||||
columns:
|
||||
- width: 1/3
|
||||
|
|
@ -11,7 +12,7 @@ columns:
|
|||
type: pages
|
||||
templates:
|
||||
- linear
|
||||
- blocks
|
||||
- grid
|
||||
- width: 2/3
|
||||
fields:
|
||||
edito:
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ sections:
|
|||
label: Catégorie
|
||||
type: select
|
||||
options: query
|
||||
query: site.categories.split
|
||||
query: site.find('texts').categories.split
|
||||
required: true
|
||||
width: 1/3
|
||||
author:
|
||||
label: Auteur
|
||||
|
|
|
|||
|
|
@ -1,84 +1,12 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Uuid\Uuid;
|
||||
|
||||
return [
|
||||
'debug' => true,
|
||||
'panel' => [
|
||||
'menu' => [
|
||||
'site' => [
|
||||
'label' => 'Accueil',
|
||||
'current' => function ($current) {
|
||||
$path = Kirby::instance()->request()->path()->toString();
|
||||
return Str::contains($path, 'site');
|
||||
}
|
||||
],
|
||||
'texts' => [
|
||||
'icon' => 'pen',
|
||||
'label' => 'Textes',
|
||||
'link' => 'pages/texts',
|
||||
'current' => function ($current) {
|
||||
$path = Kirby::instance()->request()->path()->toString();
|
||||
return Str::contains($path, 'pages/texts');
|
||||
}
|
||||
],
|
||||
'-',
|
||||
'-',
|
||||
'infos' => [
|
||||
'icon' => 'question',
|
||||
'label' => 'À propos',
|
||||
'link' => 'pages/a-propos',
|
||||
'current' => function ($current) {
|
||||
$path = Kirby::instance()->request()->path()->toString();
|
||||
return Str::contains($path, 'pages/a-propos');
|
||||
}
|
||||
],
|
||||
'newsletter' => [
|
||||
'icon' => 'email',
|
||||
'label' => 'Infolettre',
|
||||
'link' => 'pages/lettre',
|
||||
'current' => function ($current) {
|
||||
$path = Kirby::instance()->request()->path()->toString();
|
||||
return Str::contains($path, 'pages/lettre');
|
||||
}
|
||||
],
|
||||
'-',
|
||||
'-',
|
||||
'users',
|
||||
'comments',
|
||||
'admin' => [
|
||||
'icon' => 'folder',
|
||||
'label' => 'Administration',
|
||||
'link' => 'pages/admin',
|
||||
'current' => function ($current) {
|
||||
$path = Kirby::instance()->request()->path()->toString();
|
||||
return Str::contains($path, 'pages/admin');
|
||||
}
|
||||
],
|
||||
'-',
|
||||
'-',
|
||||
'system',
|
||||
]
|
||||
],
|
||||
'routes' => [
|
||||
[
|
||||
'pattern' => 'auteurs/(:any)',
|
||||
'action' => function ($slug) {
|
||||
$kirby = kirby();
|
||||
$author = getAuthorBySlug($slug);
|
||||
|
||||
return Page::factory([
|
||||
'slug' => '',
|
||||
'template' => 'author',
|
||||
'model' => 'authors',
|
||||
'content' => [
|
||||
'title' => $author->name(),
|
||||
'presentation' => $author->presentation(),
|
||||
'author' => $author->name(),
|
||||
'uuid' => Uuid::generate(),
|
||||
]
|
||||
]);
|
||||
}
|
||||
]
|
||||
]
|
||||
'menu' => require __DIR__ . '/menu.php',
|
||||
],
|
||||
'routes' => [
|
||||
require __DIR__ . '/routes/virtual-author.php',
|
||||
require __DIR__ . '/routes/virtual-category.php',
|
||||
]
|
||||
];
|
||||
|
|
|
|||
56
site/config/menu.php
Normal file
56
site/config/menu.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'site' => [
|
||||
'label' => 'Accueil',
|
||||
'current' => function ($current) {
|
||||
$path = Kirby::instance()->request()->path()->toString();
|
||||
return Str::contains($path, 'site');
|
||||
}
|
||||
],
|
||||
'texts' => [
|
||||
'icon' => 'pen',
|
||||
'label' => 'Textes',
|
||||
'link' => 'pages/texts',
|
||||
'current' => function ($current) {
|
||||
$path = Kirby::instance()->request()->path()->toString();
|
||||
return Str::contains($path, 'pages/texts');
|
||||
}
|
||||
],
|
||||
'-',
|
||||
'-',
|
||||
'infos' => [
|
||||
'icon' => 'question',
|
||||
'label' => 'À propos',
|
||||
'link' => 'pages/a-propos',
|
||||
'current' => function ($current) {
|
||||
$path = Kirby::instance()->request()->path()->toString();
|
||||
return Str::contains($path, 'pages/a-propos');
|
||||
}
|
||||
],
|
||||
'newsletter' => [
|
||||
'icon' => 'email',
|
||||
'label' => 'Infolettre',
|
||||
'link' => 'pages/lettre',
|
||||
'current' => function ($current) {
|
||||
$path = Kirby::instance()->request()->path()->toString();
|
||||
return Str::contains($path, 'pages/lettre');
|
||||
}
|
||||
],
|
||||
'-',
|
||||
'-',
|
||||
'users',
|
||||
'comments',
|
||||
'admin' => [
|
||||
'icon' => 'folder',
|
||||
'label' => 'Administration',
|
||||
'link' => 'pages/admin',
|
||||
'current' => function ($current) {
|
||||
$path = Kirby::instance()->request()->path()->toString();
|
||||
return Str::contains($path, 'pages/admin');
|
||||
}
|
||||
],
|
||||
'-',
|
||||
'-',
|
||||
'system',
|
||||
];
|
||||
25
site/config/routes/virtual-author.php
Normal file
25
site/config/routes/virtual-author.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Uuid\Uuid;
|
||||
|
||||
return [
|
||||
'pattern' => 'auteurs/(:any)',
|
||||
'action' => function ($slug) {
|
||||
$kirby = kirby();
|
||||
$author = getAuthorBySlug($slug);
|
||||
|
||||
return Page::factory(
|
||||
[
|
||||
'slug' => '',
|
||||
'template' => 'author',
|
||||
'model' => 'authors',
|
||||
'content' => [
|
||||
'title' => $author->name(),
|
||||
'presentation' => $author->presentation(),
|
||||
'author' => $author->name(),
|
||||
'uuid' => Uuid::generate(),
|
||||
]
|
||||
]
|
||||
);
|
||||
}
|
||||
];
|
||||
22
site/config/routes/virtual-category.php
Normal file
22
site/config/routes/virtual-category.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Uuid\Uuid;
|
||||
|
||||
return [
|
||||
'pattern' => 'categories/(:any)',
|
||||
'action' => function ($category) {
|
||||
$kirby = kirby();
|
||||
|
||||
return Page::factory(
|
||||
[
|
||||
'slug' => '',
|
||||
'template' => 'category',
|
||||
'model' => 'categories',
|
||||
'content' => [
|
||||
'title' => $category,
|
||||
'uuid' => Uuid::generate(),
|
||||
]
|
||||
]
|
||||
);
|
||||
}
|
||||
];
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit cc9b03f63b02c0b461fbdbf419c224a96288abb1
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title><?= $site->title() ?><?= e($page->url() !== $site->url(), '-' . $page->title()) ?></title>
|
||||
<link rel="stylesheet" href="<?= url('assets') ?>/css/style.css?version-cache-prevent<?= rand(0, 1000)?>" />
|
||||
<link rel="stylesheet" href="<?= url('assets/css/style.css') . '?version-cache-prevent' . rand(0, 1000) ?>" />
|
||||
<script src="<?= url('assets') ?>/js/script.js?version-cache-prevent<?= rand(0, 1000)?>" defer></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
||||
<meta name="robots" content="noindex">
|
||||
|
|
@ -13,8 +13,8 @@
|
|||
<header id="main-header">
|
||||
<div id="logo" >
|
||||
<a href="/" class="no-line">
|
||||
<h2 id="actuel">actuel</h2>
|
||||
<h2 id="inactuel">inactuel</h2>
|
||||
<h1 id="actuel">actuel</h1>
|
||||
<h1 id="inactuel">inactuel</h1>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
<?php
|
||||
$left['slug'] = Str::slug($left['label']);
|
||||
$left = $left ?? false;
|
||||
|
||||
if ($left) {
|
||||
$left['slug'] = Str::slug($left['label']);
|
||||
}
|
||||
$authorFilter = isset($authorFilter) ? $authorFilter : false;
|
||||
$activeTab = isset($activeTab) ? Str::slug($activeTab) : '';
|
||||
?>
|
||||
|
|
@ -11,11 +15,13 @@ $activeTab = isset($activeTab) ? Str::slug($activeTab) : '';
|
|||
<div class="toggle-btns | flex space-between" style="
|
||||
--content:space-between;
|
||||
">
|
||||
<button
|
||||
class="toggle left"
|
||||
:class="activeTab === '<?=$left['slug'] ?>' ? 'open' : 'close'"
|
||||
@click="toggleTab($data, '<?=$left['slug'] ?>')"
|
||||
><?= $left['label'] ?></button>
|
||||
<?php if ($left): ?>
|
||||
<button
|
||||
class="toggle left"
|
||||
:class="activeTab === '<?=$left['slug'] ?>' ? 'open' : 'close'"
|
||||
@click="toggleTab($data, '<?=$left['slug'] ?>')"
|
||||
><?= $left['label'] ?></button>
|
||||
<?php endif ?>
|
||||
<button
|
||||
class="toggle right"
|
||||
:class="activeTab === 'texts' ? 'open' : 'close'"
|
||||
|
|
@ -26,10 +32,12 @@ $activeTab = isset($activeTab) ? Str::slug($activeTab) : '';
|
|||
<div
|
||||
class="active-tab"
|
||||
>
|
||||
<section
|
||||
x-show="activeTab === '<?=$left['slug'] ?>'">
|
||||
<?= $left['content'] ?>
|
||||
</section>
|
||||
<?php if ($left): ?>
|
||||
<section
|
||||
x-show="activeTab === '<?=$left['slug'] ?>'">
|
||||
<?= $left['content'] ?>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
<ul
|
||||
x-show="activeTab === 'texts'">
|
||||
<?php foreach($kirby->collection('years') as $year): ?>
|
||||
|
|
@ -56,25 +64,13 @@ $activeTab = isset($activeTab) ? Str::slug($activeTab) : '';
|
|||
class="see-more toggle left" @click="isOpen = !isOpen">Lire</button>
|
||||
</div>
|
||||
<?php foreach($year->children() as $article): ?>
|
||||
<?php if (!$authorFilter || $authorFilter === $article->author()->toUser()->name()->value()) : ?>
|
||||
<li class="texts | bottom" style="--bottom:3">
|
||||
<a href="<?= $article->url() ?>" class="texts__title no-line">
|
||||
<h3><?= $article->title() ?></h3>
|
||||
</a>
|
||||
<div class="texts__infos">
|
||||
<p>
|
||||
<?php if (!$authorFilter): ?>
|
||||
<span class="opacity" style="--opacity:.5">par</span>
|
||||
<a class="author" href="/auteurs/<?= Str::slug($article->author()->toUser()->name()) ?>"><?= $article->author()->toUser()->name() ?></a>,
|
||||
<span class="opacity" style="--opacity:.5">le</span>
|
||||
<?php endif ?>
|
||||
<?= $article->published()->toDate('d/m/Y') ?>
|
||||
</p>
|
||||
</div>
|
||||
<!-- <div class="texts__labels">
|
||||
<button class="label label--category">[ <?= $article->category() ?> ]</button>
|
||||
</div> -->
|
||||
</li>
|
||||
<?php if (!$authorFilter || $authorFilter == $article->author()->toUser()->name()->value()) : ?>
|
||||
<?php snippet(
|
||||
'text-item',
|
||||
[
|
||||
'article' => $article
|
||||
]
|
||||
) ?>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
<?php endforeach ?>
|
||||
|
|
|
|||
13
site/snippets/text-item.php
Normal file
13
site/snippets/text-item.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<li class="texts | bottom" style="--bottom:3">
|
||||
<a href="<?= $article->url() ?>" class="texts__title no-line">
|
||||
<h3><?= $article->title() ?></h3>
|
||||
</a>
|
||||
<div class="texts__infos">
|
||||
<p>
|
||||
<span class="opacity" style="--opacity:.5">par</span>
|
||||
<a class="author" href="/auteurs/<?= Str::slug($article->author()->toUser()->name()) ?>"><?= $article->author()->toUser()->name() ?></a><br>
|
||||
<span class="opacity" style="--opacity:.6">publié le </span><?= $article->published()->toDate('d/m/Y') ?>
|
||||
<span class="opacity" style="--opacity: .6">dans</span> <a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<article>
|
||||
<?php snippet('cover', slots: true) ?>
|
||||
<?php slot('title') ?>
|
||||
<h1 class="main-title title-center <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h1>
|
||||
<h1 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h1>
|
||||
<?php endslot() ?>
|
||||
<?php slot('tabs') ?>
|
||||
<?php snippet('tabs', [
|
||||
|
|
|
|||
49
site/templates/category.php
Normal file
49
site/templates/category.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php snippet('header'); ?>
|
||||
|
||||
<main id="<?= $page->template() ?>">
|
||||
<article>
|
||||
<?php snippet('cover', slots: true) ?>
|
||||
<?php slot('title') ?>
|
||||
<h1 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h1>
|
||||
<p class="opacity" style="--opacity:.6">catégorie</p>
|
||||
<?php endslot() ?>
|
||||
<?php endsnippet() ?>
|
||||
<div
|
||||
class="active-tab"
|
||||
>
|
||||
<ul>
|
||||
<?php foreach($kirby->collection('years') as $year): ?>
|
||||
<?php if ($year) : ?>
|
||||
<?php endif ?>
|
||||
<div
|
||||
x-data='{
|
||||
isOpen: false
|
||||
}'
|
||||
:class="isOpen ? '' : 'short'"
|
||||
class="
|
||||
texts__year
|
||||
| full-width
|
||||
flex column
|
||||
bottom"
|
||||
style="
|
||||
--content: center;
|
||||
--bottom: 2;"
|
||||
>
|
||||
<h3 class="fs-xl color" style="--color:var(--color-secondary)"><?= $year->title() ?></h3>
|
||||
<div class="year__edito">
|
||||
<?= $year->edito() ?>
|
||||
</div>
|
||||
<button
|
||||
:class="isOpen ? 'open' : 'close'"
|
||||
class="see-more toggle left" @click="isOpen = !isOpen">Lire</button>
|
||||
</div>
|
||||
<?php foreach($year->children() as $article): ?>
|
||||
<?php if ($article->category() == $page->title()) : ?>
|
||||
<?php snippet('text-item', ['article' => $article]) ?>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
|
|
@ -3,10 +3,10 @@
|
|||
<main id="<?= $page->template() ?>">
|
||||
<?php snippet('cover', slots: true) ?>
|
||||
<?php slot('title') ?>
|
||||
<h3 class="title-center">
|
||||
revue critique<br>
|
||||
des arts et des techniques<br>
|
||||
</h3>
|
||||
<h2 class="title-center">
|
||||
critique des arts<br>
|
||||
et des techniques<br>
|
||||
</h2>
|
||||
<?php endslot() ?>
|
||||
|
||||
<?php slot('tabs') ?>
|
||||
|
|
|
|||
|
|
@ -3,18 +3,19 @@
|
|||
<article>
|
||||
<?php snippet('cover', ['isOpen' => true], slots: true) ?>
|
||||
<?php slot('title') ?>
|
||||
<h1 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h1>
|
||||
<p>
|
||||
<span class="opacity" style="--opacity:.6">par </span>
|
||||
<a
|
||||
class="author"
|
||||
href="/auteurs/<?= Str::slug($page->author()->toUser()->name()) ?>"
|
||||
title="Voir les articles d'<?= $page->author()->toUser()->name() ?>"
|
||||
>
|
||||
<?= $page->author()->toUser()->name() ?>
|
||||
</a><br>
|
||||
<span class="opacity" style="--opacity:.6">le <?= $page->published()->toDate('d/m/Y') ?></span>
|
||||
</p>
|
||||
<h2 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h2>
|
||||
<p>
|
||||
<span class="opacity" style="--opacity:.6">par </span>
|
||||
<a
|
||||
class="author"
|
||||
href="/auteurs/<?= Str::slug($page->author()->toUser()->name()) ?>"
|
||||
title="Voir les articles d'<?= $page->author()->toUser()->name() ?>"
|
||||
>
|
||||
<?= $page->author()->toUser()->name() ?>
|
||||
</a><br>
|
||||
<span class="opacity" style="--opacity:.6">publié le </span><?= $page->published()->toDate('d/m/Y') ?>
|
||||
<span class="opacity" style="--opacity: .6">dans</span> <a href="/categories/<?= $page->category() ?>"><?= $page->category() ?></a>
|
||||
</p>
|
||||
<?php endslot() ?>
|
||||
<?php slot('tabs') ?>
|
||||
<?php snippet('tabs', [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue