feat: Refactor article and news templates for improved layout and styling

This commit is contained in:
Warren Chen 2026-03-17 12:09:30 +09:00
parent 5048f865f2
commit ccb675f4bc
17 changed files with 292 additions and 132 deletions

View File

@ -204,9 +204,9 @@ class LatestPage(Page, CategoryMixin, BreadcrumbMixin):
def get_context(self, request): def get_context(self, request):
context = super().get_context(request) context = super().get_context(request)
context["category_sections"] = [self.get_latest_articles(request)] context["category_sections"] = [self.get_latest_articles(request)]
breadcrumbs, site_root = self.build_breadcrumbs() # breadcrumbs, site_root = self.build_breadcrumbs()
context["breadcrumbs"] = breadcrumbs # context["breadcrumbs"] = breadcrumbs
context["breadcrumb_root"] = site_root # context["breadcrumb_root"] = site_root
return context return context
@ -216,9 +216,9 @@ class TrendingPage(Page, CategoryMixin, BreadcrumbMixin):
def get_context(self, request): def get_context(self, request):
context = super().get_context(request) context = super().get_context(request)
context["category_sections"] = [self.get_trending_articles(request)] context["category_sections"] = [self.get_trending_articles(request)]
breadcrumbs, site_root = self.build_breadcrumbs() # breadcrumbs, site_root = self.build_breadcrumbs()
context["breadcrumbs"] = breadcrumbs # context["breadcrumbs"] = breadcrumbs
context["breadcrumb_root"] = site_root # context["breadcrumb_root"] = site_root
return context return context
@ -311,8 +311,8 @@ class ArticlePage(Page, BreadcrumbMixin):
context = super().get_context(request) context = super().get_context(request)
breadcrumbs, site_root = self.build_breadcrumbs() breadcrumbs, site_root = self.build_breadcrumbs()
context["breadcrumbs"] = breadcrumbs # context["breadcrumbs"] = breadcrumbs
context["breadcrumb_root"] = site_root # context["breadcrumb_root"] = site_root
category_crumbs = [ category_crumbs = [
crumb crumb
for crumb in breadcrumbs for crumb in breadcrumbs

View File

@ -1,6 +1,6 @@
.page-article-list{ /* .page-article-list{
padding-bottom: 40px; padding-bottom: 40px;
} } */
.first-article { .first-article {
display: grid; display: grid;
@ -42,7 +42,7 @@
} }
.first-article .first-article-title { .first-article .first-article-title {
font-size: 40px; font-size: 36px;
font-weight: 400; font-weight: 400;
color: #f4a41c; color: #f4a41c;
margin: 0; margin: 0;
@ -123,7 +123,7 @@
} }
.article-title { .article-title {
font-size: 40px; font-size: 30px;
font-weight: 400; font-weight: 400;
margin: 0; margin: 0;
display: -webkit-box; display: -webkit-box;
@ -199,6 +199,10 @@
grid-template-columns: 318px 1fr; grid-template-columns: 318px 1fr;
} }
.first-article .first-article-title {
font-size: 30px;
}
.first-article .first-article-image { .first-article .first-article-image {
width: 318px; width: 318px;
} }
@ -208,6 +212,14 @@
height: 290px; height: 290px;
} }
.first-article .first-article-intro {
font-size: 16px;
}
.first-article .first-article-body {
font-size: 12px;
}
.article-list-item { .article-list-item {
grid-template-columns: 318px 1fr; grid-template-columns: 318px 1fr;
} }
@ -219,6 +231,10 @@
.article-thumb img{ .article-thumb img{
width: 318px; width: 318px;
} }
.article-title {
font-size: 26px;
}
} }
@media (max-width: 767px) { @media (max-width: 767px) {
@ -235,9 +251,17 @@
"image" "image"
"content"; "content";
} }
.article-title {
font-size: 20px;
}
} }
@media (min-width: 575px) and (max-width: 767px) { @media (min-width: 575px) and (max-width: 767px) {
.first-article .first-article-title {
font-size: 24px;
}
.first-article .first-article-image { .first-article .first-article-image {
width: 426px; width: 426px;
} }
@ -247,6 +271,14 @@
height: 260px; height: 260px;
} }
.first-article .first-article-intro {
font-size: 16px;
}
.first-article .first-article-body {
font-size: 12px;
}
.article-thumb { .article-thumb {
width: 426px; width: 426px;
} }
@ -258,6 +290,10 @@
} }
@media (max-width: 574px) { @media (max-width: 574px) {
.first-article .first-article-title {
font-size: 20px;
}
.first-article .first-article-image { .first-article .first-article-image {
width: 300px; width: 300px;
} }
@ -267,6 +303,18 @@
height: 218px; height: 218px;
} }
.first-article .first-article-date {
font-size: 11px;
}
.first-article .first-article-intro {
font-size: 14px;
}
.first-article .first-article-body {
font-size: 11px;
}
.article-thumb { .article-thumb {
width: 300px; width: 300px;
} }
@ -275,4 +323,8 @@
width: 300px; width: 300px;
height: 218px; height: 218px;
} }
.article-date {
font-size: 11px;
}
} }

