stage release version 20260127 #4

Merged
warrenchen merged 2 commits from develop into main 2026-01-27 06:05:15 +00:00
18 changed files with 654 additions and 295 deletions

View File

@ -22,6 +22,7 @@ NEWS_SIZE = _get_env_int("HOMEPAGE_NEWS_SIZE", 8) # Default to 8 articles in new
BLOCK_SIZE = _get_env_int("HOMEPAGE_BLOCK_SIZE", 7) # Default to 7 articles in block layout BLOCK_SIZE = _get_env_int("HOMEPAGE_BLOCK_SIZE", 7) # Default to 7 articles in block layout
HORIZON_SIZE = _get_env_int("HOMEPAGE_HORIZON_SIZE", 4) # Default to 4 articles in horizon layout HORIZON_SIZE = _get_env_int("HOMEPAGE_HORIZON_SIZE", 4) # Default to 4 articles in horizon layout
PAGE_SIZE = _get_env_int("HOMEPAGE_PAGE_SIZE", 10) # Default to 10 articles per page for pagination PAGE_SIZE = _get_env_int("HOMEPAGE_PAGE_SIZE", 10) # Default to 10 articles per page for pagination
CATEGORY_HOT_SIZE = _get_env_int("CATEGORY_HOT_SIZE", 6) # Default to 4 articles in category hot layout
# Mixin for Category-related functionality # Mixin for Category-related functionality
class CategoryMixin: class CategoryMixin:
@ -64,6 +65,7 @@ class CategoryMixin:
"title": self.title, "title": self.title,
"items": page_obj, "items": page_obj,
"url": self.url, "url": self.url,
"page_range": paginator.get_elided_page_range(page_obj.number),
} }
) )
return blocks return blocks
@ -108,6 +110,7 @@ class CategoryMixin:
"title": self.title, "title": self.title,
"items": page_obj, "items": page_obj,
"url": self.url, "url": self.url,
"page_range": paginator.get_elided_page_range(page_obj.number),
} }
def get_trending_articles(self, request=None, exclude_ids=None): def get_trending_articles(self, request=None, exclude_ids=None):
@ -142,6 +145,7 @@ class CategoryMixin:
"title": self.title, "title": self.title,
"items": page_obj, "items": page_obj,
"url": self.url, "url": self.url,
"page_range": paginator.get_elided_page_range(page_obj.number),
} }
@ -224,6 +228,12 @@ class CategoryPage(Page, CategoryMixin):
def get_context(self, request): def get_context(self, request):
context = super().get_context(request) context = super().get_context(request)
context["category_sections"] = self.build_category_blocks(request) context["category_sections"] = self.build_category_blocks(request)
context["category_trending"] = (
ArticlePage.objects.descendant_of(self)
.live()
.filter(trending=True)
.order_by("-date", "-id")[:CATEGORY_HOT_SIZE]
)
# 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

View File

