feat: ajout h-feed

This commit is contained in:
Kazhnuz 2024-11-19 19:40:57 +01:00
parent bb436addd7
commit 34fba16430
6 changed files with 118 additions and 107 deletions

View file

@ -1304,7 +1304,8 @@ footer {
font-size: 0.8rem; font-size: 0.8rem;
text-decoration: none; text-decoration: none;
padding: 0.5333333333rem; padding: 0.5333333333rem;
border-radius: 8px; } border-radius: 8px;
display: block; }
.preview-thumbnail { .preview-thumbnail {
display: block; display: block;

View file

@ -1,39 +1,41 @@
<main> <main class="h-feed">
<h1 class="page-title" id="title-featured"> <h1 class="page-title p-name" id="title-featured">
<svg class="icon" alt=""><use xlink:href="#icon-folder"></use></svg> <svg class="icon" alt=""><use xlink:href="#icon-folder"></use></svg>
<?php <?php
$category = new Category($url->slug()); $category = new Category($url->slug());
echo $category->name(); echo $category->name();
?> ?>
</h1> </h1>
<div class="previews-section preview-list"> <div class="previews-section preview-grid">
<?php foreach ($content as $page) : ?> <?php foreach ($content as $page) : ?>
<?php if ($page->type() != "sticky") : ?> <?php if ($page->type() != "sticky") : ?>
<a href="<?php echo $page->permalink(); ?>" class="preview"> <div class="h-entry">
<div class="preview-thumbnail"> <a href="<?php echo $page->permalink(); ?>" class="preview u-url">
<?php if ($page->coverImage()) : ?> <div class="preview-thumbnail">
<img alt="" src="<?php echo $page->thumbCoverImage(); ?>" /> <?php if ($page->thumbCoverImage()) : ?>
<?php else : ?> <img alt="" src="<?php echo $page->thumbCoverImage(); ?>" class="u-photo" />
<img alt="" src="<?php echo HTML_PATH_THEME_IMG; ?>/default-preview.png" /> <?php else : ?>
<?php endif ?> <img alt="" src="<?php echo HTML_PATH_THEME_IMG; ?>/default-preview.png" class="u-photo" />
</div> <?php endif ?>
<div class="preview-text">
<h2><?php echo $page->title(); ?></h2>
<div class="flex-that">
<div>
<span class='badge c-secondary small-text m-0'><?php echo $page->category(); ?></span>
</div> </div>
<div> <div class="preview-text">
<time><span class="badge c-secondary small-text m-0"><?php echo $page->date('d/m/Y') ?></span></time> <h2 class="p-name"><?php echo $page->title(); ?></h2>
<div class="flex-that">
<div>
<span class='badge c-secondary small-text m-0 p-category'><?php echo $page->category(); ?></span>
</div>
<div>
<time class="dt-published" datetime="<?php echo $page->date(DATE_ATOM) ?>" ><span class="badge c-secondary small-text m-0"><?php echo $page->date('d/m/Y') ?></span></time>
</div>
</div>
<div class="preview-excerpt p-summary"><?php echo $page->description(); ?></div>
</div> </div>
</div> </a>
<div class="preview-excerpt"><?php echo $page->description(); ?></div>
</div> </div>
</a> <?php endif ?>
<?php endif ?> <?php endforeach ?>
<?php endforeach ?> </div>
</div>
<?php if (Paginator::numberOfPages() > 1) : ?> <?php if (Paginator::numberOfPages() > 1) : ?>
<nav class="paginator mb-2 mt-1"> <nav class="paginator mb-2 mt-1">

View file

@ -1,22 +1,23 @@
<main id="skip" class="fullwidth"> <main id="skip" class="fullwidth">
<?php Theme::plugins('pageBegin'); ?> <?php Theme::plugins('pageBegin'); ?>
<?php if (Paginator::currentPage() == 1) : ?> <?php if (Paginator::currentPage() == 1) : ?>
<section aria-labelledby="title-featured"> <section aria-labelledby="title-featured" class="h-feed">
<h1 class="page-title" id="title-featured"> <h1 class="page-title" id="title-featured">
<svg class="icon icon-star" viewBox="0 0 30 32"><path d="M29.714 11.554c0 0.321-0.232 0.625-0.464 0.857l-6.482 6.321 1.536 8.929c0.018 0.125 0.018 0.232 0.018 0.357 0 0.464-0.214 0.893-0.732 0.893-0.25 0-0.5-0.089-0.714-0.214l-8.018-4.214-8.018 4.214c-0.232 0.125-0.464 0.214-0.714 0.214-0.518 0-0.75-0.429-0.75-0.893 0-0.125 0.018-0.232 0.036-0.357l1.536-8.929-6.5-6.321c-0.214-0.232-0.446-0.536-0.446-0.857 0-0.536 0.554-0.75 1-0.821l8.964-1.304 4.018-8.125c0.161-0.339 0.464-0.732 0.875-0.732s0.714 0.393 0.875 0.732l4.018 8.125 8.964 1.304c0.429 0.071 1 0.286 1 0.821z"></path></svg> <svg class="icon icon-star" viewBox="0 0 30 32"><path d="M29.714 11.554c0 0.321-0.232 0.625-0.464 0.857l-6.482 6.321 1.536 8.929c0.018 0.125 0.018 0.232 0.018 0.357 0 0.464-0.214 0.893-0.732 0.893-0.25 0-0.5-0.089-0.714-0.214l-8.018-4.214-8.018 4.214c-0.232 0.125-0.464 0.214-0.714 0.214-0.518 0-0.75-0.429-0.75-0.893 0-0.125 0.018-0.232 0.036-0.357l1.536-8.929-6.5-6.321c-0.214-0.232-0.446-0.536-0.446-0.857 0-0.536 0.554-0.75 1-0.821l8.964-1.304 4.018-8.125c0.161-0.339 0.464-0.732 0.875-0.732s0.714 0.393 0.875 0.732l4.018 8.125 8.964 1.304c0.429 0.071 1 0.286 1 0.821z"></path></svg>
À la une <span class="p-name">À la une</span>
</h1> </h1>
<div id="featured-articles"> <div id="featured-articles">
<?php foreach ($content as $page) : ?> <?php foreach ($content as $page) : ?>
<?php if ($page->type() == "sticky") : ?> <?php if ($page->type() == "sticky") : ?>
<article class="preview-featured"> <article class="preview-featured h-entry">
<a href="<?php echo $page->permalink(); ?>" class="preview-link"> <a href="<?php echo $page->permalink(); ?>" class="preview-link u-url">
<img src='<?php echo ($page->thumbCoverImage() ? $page->thumbCoverImage() : HTML_PATH_THEME_IMG . "/default-preview.png") ?>' class="d-none u-photo">
<div class="preview-item" style="background-image:url('<?php echo ($page->thumbCoverImage() ? $page->thumbCoverImage() : HTML_PATH_THEME_IMG . "/default-preview.png") ?>');"> <div class="preview-item" style="background-image:url('<?php echo ($page->thumbCoverImage() ? $page->thumbCoverImage() : HTML_PATH_THEME_IMG . "/default-preview.png") ?>');">
<div class="preview-overlay"> <div class="preview-overlay">
<div class="preview-categories"> <div class="preview-categories">
<span class='badge c-secondary'><?php echo $page->category(); ?></span> <span class='badge c-secondary p-category'><?php echo $page->category(); ?></span>
</div> </div>
<h2 class="preview-title"><?php echo $page->title(); ?></h2> <h2 class="preview-title p-name"><?php echo $page->title(); ?></h2>
</div> </div>
</div> </div>
</a> </a>
@ -26,37 +27,39 @@
</div> </div>
</section> </section>
<?php endif ?> <?php endif ?>
<section aria-labelledby="title-publications"> <section aria-labelledby="title-publications" class="h-feed">
<h1 class="page-title" id="title-publications"><svg class="icon icon-newspaper-o" alt="" viewBox="0 0 37 30"><path d="M18.286 9.143h-6.857v6.857h6.857v-6.857zM20.571 20.571v2.286h-11.429v-2.286h11.429zM20.571 6.857v11.429h-11.429v-11.429h11.429zM32 20.571v2.286h-9.143v-2.286h9.143zM32 16v2.286h-9.143v-2.286h9.143zM32 11.429v2.286h-9.143v-2.286h9.143zM32 6.857v2.286h-9.143v-2.286h9.143zM4.571 24v-17.143h-2.286v17.143c0 0.625 0.518 1.143 1.143 1.143s1.143-0.518 1.143-1.143zM34.286 24v-19.429h-27.429v19.429c0 0.393-0.071 0.786-0.196 1.143h26.482c0.625 0 1.143-0.518 1.143-1.143zM36.571 2.286v21.714c0 1.893-1.536 3.429-3.429 3.429h-29.714c-1.893 0-3.429-1.536-3.429-3.429v-19.429h4.571v-2.286h32z"></path></svg> Publications</h1> <h1 class="page-title" id="title-publications"><svg class="icon icon-newspaper-o" alt="" viewBox="0 0 37 30"><path d="M18.286 9.143h-6.857v6.857h6.857v-6.857zM20.571 20.571v2.286h-11.429v-2.286h11.429zM20.571 6.857v11.429h-11.429v-11.429h11.429zM32 20.571v2.286h-9.143v-2.286h9.143zM32 16v2.286h-9.143v-2.286h9.143zM32 11.429v2.286h-9.143v-2.286h9.143zM32 6.857v2.286h-9.143v-2.286h9.143zM4.571 24v-17.143h-2.286v17.143c0 0.625 0.518 1.143 1.143 1.143s1.143-0.518 1.143-1.143zM34.286 24v-19.429h-27.429v19.429c0 0.393-0.071 0.786-0.196 1.143h26.482c0.625 0 1.143-0.518 1.143-1.143zM36.571 2.286v21.714c0 1.893-1.536 3.429-3.429 3.429h-29.714c-1.893 0-3.429-1.536-3.429-3.429v-19.429h4.571v-2.286h32z"></path></svg> <span class="p-name">Derniers articles</span></h1>
<div class="previews-section preview-grid"> <div class="previews-section preview-grid">
<?php foreach ($content as $page) : ?> <?php foreach ($content as $page) : ?>
<?php if ($page->type() != "sticky") : ?> <?php if ($page->type() != "sticky") : ?>
<a href="<?php echo $page->permalink(); ?>" class="preview"> <div class="h-entry">
<div class="preview-thumbnail"> <a href="<?php echo $page->permalink(); ?>" class="preview u-url">
<?php if ($page->thumbCoverImage()) : ?> <div class="preview-thumbnail">
<img alt="" src="<?php echo $page->thumbCoverImage(); ?>" /> <?php if ($page->thumbCoverImage()) : ?>
<?php else : ?> <img alt="" src="<?php echo $page->thumbCoverImage(); ?>" class="u-photo" />
<img alt="" src="<?php echo HTML_PATH_THEME_IMG; ?>/default-preview.png" /> <?php else : ?>
<?php endif ?> <img alt="" src="<?php echo HTML_PATH_THEME_IMG; ?>/default-preview.png" class="u-photo" />
</div> <?php endif ?>
<div class="preview-text">
<h2><?php echo $page->title(); ?></h2>
<div class="flex-that">
<div>
<span class='badge c-secondary small-text m-0'><?php echo $page->category(); ?></span>
</div> </div>
<div> <div class="preview-text">
<time><span class="badge c-secondary small-text m-0"><?php echo $page->date('d/m/Y') ?></span></time> <h2 class="p-name"><?php echo $page->title(); ?></h2>
<div class="flex-that">
<div>
<span class='badge c-secondary small-text m-0 p-category'><?php echo $page->category(); ?></span>
</div>
<div>
<time class="dt-published" datetime="<?php echo $page->date(DATE_ATOM) ?>" ><span class="badge c-secondary small-text m-0"><?php echo $page->date('d/m/Y') ?></span></time>
</div>
</div>
<div class="preview-excerpt p-summary"><?php echo $page->description(); ?></div>
</div> </div>
</div> </a>
<div class="preview-excerpt"><?php echo $page->description(); ?></div>
</div> </div>
</a> <?php endif ?>
<?php endif ?> <?php endforeach ?>
<?php endforeach ?> </div>
</div>
<!-- Pagination --> <!-- Pagination -->
<?php if (Paginator::numberOfPages() > 1) : ?> <?php if (Paginator::numberOfPages() > 1) : ?>

View file

@ -1,38 +1,40 @@
<main> <main class="h-feed">
<h1 class="page-title" id="title-featured"> <h1 class="page-title p-name" id="title-featured">
<?php <?php
$title = explode("/", $url->slug()); $title = explode("/", $url->slug());
echo "Recherche pour « " . $title[1] . " »"; echo "Recherche pour « " . $title[1] . " »";
?> ?>
</h1> </h1>
<div class="previews-section preview-list"> <div class="previews-section preview-grid">
<?php foreach ($content as $page) : ?> <?php foreach ($content as $page) : ?>
<?php if ($page->type() != "sticky") : ?> <?php if ($page->type() != "sticky") : ?>
<a href="<?php echo $page->permalink(); ?>" class="preview"> <div class="h-entry">
<div class="preview-thumbnail"> <a href="<?php echo $page->permalink(); ?>" class="preview u-url">
<?php if ($page->coverImage()) : ?> <div class="preview-thumbnail">
<img alt="" src="<?php echo $page->thumbCoverImage(); ?>" /> <?php if ($page->thumbCoverImage()) : ?>
<?php else : ?> <img alt="" src="<?php echo $page->thumbCoverImage(); ?>" class="u-photo" />
<img alt="" src="<?php echo HTML_PATH_THEME_IMG; ?>/default-preview.png" /> <?php else : ?>
<?php endif ?> <img alt="" src="<?php echo HTML_PATH_THEME_IMG; ?>/default-preview.png" class="u-photo" />
</div> <?php endif ?>
<div class="preview-text">
<h2><?php echo $page->title(); ?></h2>
<div class="flex-that">
<div>
<span class='badge c-secondary small-text m-0'><?php echo $page->category(); ?></span>
</div> </div>
<div> <div class="preview-text">
<time><span class="badge c-secondary small-text m-0"><?php echo $page->date('d/m/Y') ?></span></time> <h2 class="p-name"><?php echo $page->title(); ?></h2>
<div class="flex-that">
<div>
<span class='badge c-secondary small-text m-0 p-category'><?php echo $page->category(); ?></span>
</div>
<div>
<time class="dt-published" datetime="<?php echo $page->date(DATE_ATOM) ?>" ><span class="badge c-secondary small-text m-0"><?php echo $page->date('d/m/Y') ?></span></time>
</div>
</div>
<div class="preview-excerpt p-summary"><?php echo $page->description(); ?></div>
</div> </div>
</div> </a>
<div class="preview-excerpt"><?php echo $page->description(); ?></div>
</div> </div>
</a> <?php endif ?>
<?php endif ?> <?php endforeach ?>
<?php endforeach ?> </div>
</div>
<?php if (Paginator::numberOfPages() > 1) : ?> <?php if (Paginator::numberOfPages() > 1) : ?>
<nav class="paginator mb-2 mt-1"> <nav class="paginator mb-2 mt-1">

View file

@ -1,39 +1,41 @@
<main> <main class="h-feed">
<h1 class="page-title" id="title-featured"> <h1 class="page-title p-name" id="title-featured">
<svg class="icon" alt=""><use xlink:href="#icon-tags"></use></svg> <svg class="icon" alt=""><use xlink:href="#icon-tags"></use></svg>
<?php <?php
$tag = new Tag($url->slug()); $tag = new Tag($url->slug());
echo $tag->name(); echo "Article avec le tag « " . $tag->name() . " »";
?> ?>
</h1> </h1>
<div class="previews-section preview-list"> <div class="previews-section preview-grid">
<?php foreach ($content as $page) : ?> <?php foreach ($content as $page) : ?>
<?php if ($page->type() != "sticky") : ?> <?php if ($page->type() != "sticky") : ?>
<a href="<?php echo $page->permalink(); ?>" class="preview"> <div class="h-entry">
<div class="preview-thumbnail"> <a href="<?php echo $page->permalink(); ?>" class="preview u-url">
<?php if ($page->coverImage()) : ?> <div class="preview-thumbnail">
<img alt="" src="<?php echo $page->thumbCoverImage(); ?>" /> <?php if ($page->thumbCoverImage()) : ?>
<?php else : ?> <img alt="" src="<?php echo $page->thumbCoverImage(); ?>" class="u-photo" />
<img alt="" src="<?php echo HTML_PATH_THEME_IMG; ?>/default-preview.png" /> <?php else : ?>
<?php endif ?> <img alt="" src="<?php echo HTML_PATH_THEME_IMG; ?>/default-preview.png" class="u-photo" />
</div> <?php endif ?>
<div class="preview-text">
<h2><?php echo $page->title(); ?></h2>
<div class="flex-that">
<div>
<span class='badge c-secondary small-text m-0'><?php echo $page->category(); ?></span>
</div> </div>
<div> <div class="preview-text">
<time><span class="badge c-secondary small-text m-0"><?php echo $page->date('d/m/Y') ?></span></time> <h2 class="p-name"><?php echo $page->title(); ?></h2>
<div class="flex-that">
<div>
<span class='badge c-secondary small-text m-0 p-category'><?php echo $page->category(); ?></span>
</div>
<div>
<time class="dt-published" datetime="<?php echo $page->date(DATE_ATOM) ?>" ><span class="badge c-secondary small-text m-0"><?php echo $page->date('d/m/Y') ?></span></time>
</div>
</div>
<div class="preview-excerpt p-summary"><?php echo $page->description(); ?></div>
</div> </div>
</div> </a>
<div class="preview-excerpt"><?php echo $page->description(); ?></div>
</div> </div>
</a> <?php endif ?>
<?php endif ?> <?php endforeach ?>
<?php endforeach ?> </div>
</div>
<?php if (Paginator::numberOfPages() > 1) : ?> <?php if (Paginator::numberOfPages() > 1) : ?>
<nav class="paginator mb-2 mt-1"> <nav class="paginator mb-2 mt-1">

View file

@ -56,6 +56,7 @@
text-decoration: none; text-decoration: none;
padding: $lineheight / 3; padding: $lineheight / 3;
border-radius: $card-radius; border-radius: $card-radius;
display: block;
} }
.preview-thumbnail { .preview-thumbnail {