View File

@ -58,6 +58,7 @@
.article-content p { .article-content p {
font-size: 14px; font-size: 14px;
line-height: 1.75;
} }
.article-content .intro { .article-content .intro {
@ -319,6 +320,10 @@
font-size: 20px; font-size: 20px;
} }
.article-content h2 {
font-size: 24px;
}
.back-to-top { .back-to-top {
bottom: 20px; bottom: 20px;
} }
@ -337,6 +342,10 @@
font-size: 24px; font-size: 24px;
} }
.article-content h2 {
font-size: 20px;
}
.article-content .intro { .article-content .intro {
font-size: 18px; font-size: 18px;
} }

View File

@ -9,6 +9,7 @@
"image content"; "image content";
gap: 16px 40px; gap: 16px 40px;
align-items: start; align-items: start;
padding-bottom: 20px;
} }
.block-first-article .first-article-image { .block-first-article .first-article-image {
@ -41,9 +42,10 @@
} }
.block-first-article .first-article-title { .block-first-article .first-article-title {
font-size: 40px; font-size: 36px;
line-height: 1.25;
font-weight: 400; font-weight: 400;
color: #000000; color: #0e1b42;
margin: 0; margin: 0;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
@ -97,7 +99,15 @@
} }
.block-first-article .first-article-title { .block-first-article .first-article-title {
font-size: 36px; font-size: 30px;
}
.block-first-article .first-article-intro {
font-size: 16px;
}
.block-first-article .first-article-body {
font-size: 12px;
} }
} }
@ -121,9 +131,20 @@
} }
.block-first-article .first-article-title { .block-first-article .first-article-title {
font-size: 36px; font-size: 24px;
} }
.block-first-article .first-article-date {
font-size: 12px;
}
.block-first-article .first-article-intro {
font-size: 16px;
}
.block-first-article .first-article-body {
font-size: 12px;
}
} }
@media (max-width: 574px) { @media (max-width: 574px) {
@ -137,10 +158,18 @@
} }
.block-first-article .first-article-title { .block-first-article .first-article-title {
font-size: 24px; font-size: 20px;
}
.block-first-article .first-article-date {
font-size: 11px;
} }
.block-first-article .first-article-intro { .block-first-article .first-article-intro {
font-size: 16px; font-size: 16px;
} }
.block-first-article .first-article-body {
font-size: 11px;
}
} }

View File