@ -0,0 +1,278 @@
.page-article-list{
padding-bottom: 40px;
}
.first-article {
display: grid;
grid-template-columns: 410px 1fr;
grid-template-areas:
"image content";
gap: 16px 40px;
align-items: start;
padding: 40px 0;
}
.first-article .first-article-image {
grid-area: image;
position: relative;
border-radius: 10px;
overflow: hidden;
width: 410px;
}
.first-article .first-article-image img{
display: block;
width: 410px;
height: 293px;
object-fit: cover;
border-radius: 10px;
}
.first-article .first-article-content {
max-height: 293px;
overflow: hidden;
position: relative;
}
.first-article .first-article-content a {
grid-area: content;
display: flex;
flex-direction: column;
gap: 16px;
}
.first-article .first-article-title {
font-size: 40px;
font-weight: 400;
color: #f4a41c;
margin: 0;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
flex: 0 0 auto;
}
.first-article .first-article-date {
color: #ffffff66;
flex: 0 0 auto;
}
.first-article .first-article-intro {
font-size: 20px;
flex: 0 1 auto;
min-height: 0;
overflow: hidden;
}
.first-article .first-article-body {
flex: 1 2 auto;
min-height: 0;
overflow: hidden;
position: relative;
}
.first-article .first-article-content::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 100px;
background: linear-gradient(to bottom, rgba(14, 27, 66, 0), #0e1b42);
pointer-events: none;
}
.article-list-lower {
margin: 40px 0;
display: flex;
flex-direction: column;
gap: 32px;
}
.article-list-item {
display: grid;
grid-template-columns: 410px 1fr;
grid-template-areas:
"image content";
gap: 16px 40px;
align-items: start;
}
.article-thumb {
grid-area: image;
position: relative;
border-radius: 10px;
overflow: hidden;
width: 410px;
}
.article-thumb img{
display: block;
width: 410px;
height: 218px;
object-fit: cover;
border-radius: 10px;
}
.article-content {
grid-area: content;
display: flex;
flex-direction: column;
gap: 8px;
}
.article-title {
font-size: 40px;
font-weight: 400;
margin: 0;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.article-date {
color: #0e1b4266;
}
.pagination {
display: flex;
justify-content: center;
align-items: center;
/* vertical-align: middle; */
gap: 16px;
height: 44px;
}
.pagination a {
display: inline-flex;
align-items: center;
gap: 8px;
height: 44px;
}
.pagination .prev-page span,
.pagination .next-page span {
height: 44px;
line-height: 44px;
}
.pagination .left-arrow,
.pagination .right-arrow {
background: none;
width: 44px;
height: 44px;
border: none;
padding: 0;
cursor: pointer;
}
.pagination .left-arrow .left-arrow-icon,
.pagination .right-arrow .right-arrow-icon {
width: 16px;
height: 32px;
}
.pagination .right-arrow .right-arrow-icon {
transform: rotate(180deg);
}
.pagination-pages {
display: flex;
align-items: center;
gap: 12px;
}
.pagination-pages a,
.pagination-current,
.pagination-ellipsis {
line-height: 44px;
}
.pagination-current {
font-weight: 700;
}
@media (min-width: 768px) and (max-width: 1023px) {
.first-article {
grid-template-columns: 318px 1fr;
}
.first-article .first-article-image {
width: 318px;
}
.first-article .first-article-image img{
width: 318px;
height: 290px;
}
.article-list-item {
grid-template-columns: 318px 1fr;
}
.article-thumb {
width: 318px;
}
.article-thumb img{
width: 318px;
}
}
@media (max-width: 767px) {
.first-article {
grid-template-columns: 1fr;
grid-template-areas:
"image"
"content";
}
.article-list-item {
grid-template-columns: 1fr;
grid-template-areas:
"image"
"content";
}
}
@media (min-width: 575px) and (max-width: 767px) {
.first-article .first-article-image {
width: 426px;
}
.first-article .first-article-image img{
width: 426px;
height: 260px;
}
.article-thumb {
width: 426px;
}
.article-thumb img{
width: 426px;
height: 260px;
}
}
@media (max-width: 574px) {
.first-article .first-article-image {
width: 300px;
}
.first-article .first-article-image img{
width: 300px;
height: 218px;
}
.article-thumb {
width: 300px;
}
.article-thumb img{
width: 300px;
height: 218px;
}
}

View File

@ -28,13 +28,16 @@
} }
.block-first-article .first-article-content { .block-first-article .first-article-content {
max-height: 293px;
overflow: hidden;
position: relative;
}
.block-first-article .first-article-content a {
grid-area: content; grid-area: content;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
max-height: 293px;
overflow: hidden;
position: relative;
} }
.block-first-article .first-article-title { .block-first-article .first-article-title {
@ -79,98 +82,6 @@
pointer-events: none; pointer-events: none;
} }
.block-list-lower {
margin: 24px 0;
display: flex;
flex-wrap: wrap;
align-items: stretch;
gap: 28px;
}
.block-list-items {
display: contents;
}
.block-list-items a {
display: flex;
flex-direction: column;
gap: 12px;
width: 200px;
text-decoration: none;
}
.block-list-thumb {
position: relative;
width: 194px;
height: 133px;
border-radius: 10px;
overflow: hidden;
}
.block-list-thumb img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.block-list-items a span{
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.block-list-items .article-title {
font-size: 20px;
}
.block-list-items .article-date {
color: #0e1b4266;
}
.block-list-more-article {
max-width: 430px;
min-width: 200px;
flex: 1 1 0;
display: flex;
align-items: center;
justify-content: center;
align-self: stretch;
margin-left: auto;
text-align: center;
}
.block-list-more-article a {
display: flex;
align-items: center;
gap: 12px;
justify-content: center;
}
.block-list-more-article span {
font-size: 18px;
font-weight: 700;
color: #0e1b42;
text-decoration: underline;
}
.block-list-more-article .right-arrow {
background: none;
width: 52px;
height: 52px;
border: none;
padding: 0;
cursor: pointer;
box-shadow: #0e1b4266 1px 2px 1px 1px;
}
.block-list-more-article .right-arrow .right-arrow-icon {
width: 16px;
height: 32px;
transform: rotate(180deg);
}
@media (min-width: 768px) and (max-width: 1023px) { @media (min-width: 768px) and (max-width: 1023px) {
.block-first-article { .block-first-article {
grid-template-columns: 318px 1fr; grid-template-columns: 318px 1fr;
@ -188,15 +99,6 @@
.block-first-article .first-article-title { .block-first-article .first-article-title {
font-size: 36px; font-size: 36px;
} }
.block-list-lower {
gap: 20px;
}
.block-list-more-article {
max-width: 200px;
flex: 1 1 200px;
}
} }
@media (max-width: 767px) { @media (max-width: 767px) {
@ -222,27 +124,6 @@
font-size: 36px; font-size: 36px;
} }
.block-list-items a {
display: grid;
grid-template-columns: 194px 1fr;
column-gap: 16px;
row-gap: 8px;
width: 100%;
}
.block-list-items a > div:nth-of-type(1) {
grid-row: 1 / span 2;
}
.block-list-items a > div:nth-of-type(2),
.block-list-items a > div:nth-of-type(3) {
grid-column: 2;
min-width: 0;
}
.block-list-more-article {
max-width: 100%;
}
} }
@media (max-width: 574px) { @media (max-width: 574px) {
@ -262,39 +143,4 @@
.block-first-article .first-article-intro { .block-first-article .first-article-intro {
font-size: 16px; font-size: 16px;
} }
.block-list-lower {
gap: 16px;
}
.block-list-items a {
width: 142px;
}
.block-list-thumb {
width: 139px;
height: 110px;
}
.block-list-items .article-title {
font-size: 16px;
}
.block-list-items .article-date {
font-size: 12px;
}
.block-list-more-article span {
font-size: 16px;
}
.block-list-more-article .right-arrow {
width: 40px;
height: 40px;
}
.block-list-more-article .right-arrow .right-arrow-icon {
width: 12px;
height: 24px;
}
} }

View File

@ -0,0 +1,162 @@
.block-list-lower {
margin: 24px 0;
display: flex;
flex-wrap: wrap;
align-items: stretch;
gap: 28px;
}
.block-list-items {
display: contents;
}
.block-list-items a {
display: flex;
flex-direction: column;
gap: 12px;
width: 200px;
text-decoration: none;
}
.block-list-thumb {
position: relative;
width: 194px;
height: 133px;
border-radius: 10px;
overflow: hidden;
}
.block-list-thumb img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.block-list-items a span {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.block-list-items .article-title {
font-size: 20px;
}
.block-list-items .article-date {
color: #0e1b4266;
}
.block-list-more-article {
max-width: 430px;
min-width: 200px;
flex: 1 1 0;
display: flex;
align-items: center;
justify-content: center;
align-self: stretch;
margin-left: auto;
text-align: center;
}
.block-list-more-article a {
display: flex;
align-items: center;
gap: 12px;
justify-content: center;
}
.block-list-more-article span {
font-size: 18px;
font-weight: 700;
text-decoration: underline;
}
.block-list-more-article .right-arrow {
background: none;
width: 52px;
height: 52px;
border: none;
padding: 0;
cursor: pointer;
box-shadow: #0e1b4266 1px 2px 1px 1px;
}
.block-list-more-article .right-arrow .right-arrow-icon {
width: 16px;
height: 32px;
transform: rotate(180deg);
}
@media (min-width: 768px) and (max-width: 1023px) {
.block-list-lower {
gap: 20px;
}
.block-list-more-article {
max-width: 200px;
flex: 1 1 200px;
}
}
@media (min-width: 575px) and (max-width: 767px) {
.block-list-items a {
display: grid;
grid-template-columns: 194px 1fr;
column-gap: 16px;
row-gap: 8px;
width: 100%;
}
.block-list-items a > div:nth-of-type(1) {
grid-row: 1 / span 2;
}
.block-list-items a > div:nth-of-type(2),
.block-list-items a > div:nth-of-type(3) {
grid-column: 2;
min-width: 0;
}
.block-list-more-article {
max-width: 100%;
}
}
@media (max-width: 574px) {
.block-list-lower {
gap: 16px;
}
.block-list-items a {
width: 142px;
}
.block-list-thumb {
width: 139px;
height: 110px;
}
.block-list-items .article-title {
font-size: 16px;
}
.block-list-items .article-date {
font-size: 12px;
}
.block-list-more-article span {
font-size: 16px;
}
.block-list-more-article .right-arrow {
width: 40px;
height: 40px;
}
.block-list-more-article .right-arrow .right-arrow-icon {
width: 12px;
height: 24px;
}
}

View File

@ -21,7 +21,6 @@
display: flex; display: flex;
align-items: center; align-items: center;
margin: 24px 0; margin: 24px 0;
color: #0e1b42;
font-size: 18px; font-size: 18px;
font-weight: 700; font-weight: 700;
} }

