fix
This commit is contained in:
parent
448297e658
commit
b01105d2b2
@ -41,7 +41,7 @@ function index($ctx, array $versions, array $posts, PostLanguage $posts_lang) {
|
|||||||
<div class="blog-list-title">{$ctx->lang('recent_articles')}</div>
|
<div class="blog-list-title">{$ctx->lang('recent_articles')}</div>
|
||||||
<div class="blog-list-wrap">
|
<div class="blog-list-wrap">
|
||||||
{$ctx->for_each($posts,
|
{$ctx->for_each($posts,
|
||||||
fn($post, $i) => $ctx->articles_post_row($i, $post, $posts_lang, true))}
|
fn($post, $i) => $ctx->articles_post_row($i, $post, $posts_lang, true, false))}
|
||||||
<a href="/articles/" class="blog-list-expand">
|
<a href="/articles/" class="blog-list-expand">
|
||||||
{$ctx->lang('view_all_articles')}
|
{$ctx->lang('view_all_articles')}
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.47 4.217a.75.75 0 0 0 0 1.06L12.185 10 7.469 14.72a.75.75 0 1 0 1.062 1.06l5.245-5.25a.75.75 0 0 0 0-1.061L8.531 4.218a.75.75 0 0 0-1.061-.001z" fill="currentColor"/></svg>
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.47 4.217a.75.75 0 0 0 0 1.06L12.185 10 7.469 14.72a.75.75 0 1 0 1.062 1.06l5.245-5.25a.75.75 0 0 0 0-1.061L8.531 4.218a.75.75 0 0 0-1.061-.001z" fill="currentColor"/></svg>
|
||||||
@ -91,7 +91,8 @@ function articles_post_row($ctx,
|
|||||||
int $index,
|
int $index,
|
||||||
Post $post,
|
Post $post,
|
||||||
PostLanguage $selected_lang,
|
PostLanguage $selected_lang,
|
||||||
bool $no_block = false): string {
|
bool $no_block = false,
|
||||||
|
bool $show_year = true): string {
|
||||||
$year = $post->getYear();
|
$year = $post->getYear();
|
||||||
$date = $post->getDate();
|
$date = $post->getDate();
|
||||||
$url = $post->getUrl($selected_lang);
|
$url = $post->getUrl($selected_lang);
|
||||||
@ -112,7 +113,7 @@ $buf .= '<div class="blog-list-item-title">'.($no_block ? '<a href="'.$url.'">'
|
|||||||
$buf .= $no_block ? '</div>' : '</a>';
|
$buf .= $no_block ? '</div>' : '</a>';
|
||||||
|
|
||||||
return <<<HTML
|
return <<<HTML
|
||||||
{$ctx->if_true($ctx->year > $year,
|
{$ctx->if_true($show_year && $ctx->year > $year,
|
||||||
fn() => $ctx->articles_index_year_line($year, $index === 0, $selected_lang->value))}
|
fn() => $ctx->articles_index_year_line($year, $index === 0, $selected_lang->value))}
|
||||||
{$buf}
|
{$buf}
|
||||||
HTML;
|
HTML;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user