@ -42,6 +42,7 @@
.block-list-items .article-title { .block-list-items .article-title {
font-size: 20px; font-size: 20px;
line-height: 1.25;
} }
.block-list-items .article-date { .block-list-items .article-date {
@ -58,6 +59,7 @@
align-self: stretch; align-self: stretch;
margin-left: auto; margin-left: auto;
text-align: center; text-align: center;
padding: 24px 0;
} }
.block-list-more-article a { .block-list-more-article a {
@ -119,6 +121,10 @@
min-width: 0; min-width: 0;
} }
.block-list-items .article-date {
font-size: 12px;
}
.block-list-more-article { .block-list-more-article {
max-width: 100%; max-width: 100%;
} }
@ -143,7 +149,7 @@
} }
.block-list-items .article-date { .block-list-items .article-date {
font-size: 12px; font-size: 11px;
} }
.block-list-more-article span { .block-list-more-article span {

View File

@ -11,6 +11,7 @@
.list-title { .list-title {
align-items: center; align-items: center;
margin: 10px 0; margin: 10px 0;
padding: 40px 0;
} }
.block-title-divider { .block-title-divider {

View File

@ -90,7 +90,7 @@
pointer-events: none; pointer-events: none;
} }
.section-b .horizontal-list-thumb::after { /* .section-b .horizontal-list-thumb::after {
background: url("../img/picfrm_b194.png") no-repeat left bottom / cover; background: url("../img/picfrm_b194.png") no-repeat left bottom / cover;
background-size: 194px 25px; background-size: 194px 25px;
} }
@ -98,7 +98,7 @@
.section-o .horizontal-list-thumb::after { .section-o .horizontal-list-thumb::after {
background: url("../img/picfrm_o194.png") no-repeat left bottom / cover; background: url("../img/picfrm_o194.png") no-repeat left bottom / cover;
background-size: 194px 25px; background-size: 194px 25px;
} } */
.horizontal-list li img { .horizontal-list li img {
display: block; display: block;
@ -124,6 +124,7 @@
} }
.horizontal-list .article-intro { .horizontal-list .article-intro {
min-height: 45px;
} }
.horizontal-list .article-date { .horizontal-list .article-date {

View File

@ -3,14 +3,16 @@
grid-template-columns: 480px 1fr; grid-template-columns: 480px 1fr;
grid-template-areas: grid-template-areas:
"header header" "header header"
"head head"
"image content"; "image content";
padding: 40px 0;
gap: 16px 40px; gap: 16px 40px;
align-items: start; align-items: start;
} }
.news-hero .news-hero-header { .news-hero .news-hero-header {
grid-area: header; grid-area: header;
display: flex; /* display: flex; */
align-items: center; align-items: center;
gap: 12px; gap: 12px;
} }
@ -24,13 +26,13 @@
.news-hero .fist-news-title { .news-hero .fist-news-title {
grid-area: head; grid-area: head;
max-width: 580px; /* max-width: 580px; */
font-size: 40px; font-size: 36px;
font-weight: 400; font-weight: 400;
color: #eb9f13; color: #eb9f13;
margin: 0; margin: 0;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
} }
@ -43,7 +45,7 @@
width: 480px; width: 480px;
} }
.news-hero .first-news-image::after { /* .news-hero .first-news-image::after {
content: ""; content: "";
position: absolute; position: absolute;
left: 0px; left: 0px;
@ -53,7 +55,7 @@
background: url("../img/picfrm_b480.png") no-repeat left bottom / cover; background: url("../img/picfrm_b480.png") no-repeat left bottom / cover;
background-size: 480px 25px; background-size: 480px 25px;
pointer-events: none; pointer-events: none;
} } */
.news-hero .first-news-image img { .news-hero .first-news-image img {
display: block; display: block;
@ -64,14 +66,17 @@
} }
.news-hero .first-news-content { .news-hero .first-news-content {
grid-area: content;
height: 293px;
max-height: 293px; max-height: 293px;
overflow: hidden;
} }
.news-hero .first-news-content a { .news-hero .first-news-content a {
grid-area: content;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
height: 100%;
} }
.news-hero .fist-news-date, .news-hero .fist-news-date,
@ -94,6 +99,7 @@
.news-hero .first-news-body { .news-hero .first-news-body {
font-size: 13px; font-size: 13px;
flex: 1 1 auto; flex: 1 1 auto;
min-height: 0;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
} }
@ -136,7 +142,7 @@
overflow: hidden; overflow: hidden;
} }
.news-list-thumb::after { /* .news-list-thumb::after {
content: ""; content: "";
position: absolute; position: absolute;
left: 0px; left: 0px;
@ -146,7 +152,7 @@
background: url("../img/picfrm_o194.png") no-repeat left bottom / cover; background: url("../img/picfrm_o194.png") no-repeat left bottom / cover;
background-size: 194px 25px; background-size: 194px 25px;
pointer-events: none; pointer-events: none;
} } */
.news-list-thumb img { .news-list-thumb img {
display: block; display: block;
@ -166,6 +172,10 @@
font-size: 20px; font-size: 20px;
} }
.news-list-items .article-intro {
min-height: 45px;
}
.news-list-items .article-date { .news-list-items .article-date {
color: rgba(255, 255, 255, 0.4); color: rgba(255, 255, 255, 0.4);
} }
@ -191,17 +201,17 @@
grid-template-columns: 318px 1fr; grid-template-columns: 318px 1fr;
} }
.news-hero .fist-news-title { /* .news-hero .fist-news-title {
max-width: 320px; max-width: 320px;
} } */
.news-hero .first-news-image { .news-hero .first-news-image {
width: 318px; width: 318px;
} }
.news-hero .first-news-image::after { /* .news-hero .first-news-image::after {
background-size: 318px 25px; background-size: 318px 25px;
} } */
.news-hero .first-news-image img { .news-hero .first-news-image img {
width: 318px; width: 318px;
@ -219,7 +229,7 @@
@media (min-width: 575px) and (max-width: 1023px) { @media (min-width: 575px) and (max-width: 1023px) {
.news-hero .fist-news-title { .news-hero .fist-news-title {
font-size: 36px; font-size: 32px;
} }
.more-news { .more-news {
@ -302,6 +312,11 @@
height:260px; height:260px;
} }
.news-hero .first-news-content {
height: 260px;
max-height: 260px;
}
.news-list-items a > div:nth-of-type(1) { .news-list-items a > div:nth-of-type(1) {
grid-row: 1 / span 3; grid-row: 1 / span 3;
} }
@ -364,6 +379,21 @@
height: 220px; height: 220px;
} }
.news-hero .first-news-content {
height: 220px;
max-height: 220px;
}
.news-hero .first-news-body::after {
height: 90px;
background: linear-gradient(
to bottom,
rgba(14, 27, 66, 0) 0%,
rgba(14, 27, 66, 0.42) 62%,
#0e1b42 92%
);
}
.news-hero .fist-news-title { .news-hero .fist-news-title {
font-size: 24px; font-size: 24px;
@ -386,10 +416,10 @@
height: 110px; height: 110px;
} }
.news-list-thumb::after { /* .news-list-thumb::after {
background: url("../img/picfrm_o139.png") no-repeat left bottom / cover; background: url("../img/picfrm_o139.png") no-repeat left bottom / cover;
background-size: 139px 25px; background-size: 139px 25px;
} } */
.news-list-items a > div:nth-of-type(3) { .news-list-items a > div:nth-of-type(3) {
display: none; display: none;

View File

@ -1,19 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load wagtailcore_tags %} {% load wagtailcore_tags static %}
{% block content %} {% block extra_css %}
<nav class="breadcrumbs" aria-label="breadcrumb"> <link rel="stylesheet" type="text/css" href="{% static 'css/category.css' %}">
<ol> {% endblock %}
<li> {% block content %}
{% if site_root %} <div class="site-hero-band full-bleed">
<a href="{{ site_root.url }}">首頁</a> <div class="site-container">
{% else %} <div class="block-title category-title"><span>#{{ tag.name }}</span></div>
<a href="/">首頁</a> </div>
{% endif %} </div>
</li>
<li><span>標籤</span></li> {% include "home/includes/page-article-list.html" with category=category_sections.0 show_hero=False empty_message="沒有符合條件的文章" %}
<li><span>#{{ tag.name }}</span></li>
</ol>
</nav>
{% include "home/includes/page-article-list.html" with category=category_sections.0 %}
{% endblock %} {% endblock %}

View File

@ -9,9 +9,10 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="site-hero-band full-bleed"> <div class="site-hero-band full-bleed">
{% include "base/includes/home_banner.html" %}
<div class="site-container"> <div class="site-container">
<div class="home-hero"> <div class="home-hero">
{% include "base/includes/home_banner.html" %}
{% with top_section=sections.top_section %} {% with top_section=sections.top_section %}
{% for section in top_section %} {% for section in top_section %}
{% include "home/includes/news_list.html" with section=section %} {% include "home/includes/news_list.html" with section=section %}

View File

@ -1,6 +1,7 @@
{% load wagtailimages_tags static home_tags %} {% load wagtailimages_tags static home_tags %}
<div class="site-hero-band full-bleed"> {% if show_hero != False %}
<div class="site-hero-band full-bleed">
<div class="site-container"> <div class="site-container">
{% with first_article=items|first %} {% with first_article=items|first %}
{% if first_article %} {% if first_article %}
@ -36,13 +37,16 @@
</div> </div>
</div> </div>
{% else %} {% else %}
<span class="empty">目前沒有文章</span> <span class="empty">{{ empty_message|default:"目前沒有文章" }}</span>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
</div> </div>
</div> </div>
<div class="article-list-lower"> {% endif %}
{% if items|length >= 2 %}
{% if show_hero != False %}
{% if items|length > 2 %}
<div class="article-list-lower">
{% for article in items|slice:"1:" %} {% for article in items|slice:"1:" %}
<a href="{{ article.url }}"> <a href="{{ article.url }}">
<div class="article-list-item"> <div class="article-list-item">
@ -62,5 +66,32 @@
</div> </div>
</a> </a>
{% endfor %} {% endfor %}
</div>
{% endif %} {% endif %}
</div> {% else %}
{% if items|length %}
<div class="article-list-lower">
{% for article in items %}
<a href="{{ article.url }}">
<div class="article-list-item">
<div class="article-thumb">
{% if article.cover_image %}
{% image article.cover_image max-410x218 as cover %}
<img src="{{ cover.url }}" alt="{{ article.title }}"/>
{% else %}
{% random_default_cover as default_cover %}
<img src="{{ default_cover }}" alt="{{ article.title }}"/>
{% endif %}
</div>
<div class="article-content">
<div><span class="article-title">{{ article.title }}</span></div>
<div><span class="article-date">{{ article.date|date:"Y.m.d" }}</span></div>
</div>
</div>
</a>
{% endfor %}
</div>
{% else %}
<span class="empty">{{ empty_message|default:"沒有符合條件的文章" }}</span>
{% endif %}
{% endif %}

View File

@ -12,6 +12,7 @@
</span> </span>
<a href="{{ section.url }}"><span class="more-link">查看全部</span></a> <a href="{{ section.url }}"><span class="more-link">查看全部</span></a>
</div> </div>
</div>
{% with first_article=section.items|first %} {% with first_article=section.items|first %}
{% if first_article %} {% if first_article %}
<div class="fist-news-title"> <div class="fist-news-title">
@ -19,11 +20,6 @@
<span>{{ first_article.title }}</span> <span>{{ first_article.title }}</span>
</a> </a>
</div> </div>
{% endif %}
{% endwith %}
</div>
{% with first_article=section.items|first %}
{% if first_article %}
<div class="first-news-image"> <div class="first-news-image">
<a href="{{ first_article.url }}"> <a href="{{ first_article.url }}">
{% if first_article.cover_image %} {% if first_article.cover_image %}

View File

@ -4,7 +4,7 @@
{% endblock %} {% endblock %}
<div class="page-article-list"> <div class="page-article-list">
{% include "home/includes/article_list.html" with items=category.items %} {% include "home/includes/article_list.html" with items=category.items show_hero=show_hero empty_message=empty_message %}
{% if category.items.paginator.num_pages > 1 %} {% if category.items.paginator.num_pages > 1 %}
<div class="pagination"> <div class="pagination">
@ -17,6 +17,13 @@
</button> </button>
<span>BACK</span> <span>BACK</span>
</a> </a>
{% else %}
<button class="left-arrow" type="button" data-dir="left" aria-label="更多文章">
<svg class="left-arrow-icon" xmlns="http://www.w3.org/2000/svg" fill="none" overflow="visible" preserveAspectRatio="none" viewBox="0 0 18.1213 33.4142">
<path d="M17.4142 0.707107L1.41421 16.7071L17.4142 32.7071" id="Vector 3" stroke="var(--stroke-0, #0E1B42)" stroke-width="2"/>
</svg>
</button>
<span>BACK</span>
{% endif %} {% endif %}
<div class="pagination-pages"> <div class="pagination-pages">
{% for page_num in category.page_range %} {% for page_num in category.page_range %}

View File

@ -4,7 +4,7 @@ from django.shortcuts import get_object_or_404, render
from taggit.models import Tag from taggit.models import Tag
from wagtail.models import Site from wagtail.models import Site
from .models import ArticlePage, PAGE_SIZE from .models import ArticlePage, CATEGORY_HOT_SIZE, PAGE_SIZE
def hashtag_search(request, slug): def hashtag_search(request, slug):
@ -12,7 +12,7 @@ def hashtag_search(request, slug):
articles = ( articles = (
ArticlePage.objects.live() ArticlePage.objects.live()
.filter(tags__slug=slug) .filter(tags__slug=slug)
.order_by("-date") .order_by("-date", "-id")
) )
paginator = Paginator(articles, PAGE_SIZE) paginator = Paginator(articles, PAGE_SIZE)
@ -38,6 +38,11 @@ def hashtag_search(request, slug):
"page_range": paginator.get_elided_page_range(page_obj.number), "page_range": paginator.get_elided_page_range(page_obj.number),
} }
], ],
"category_trending": (
ArticlePage.objects.live()
.filter(tags__slug=slug, trending=True)
.order_by("-date", "-id")[:CATEGORY_HOT_SIZE]
),
"site_root": site_root, "site_root": site_root,
"page": site_root.specific if site_root else None, "page": site_root.specific if site_root else None,
} }