View File

@ -1,13 +1,7 @@
.home-hero-band { .home-hero {
background-color: #0e1b42;
color: #ffffff;
padding-bottom: 86px; padding-bottom: 86px;
} }
.home-hero-band a {
color: #ffffff;
}
.home-banner img { .home-banner img {
width: 100%; width: 100%;
height: auto; height: auto;
@ -42,7 +36,6 @@
.more-link { .more-link {
text-decoration: none; text-decoration: none;
font-size: 16px;
} }
.section-b .list-title { .section-b .list-title {

View File

@ -69,7 +69,6 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 12px; gap: 12px;
color: inherit;
text-decoration: none; text-decoration: none;
} }
@ -125,12 +124,10 @@
} }
.horizontal-list .article-intro { .horizontal-list .article-intro {
font-size: 16px;
} }
.horizontal-list .article-date { .horizontal-list .article-date {
color: #0e1b4266; color: #0e1b4266;
font-size: 16px;
} }
.horizontal-list .empty { .horizontal-list .empty {

View File

@ -1,8 +1,3 @@
.news-title, .more-news-title {
background-color: #ffffff;
color: #0e1b42;
}
.news-hero { .news-hero {
display: grid; display: grid;
grid-template-columns: 480px 1fr; grid-template-columns: 480px 1fr;
@ -69,11 +64,14 @@
} }
.news-hero .first-news-content { .news-hero .first-news-content {
max-height: 293px;
}
.news-hero .first-news-content a {
grid-area: content; grid-area: content;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
max-height: 293px;
} }
.news-hero .fist-news-date, .news-hero .fist-news-date,

View File

@ -3,6 +3,7 @@
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" type="text/css" href="{% static 'css/category.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'css/category.css' %}">
{% endblock %} {% endblock %}
{% block body_class %}{% if not page.has_subcategories %}template-darkbackground{% endif %}{% endblock %}
{% block content %} {% block content %}
{# Breadcrumbs navigation may not used anymore #} {# Breadcrumbs navigation may not used anymore #}
{% if breadcrumbs %} {% if breadcrumbs %}
@ -25,13 +26,27 @@
</ol> </ol>
</nav> </nav>
{% endif %} {% endif %}
<div class="block-title category-title"><span>{{ self.title}}</span></div> <div class="site-hero-band full-bleed">
<div class="site-container">
<div class="block-title category-title"><span>{{ self.title}}</span></div>
</div>
</div>
{% if page.has_subcategories %} {% if page.has_subcategories %}
{% for section in category_sections %} {% for section in category_sections %}
<div class="subcategory-title"><span>{{ section.title }}</span></div> <div class="subcategory-title">
<a href="{{ section.url }}">
<span>{{ section.title }}</span>
</a>
</div>
{% include "home/includes/block_list.html" with items=section.items %} {% include "home/includes/block_list.html" with items=section.items %}
{% endfor %} {% endfor %}
{% else %} {% else %}
{% include "home/includes/page-article-list.html" with category=category_sections.0 %} {% include "home/includes/page-article-list.html" with category=category_sections.0 %}
{% if category_trending %}
<div class="subcategory-title">
<span>熱門文章</span>
</div>
{% include "home/includes/block_list_lower.html" with items=category_trending %}
{% endif %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -15,5 +15,5 @@
</ol> </ol>
</nav> </nav>
{% include "home/includes/page-article-list.html" %} {% include "home/includes/page-article-list.html" with category=category_sections.0 %}
{% endblock %} {% endblock %}

View File

@ -8,7 +8,7 @@
<link rel="stylesheet" type="text/css" href="{% static 'css/horizontal_list.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'css/horizontal_list.css' %}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="home-hero-band full-bleed"> <div class="site-hero-band full-bleed">
<div class="site-container"> <div class="site-container">
<div class="home-hero"> <div class="home-hero">
{% include "base/includes/home_banner.html" %} {% include "base/includes/home_banner.html" %}

View File

@ -1,21 +1,64 @@
{% load wagtailimages_tags static %} {% load wagtailimages_tags static %}
<ul class="article-list"> <div class="site-hero-band full-bleed">
{% for article in items %} <div class="site-container">
<li> {% with first_article=items|first %}
<article> {% if first_article %}
<a href="{{ article.url }}"> <div class="first-article">
{% if article.cover_image %} <div class="first-article-image">
{% image article.cover_image max-200x200 as cover %} <a href="{{ first_article.url }}">
<img src="{{ cover.url }}" alt="{{ article.title }}" height="200" width="200" style="width:200px;height:200px;object-fit:contain;display:block;"/> {% if first_article.cover_image %}
{% else %} {% image first_article.cover_image max-410x293 as cover %}
<img src="{% static 'img/default_cover.jpg' %}" alt="{{ article.title }}" height="200" width="200" style="width:200px;height:200px;object-fit:contain;display:block;"/> <img src="{{ cover.url }}" alt="{{ first_article.title }}"/>
{% endif %} {% else %}
{{ article.title }} <img src="{% static 'img/default_cover.jpg' %}" alt="{{ first_article.title }}"/>
</a> {% endif %}
</article> </a>
</li> </div>
{% empty %} <div class="first-article-content">
<li class="empty">目前沒有文章</li> <a href="{{ first_article.url }}">
{% endfor %} <div class="first-article-title">
</ul> <span>{{ first_article.title }}</span>
</div>
<div class="first-article-date">
<span>{{ first_article.date|date:"Y.m.d" }}</span>
</div>
{% if first_article.intro %}
<div class="first-article-intro">
<span>{{ first_article.intro }}</span>
</div>
{% endif %}
<div class="first-article-body">
<span>{{ first_article.body_search_text|truncatechars:200 }}</span>
</div>
</a>
</div>
</div>
{% else %}
<span class="empty">目前沒有文章</span>
{% endif %}
{% endwith %}
</div>
</div>
<div class="article-list-lower">
{% if items|length >= 2 %}
{% for article in items|slice:"1:" %}
<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 %}
<img src="{% static 'img/default_cover.jpg' %}" 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 %}
{% endif %}
</div>

View File

@ -18,20 +18,22 @@
</a> </a>
</div> </div>
<div class="first-article-content"> <div class="first-article-content">
<div class="first-article-title"> <a href="{{ first_article.url }}">
<span>{{ first_article.title }}</span> <div class="first-article-title">
</div> <span>{{ first_article.title }}</span>
<div class="first-article-date">
<span>{{ first_article.date|date:"Y.m.d" }}</span>
</div>
{% if first_article.intro %}
<div class="first-article-intro">
<span>{{ first_article.intro }}</span>
</div> </div>
{% endif %} <div class="first-article-date">
<div class="first-article-body"> <span>{{ first_article.date|date:"Y.m.d" }}</span>
<span>{{ first_article.body_search_text|truncatechars:200 }}</span> </div>
</div> {% if first_article.intro %}
<div class="first-article-intro">
<span>{{ first_article.intro }}</span>
</div>
{% endif %}
<div class="first-article-body">
<span>{{ first_article.body_search_text|truncatechars:200 }}</span>
</div>
</a>
</div> </div>
</div> </div>
{% else %} {% else %}
@ -40,35 +42,6 @@
{% endwith %} {% endwith %}
{% if items|length >= 2 %} {% if items|length >= 2 %}
<!-- <div class="list-title"> {% include "home/includes/block_list_lower.html" with items=items|slice:"1:7" %}
<span class="more-link"><a href="{{ items.0.get_parent.url }}">查看全部</a></span> -->
<div class="block-list-lower">
<div class="block-list-items">
{% for article in items|slice:"1:7" %}
<a href="{{ article.url }}">
<div class="block-list-thumb">
{% if article.cover_image %}
{% image article.cover_image max-194x133 as cover %}
<img src="{{ cover.url }}" alt="{{ article.title }}"/>
{% else %}
<img src="{% static 'img/default_cover.jpg' %}" alt="{{ article.title }}"/>
{% endif %}
</div>
<div><span class="article-title">{{ article.title }}</span></div>
<div><span class="article-date">{{ article.date|date:"Y.m.d" }}</span></div>
</a>
{% endfor %}
</div>
<div class="block-list-more-article">
<a href="{{ items.0.get_parent.url }}">
<span>更多文章</span>
<button class="right-arrow" type="button" data-dir="right" aria-label="更多文章">
<svg class="right-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>
</a>
</div>
</div>
{% endif %} {% endif %}
</div> </div>

View File

@ -0,0 +1,33 @@
{% load wagtailimages_tags static %}
{% block extra_css %}
<link rel="stylesheet" type="text/css" href="{% static 'css/block_list_lower.css' %}">
{% endblock %}
<div class="block-list-lower">
<div class="block-list-items">
{% for article in items %}
<a href="{{ article.url }}">
<div class="block-list-thumb">
{% if article.cover_image %}
{% image article.cover_image max-194x133 as cover %}
<img src="{{ cover.url }}" alt="{{ article.title }}"/>
{% else %}
<img src="{% static 'img/default_cover.jpg' %}" alt="{{ article.title }}"/>
{% endif %}
</div>
<div><span class="article-title">{{ article.title }}</span></div>
<div><span class="article-date">{{ article.date|date:"Y.m.d" }}</span></div>
</a>
{% endfor %}
</div>
<div class="block-list-more-article">
<a href="{{ items.0.get_parent.url }}">
<span>更多文章</span>
<button class="right-arrow" type="button" data-dir="right" aria-label="更多文章">
<svg class="right-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>
</a>
</div>
</div>

View File

@ -15,7 +15,9 @@
{% 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">
<span>{{ first_article.title }}</span> <a href="{{ first_article.url }}">
<span>{{ first_article.title }}</span>
</a>
</div> </div>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
@ -33,17 +35,19 @@
</a> </a>
</div> </div>
<div class="first-news-content"> <div class="first-news-content">
<div class="fist-news-date"> <a href="{{ first_article.url }}">
<span>{{ first_article.date|date:"Y.m.d" }}</span> <div class="fist-news-date">
</div> <span>{{ first_article.date|date:"Y.m.d" }}</span>
{% if first_article.intro %}
<div class="first-news-intro">
<span>{{ first_article.intro }}</span>
</div> </div>
{% endif %} {% if first_article.intro %}
<div class="first-news-body"> <div class="first-news-intro">
<span>{{ first_article.body_search_text|truncatechars:320 }}</span> <span>{{ first_article.intro }}</span>
</div> </div>
{% endif %}
<div class="first-news-body">
<span>{{ first_article.body_search_text|truncatechars:320 }}</span>
</div>
</a>
</div> </div>
{% else %} {% else %}
<span class="empty">目前沒有文章</span> <span class="empty">目前沒有文章</span>

View File

@ -1,22 +1,44 @@
{% load wagtailimages_tags static %} {% load wagtailimages_tags static %}
{% block extra_css %}
<link rel="stylesheet" type="text/css" href="{% static 'css/article_list.css' %}">
{% endblock %}
<div class="page-article-list"> <div class="page-article-list">
{% with category=category_sections.0 %}
<h2><a href="{{ category.url }}">{{ category.title }}</a></h2>
{% include "home/includes/article_list.html" with items=category.items %} {% include "home/includes/article_list.html" with items=category.items %}
{% if category.items.paginator.num_pages > 1 %} {% if category.items.paginator.num_pages > 1 %}
<div class="pagination"> <div class="pagination">
{% if category.items.has_previous %} {% if category.items.has_previous %}
<a href="?page={{ category.items.previous_page_number }}">上一頁</a> <a class="prev-page" href="?page={{ category.items.previous_page_number }}">
<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>
</a>
{% endif %} {% endif %}
<span>第 {{ category.items.number }} / {{ category.items.paginator.num_pages }} 頁</span> <div class="pagination-pages">
{% for page_num in category.page_range %}
{% if page_num == category.items.number %}
<span class="pagination-current">{{ page_num }}</span>
{% elif page_num == "…" %}
<span class="pagination-ellipsis">{{ page_num }}</span>
{% else %}
<a href="?page={{ page_num }}">{{ page_num }}</a>
{% endif %}
{% endfor %}
</div>
{% if category.items.has_next %} {% if category.items.has_next %}
<a href="?page={{ category.items.next_page_number }}">下一頁</a> <a class="next-page" href="?page={{ category.items.next_page_number }}">
<span>NEXT</span>
<button class="right-arrow" type="button" data-dir="right" aria-label="更多文章">
<svg class="right-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>
</a>
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
{% endwith %}
</div> </div>

View File

@ -35,6 +35,7 @@ def hashtag_search(request, slug):
"title": f"#{tag.name}", "title": f"#{tag.name}",
"items": page_obj, "items": page_obj,
"url": request.path, "url": request.path,
"page_range": paginator.get_elided_page_range(page_obj.number),
} }
], ],
"site_root": site_root, "site_root": site_root,