View File

@ -13,7 +13,6 @@
.contact-form-modal__backdrop { .contact-form-modal__backdrop {
position: absolute; position: absolute;
inset: 0; inset: 0;
background: #0e1b42cc;
} }
.contact-form-modal__dialog { .contact-form-modal__dialog {
@ -26,6 +25,7 @@
background: #0e1b42e6; background: #0e1b42e6;
color: #ffffff; color: #ffffff;
overflow-y: auto; overflow-y: auto;
backdrop-filter: blur(12px);
} }
.contact-form-modal__close { .contact-form-modal__close {

View File

@ -47,24 +47,25 @@
height: 59px; height: 59px;
padding: 0 10px 0 0; padding: 0 10px 0 0;
border-radius: 36px; border-radius: 36px;
background: #323232; background: #ffffff1a;
border: 1px solid #ffffff80; border: 1px solid #ffffff80;
transform: translateX(calc(100% - var(--fab-toggle-width))); transform: translateX(calc(100% - var(--fab-toggle-width)));
transition: transform 0.25s ease, background-color 0.2s ease; transition: transform 0.25s ease, background-color 0.2s ease;
backdrop-filter: blur(12px);
} }
.subscribe-fab:hover .subscribe-fab__panel { .subscribe-fab:hover .subscribe-fab__panel {
background: #767676; background: #ffffff66;
} }
.subscribe-fab.is-open .subscribe-fab__panel { .subscribe-fab.is-open .subscribe-fab__panel {
background: #767676; background: #ffffff66;
transform: translateX(44px); transform: translateX(44px);
} }
.subscribe-fab:hover .subscribe-fab__toggle, .subscribe-fab:hover .subscribe-fab__toggle,
.subscribe-fab.is-open .subscribe-fab__toggle { .subscribe-fab.is-open .subscribe-fab__toggle {
color: #0e1b42;; color: #0e1b42;
} }
.subscribe-fab__form { .subscribe-fab__form {

View File

@ -1,33 +1,29 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load wagtailcore_tags %} {% load wagtailcore_tags static %}
{% block body_class %}template-searchresults{% endblock %} {% block body_class %}template-searchresults{% endblock %}
{% block extra_css %}
<link rel="stylesheet" type="text/css" href="{% static 'css/category.css' %}">
{% endblock %}
{% block title %} {% block title %}
{% if search_query %}搜尋:{{ search_query }}{% else %}搜尋{% endif %} {% if search_query %}搜尋:{{ search_query }}{% else %}搜尋{% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<nav class="breadcrumbs" aria-label="breadcrumb">
<ol>
<li>
{% if site_root %}
<a href="{{ site_root.url }}">首頁</a>
{% else %}
<a href="/">首頁</a>
{% endif %}
</li>
<li><span>搜尋</span></li>
{% if search_query %} {% if search_query %}
<li><span>{{ search_query }}</span></li> <div class="site-hero-band full-bleed">
<div class="site-container">
<div class="block-title category-title"><span>{{ search_query }}</span></div>
</div>
</div>
{% endif %} {% endif %}
</ol>
</nav>
<section class="search-results"> <section class="search-results">
{% if search_query %} {% if search_query %}
{% if results_count %} {% if results_count %}
{% include "home/includes/page-article-list.html" %} {% include "home/includes/page-article-list.html" with category=category_sections.0 show_hero=False empty_message="沒有符合條件的文章" %}
{% else %} {% else %}
<p>找不到與「{{ search_query }}」相關的文章。</p> <p>找不到與「{{ search_query }}」相關的文章。</p>
{% endif %} {% endif %}