View File

@ -1,5 +1,11 @@
body {
color: #0e1b42;
font-size: 16px;
}
a { a {
text-decoration: none; text-decoration: none;
color: inherit;
} }
.site-container { .site-container {
@ -153,7 +159,6 @@ a {
display: inline-block; display: inline-block;
padding: 12px 4px; padding: 12px 4px;
font-variation-settings: normal; font-variation-settings: normal;
color: #0e1b42;
font-family: "Inter:Regular", "Noto Sans JP:Regular", sans-serif; font-family: "Inter:Regular", "Noto Sans JP:Regular", sans-serif;
word-break: break-word; word-break: break-word;
font-weight: 400; font-weight: 400;
@ -164,10 +169,6 @@ a {
--letter-spacing: 0px; --letter-spacing: 0px;
} }
.template-darkbackground .main-menu-link {
color: #ffffff;
}
.submenu { .submenu {
position: absolute; position: absolute;
top: 100%; top: 100%;
@ -219,7 +220,6 @@ a {
.submenu-item a { .submenu-item a {
display: block; display: block;
font-variation-settings: normal; font-variation-settings: normal;
color: #0e1b42;
font-family: "Inter:Regular", "Noto Sans JP:Regular", sans-serif; font-family: "Inter:Regular", "Noto Sans JP:Regular", sans-serif;
word-break: break-word; word-break: break-word;
font-weight: 400; font-weight: 400;
@ -231,10 +231,6 @@ a {
padding: 8px 16px; padding: 8px 16px;
} }
.template-darkbackground .submenu-item a {
color: #ffffff;
}
.submenu-item a:hover, .submenu-item a:hover,
.submenu-item a:focus { .submenu-item a:focus {
background: rgba(0, 0, 0, 0.05); background: rgba(0, 0, 0, 0.05);
@ -263,10 +259,6 @@ a {
color: #1b2140; color: #1b2140;
} }
.template-darkbackground .header-search .search-icon {
color: #ffffff;
}
.header-search .search-icon svg { .header-search .search-icon svg {
width: 28px; width: 28px;
height: 28px; height: 28px;
@ -360,7 +352,6 @@ footer .footer-links li {
footer .footer-links a { footer .footer-links a {
font-size: 14px; font-size: 14px;
color: #ffffff;
} }
footer .footer-divider { footer .footer-divider {
@ -378,6 +369,16 @@ footer .footer-sections {
flex-wrap: wrap; flex-wrap: wrap;
} }
.template-darkbackground .site-hero-band {
background-color: #0e1b42;
color: #ffffff;
}
.template-darkbackground .site-hero-band .block-title {
background-color: #ffffff;
color: #0e1b42;
}
@media (max-width: 1023px) { @media (max-width: 1023px) {
.site-container { .site-container {
max-width: 640px; max-width: 640px;
@ -426,8 +427,7 @@ footer .footer-sections {
} }
.site-header .site-container { .site-header .site-container {
padding: 0 44px; transform: translateX(-30px);
margin: 0;
} }
.main-menu { .main-menu {
@ -501,22 +501,12 @@ footer .footer-sections {
background: #0e1b42; background: #0e1b42;
} }
.main-menu-link {
color: #0e1b42;
}
.template-darkbackground .main-menu-link { .template-darkbackground .main-menu-link {
color: #ffffff;
font-size: 14px; font-size: 14px;
} }
.submenu-toggle { .submenu-toggle {
display: inline-flex; display: inline-flex;
color: #0e1b42;
}
.template-darkbackground .submenu-toggle {
color: #ffffff;
} }
.menu-divider { .menu-divider {
@ -561,13 +551,8 @@ footer .footer-sections {
.submenu-item a { .submenu-item a {
padding: 6px 0 6px 18px; padding: 6px 0 6px 18px;
color: #0e1b42;
font-size: 14px; font-size: 14px;
} }
.template-darkbackground .submenu-item a {
color: #ffffff;
}
} }
@media (max-width: 574px) { @media (max-width: 574px) {