Staging deploy 2026/1/21 #2
@ -19,8 +19,8 @@ def _get_env_int(name, default):
|
||||
return default
|
||||
|
||||
NEWS_SIZE = _get_env_int("HOMEPAGE_NEWS_SIZE", 8) # Default to 8 articles in news layouts
|
||||
BLOCK_SIZE = _get_env_int("HOMEPAGE_BLOCK_SIZE", 5) # Default to 5 articles in block layout
|
||||
HORIZON_SIZE = _get_env_int("HOMEPAGE_HORIZON_SIZE", 4) # Default to 8 articles in horizon 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
|
||||
PAGE_SIZE = _get_env_int("HOMEPAGE_PAGE_SIZE", 10) # Default to 10 articles per page for pagination
|
||||
|
||||
# Mixin for Category-related functionality
|
||||
@ -37,9 +37,9 @@ class CategoryMixin:
|
||||
"title": category.title,
|
||||
"items": ArticlePage.objects.child_of(category)
|
||||
.live()
|
||||
.order_by("-date", "-id")[:HORIZON_SIZE],
|
||||
.order_by("-date", "-id")[:BLOCK_SIZE],
|
||||
"url": category.url,
|
||||
"layout": "horizon",
|
||||
"layout": "block",
|
||||
}
|
||||
)
|
||||
else:
|
||||
@ -224,9 +224,9 @@ class CategoryPage(Page, CategoryMixin):
|
||||
def get_context(self, request):
|
||||
context = super().get_context(request)
|
||||
context["category_sections"] = self.build_category_blocks(request)
|
||||
breadcrumbs, site_root = self.build_breadcrumbs()
|
||||
context["breadcrumbs"] = breadcrumbs
|
||||
context["breadcrumb_root"] = site_root
|
||||
# breadcrumbs, site_root = self.build_breadcrumbs()
|
||||
# context["breadcrumbs"] = breadcrumbs
|
||||
# context["breadcrumb_root"] = site_root
|
||||
return context
|
||||
|
||||
|
||||
|
||||
@ -2,78 +2,299 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.block-list-arrow {
|
||||
.block-first-article {
|
||||
display: grid;
|
||||
grid-template-columns: 480px 1fr;
|
||||
grid-template-areas:
|
||||
"image content";
|
||||
gap: 16px 40px;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-image {
|
||||
grid-area: image;
|
||||
position: relative;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
width: 480px;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-image img{
|
||||
display: block;
|
||||
width:480px;
|
||||
height:293px;
|
||||
object-fit:cover;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-content {
|
||||
grid-area: content;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-height: 293px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-title {
|
||||
font-size: 40px;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
margin: 0;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-date {
|
||||
color: #0e1b4266;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-intro {
|
||||
font-size: 20px;
|
||||
flex: 0 1 auto;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-body {
|
||||
flex: 1 2 auto;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-content::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: 0;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.block-list-arrow[data-dir="left"] {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.block-list-arrow[data-dir="right"] {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.block-list-arrow.is-hidden {
|
||||
opacity: 0;
|
||||
bottom: 0;
|
||||
height: 100px;
|
||||
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.block-list {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
gap: 20px;
|
||||
overflow-x: auto;
|
||||
scroll-snap-type: x mandatory;
|
||||
list-style: none;
|
||||
.block-list-lower {
|
||||
margin: 24px 0;
|
||||
padding: 12px 48px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: stretch;
|
||||
gap: 28px;
|
||||
}
|
||||
|
||||
.block-list li {
|
||||
flex: 0 0 200px;
|
||||
overflow: hidden;
|
||||
scroll-snap-align: start;
|
||||
.block-list-items {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.block-list li a {
|
||||
.block-list-items a {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
color: inherit;
|
||||
width: 200px;
|
||||
text-decoration: none;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.block-list li img {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
/* object-fit: contain; */
|
||||
.block-list-thumb {
|
||||
position: relative;
|
||||
width: 194px;
|
||||
height: 133px;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.block-list-thumb img {
|
||||
display: block;
|
||||
/* background: #f5f5f5; */
|
||||
/* border-radius: 8px; */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.block-list li a:hover,
|
||||
.block-list li a:focus {
|
||||
transform: translateY(-2px);
|
||||
.block-list-items a span{
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.block-list .empty {
|
||||
flex: 1 0 auto;
|
||||
.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;
|
||||
padding: 24px;
|
||||
color: #666;
|
||||
background: #fafafa;
|
||||
border: 1px dashed #ddd;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.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) {
|
||||
.block-first-article {
|
||||
grid-template-columns: 318px 1fr;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-image {
|
||||
width: 318px;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-image img{
|
||||
width:318px;
|
||||
height:290px;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-title {
|
||||
font-size: 36px;
|
||||
}
|
||||
|
||||
.block-list-lower {
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.block-list-more-article {
|
||||
max-width: 200px;
|
||||
flex: 1 1 200px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.block-first-article {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-areas:
|
||||
"image"
|
||||
"content";
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 575px) and (max-width: 767px) {
|
||||
.block-first-article .first-article-image {
|
||||
width: 426px;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-image img{
|
||||
width:426px;
|
||||
height:260px;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-title {
|
||||
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) {
|
||||
.block-first-article .first-article-image {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-image img{
|
||||
width: 300px;
|
||||
height: 220px;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-title {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.block-first-article .first-article-intro {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
70
innovedus_cms/home/static/css/category.css
Normal file
70
innovedus_cms/home/static/css/category.css
Normal file
@ -0,0 +1,70 @@
|
||||
.block-title {
|
||||
display: inline-block;
|
||||
width: 197px;
|
||||
height: 87px;
|
||||
vertical-align: middle;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.block-title span {
|
||||
padding-left: 21px;
|
||||
line-height: 87px;
|
||||
}
|
||||
|
||||
.category-title {
|
||||
background-color: #00abf5;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.subcategory-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 24px 0;
|
||||
color: #0e1b42;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.subcategory-title::before,
|
||||
.subcategory-title::after {
|
||||
content: "";
|
||||
flex: 1 1 auto;
|
||||
height: 1px;
|
||||
background: #0e1b42;
|
||||
}
|
||||
|
||||
.subcategory-title span {
|
||||
display: inline-block;
|
||||
width: 190px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border: 1px solid #0e1b42;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.subcategory-title::after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 574px) {
|
||||
.block-title {
|
||||
width: 139px;
|
||||
height: 55px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.block-title span {
|
||||
padding-left: 14px;
|
||||
line-height: 55px;
|
||||
}
|
||||
|
||||
.subcategory-title span {
|
||||
width: 139px;
|
||||
height: 55px;
|
||||
line-height: 55px;
|
||||
}
|
||||
}
|
||||
@ -8,41 +8,12 @@
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.template-homepage .site-header {
|
||||
background-color: #0e1b42;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.template-homepage .main-menu-link {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.template-homepage .header-search .search-input {
|
||||
/* border-color: #ffffff; */
|
||||
background-color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.template-homepage .header-search .search-icon {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.template-homepage .header-search input[type="search"] {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.home-banner img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.home-banner {
|
||||
width: 100vw;
|
||||
margin-left: calc(50% - 50vw);
|
||||
}
|
||||
}
|
||||
|
||||
.list-title {
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
@ -78,7 +49,7 @@
|
||||
color: #00abf5;
|
||||
}
|
||||
|
||||
.section-b .list-title .category_title {
|
||||
.section-b .list-title .category-title {
|
||||
background-color: #00abf5;
|
||||
color: #ffffff;
|
||||
}
|
||||
@ -91,7 +62,7 @@
|
||||
color: #f4a41c;
|
||||
}
|
||||
|
||||
.section-o .list-title .category_title {
|
||||
.section-o .list-title .category-title {
|
||||
background-color: #f4a41c;
|
||||
color: #ffffff;
|
||||
}
|
||||
@ -101,11 +72,18 @@
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1023px) {
|
||||
.list-title .category_title {
|
||||
.list-title .category-title {
|
||||
width: 142px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.home-banner {
|
||||
width: 100vw;
|
||||
margin-left: calc(50% - 50vw);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 574px) {
|
||||
.block-title {
|
||||
width: 139px;
|
||||
@ -127,4 +105,4 @@
|
||||
.more-link {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@
|
||||
|
||||
.horizontal-list-thumb {
|
||||
width: 139px;
|
||||
height: 114px;
|
||||
height: 110px;
|
||||
}
|
||||
|
||||
.section-b .horizontal-list-thumb::after {
|
||||
@ -222,10 +222,6 @@
|
||||
flex: 0 0 142px;
|
||||
}
|
||||
|
||||
/* .horizontal-list .article-title {
|
||||
width: 142px;
|
||||
} */
|
||||
|
||||
.horizontal-list .article-title {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
@ -188,7 +188,42 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1023px) {
|
||||
.news-hero {
|
||||
grid-template-columns: 318px 1fr;
|
||||
}
|
||||
|
||||
.news-hero .fist-news-title {
|
||||
max-width: 320px;
|
||||
}
|
||||
|
||||
.news-hero .first-news-image {
|
||||
width: 318px;
|
||||
}
|
||||
|
||||
.news-hero .first-news-image::after {
|
||||
background-size: 318px 25px;
|
||||
}
|
||||
|
||||
.news-hero .first-news-image img {
|
||||
width: 318px;
|
||||
height: 290px;
|
||||
}
|
||||
|
||||
.news-hero .first-news-content {
|
||||
height: 290px;
|
||||
}
|
||||
|
||||
.news-list-lower {
|
||||
gap: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 575px) and (max-width: 1023px) {
|
||||
.news-hero .fist-news-title {
|
||||
font-size: 36px;
|
||||
}
|
||||
|
||||
.more-news {
|
||||
display: grid;
|
||||
grid-template-columns: 200px 1fr 1fr;
|
||||
@ -314,43 +349,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 1023px) {
|
||||
.news-hero {
|
||||
grid-template-columns: 318px 1fr;
|
||||
}
|
||||
|
||||
.news-hero .fist-news-title {
|
||||
max-width: 320px;
|
||||
}
|
||||
|
||||
.news-hero .first-news-image {
|
||||
width: 318px;
|
||||
}
|
||||
|
||||
.news-hero .first-news-image::after {
|
||||
background-size: 318px 25px;
|
||||
}
|
||||
|
||||
.news-hero .first-news-image img {
|
||||
width: 318px;
|
||||
height: 290px;
|
||||
}
|
||||
|
||||
.news-hero .first-news-content {
|
||||
height: 290px;
|
||||
}
|
||||
|
||||
.news-list-lower {
|
||||
gap: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 575px) and (max-width: 1023px) {
|
||||
.news-hero .fist-news-title {
|
||||
font-size: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 574px) {
|
||||
.news-hero .first-news-image {
|
||||
width: 300px;
|
||||
@ -368,9 +366,6 @@
|
||||
height: 220px;
|
||||
}
|
||||
|
||||
/* .news-hero .first-news-content {
|
||||
height: 220px;
|
||||
} */
|
||||
|
||||
.news-hero .fist-news-title {
|
||||
font-size: 24px;
|
||||
@ -388,9 +383,6 @@
|
||||
width: 142px;
|
||||
}
|
||||
|
||||
/* .news-list-lower {
|
||||
justify-content: center;
|
||||
} */
|
||||
.news-list-thumb {
|
||||
width: 139px;
|
||||
height: 110px;
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
{% extends "base.html" %}
|
||||
{% load wagtailcore_tags %}
|
||||
{% load wagtailcore_tags static %}
|
||||
{% block extra_css %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/category.css' %}">
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{# Breadcrumbs navigation may not used anymore #}
|
||||
{% if breadcrumbs %}
|
||||
<nav class="breadcrumbs" aria-label="breadcrumb">
|
||||
<ol>
|
||||
@ -21,9 +25,11 @@
|
||||
</ol>
|
||||
</nav>
|
||||
{% endif %}
|
||||
<div class="block-title category-title"><span>{{ self.title}}</span></div>
|
||||
{% if page.has_subcategories %}
|
||||
{% for section in category_sections %}
|
||||
{% include "home/includes/category_session.html" with section=section %}
|
||||
<div class="subcategory-title"><span>{{ section.title }}</span></div>
|
||||
{% include "home/includes/block_list.html" with items=section.items %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% include "home/includes/page-article-list.html" with category=category_sections.0 %}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% block body_class %}template-homepage{% endblock %}
|
||||
{% block body_class %}template-darkbackground{% endblock %}
|
||||
{% block extra_css %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/home.css' %}">
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/news_list.css' %}">
|
||||
|
||||
@ -1,23 +1,74 @@
|
||||
{% load wagtailimages_tags static %}
|
||||
{% block extra_css %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/block_list.css' %}">
|
||||
{% endblock %}
|
||||
|
||||
<div class="block-list-wrap" data-block-list>
|
||||
<button class="block-list-arrow" type="button" data-dir="left" aria-label="上一頁">‹</button>
|
||||
<ul class="block-list">
|
||||
{% for article in items %}
|
||||
<li>
|
||||
<a href="{{ article.url }}">
|
||||
{% if article.cover_image %}
|
||||
{% image article.cover_image max-200x200 as cover %}
|
||||
<img src="{{ cover.url }}" alt="{{ article.title }}" height="200" width="200" style="width:200px;height:200px;object-fit:contain;display:block;"/>
|
||||
{% else %}
|
||||
<img src="{% static 'img/default_cover.jpg' %}" alt="{{ article.title }}" height="200" width="200" style="width:200px;height:200px;object-fit:contain;display:block;"/>
|
||||
{% with first_article=items|first %}
|
||||
{% if first_article %}
|
||||
<div class="block-first-article">
|
||||
<div class="first-article-image">
|
||||
<a href="{{ first_article.url }}">
|
||||
{% if first_article.cover_image %}
|
||||
{% image first_article.cover_image max-480x293 as cover %}
|
||||
<img src="{{ cover.url }}" alt="{{ first_article.title }}"/>
|
||||
{% else %}
|
||||
<img src="{% static 'img/default_cover.jpg' %}" alt="{{ first_article.title }}"/>
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
<div class="first-article-content">
|
||||
<div class="first-article-title">
|
||||
<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 %}
|
||||
{{ article.title }}
|
||||
<div class="first-article-body">
|
||||
<span>{{ first_article.body_search_text|truncatechars:200 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<span class="empty">目前沒有文章</span>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
{% if items|length >= 2 %}
|
||||
<!-- <div class="list-title">
|
||||
<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>
|
||||
</li>
|
||||
{% empty %}
|
||||
<li class="empty">目前沒有文章</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<button class="block-list-arrow" type="button" data-dir="right" aria-label="下一頁">›</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
<section class="article-section article-section--{{ section.layout }} {{ section_color }}">
|
||||
<div class="list-title {{ title_variant }}">
|
||||
<div class="block-title category_title"><span>{{ section.title }}</span></div>
|
||||
<div class="block-title category-title"><span>{{ section.title }}</span></div>
|
||||
<span class="block-title-divider" aria-hidden="true">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" height="100%" overflow="visible" preserveAspectRatio="none" viewBox="0 0 28 1" width="100%">
|
||||
<line stroke="currentColor" x2="28" y1="0.5" y2="0.5"/>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
<div class="first-news-image">
|
||||
<a href="{{ first_article.url }}">
|
||||
{% if first_article.cover_image %}
|
||||
{% image first_article.cover_image max-480x320 as cover %}
|
||||
{% image first_article.cover_image max-480x293 as cover %}
|
||||
<img src="{{ cover.url }}" alt="{{ first_article.title }}" height="293" width="480"/>
|
||||
{% else %}
|
||||
<img src="{% static 'img/default_cover.jpg' %}" alt="{{ first_article.title }}" height="293" width="480"/>
|
||||
|
||||
@ -231,9 +231,11 @@ WAGTAILADMIN_BASE_URL = "http://example.com"
|
||||
WAGTAILDOCS_EXTENSIONS = ['csv', 'docx', 'key', 'odt', 'pdf', 'pptx', 'rtf', 'txt', 'xlsx', 'zip']
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = env_list(
|
||||
"CSRF_TRUSTED_ORIGINS"
|
||||
"CSRF_TRUSTED_ORIGINS",
|
||||
default=[]
|
||||
)
|
||||
|
||||
ALLOWED_HOSTS = env_list(
|
||||
"ALLOWED_HOSTS"
|
||||
"ALLOWED_HOSTS",
|
||||
default=[]
|
||||
)
|
||||
|
||||
@ -18,6 +18,11 @@ a {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.template-darkbackground .site-header {
|
||||
background-color: #0e1b42;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.header-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -38,11 +43,11 @@ a {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.template-homepage .logo--light {
|
||||
.template-darkbackground .logo--light {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.template-homepage .logo--dark {
|
||||
.template-darkbackground .logo--dark {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@ -159,6 +164,10 @@ a {
|
||||
--letter-spacing: 0px;
|
||||
}
|
||||
|
||||
.template-darkbackground .main-menu-link {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.submenu {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
@ -166,14 +175,9 @@ a {
|
||||
transform: translateX(-50%);
|
||||
margin-top: -2px;
|
||||
margin-left: 20px;
|
||||
/* min-width: 220px; */
|
||||
list-style: none;
|
||||
padding-inline-start: 0;
|
||||
/* padding: 14px 0; */
|
||||
/* background: #fff; */
|
||||
/* border-radius: 16px; */
|
||||
/* box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18); */
|
||||
border-bottom: #ffffff;
|
||||
border-bottom: #0e1b42;
|
||||
border-style: solid;
|
||||
border-width: 0 0 1px 0;
|
||||
opacity: 0;
|
||||
@ -182,6 +186,10 @@ a {
|
||||
transition: opacity 160ms ease, transform 160ms ease;
|
||||
}
|
||||
|
||||
.template-darkbackground .submenu {
|
||||
border-bottom: #ffffff;
|
||||
}
|
||||
|
||||
.menu-item:hover .submenu,
|
||||
.menu-item:focus-within .submenu {
|
||||
opacity: 1;
|
||||
@ -193,20 +201,23 @@ a {
|
||||
.submenu-item {
|
||||
min-width: 94px;
|
||||
height: 36px;
|
||||
/* padding: 8px 16px; */
|
||||
border: #0e1b42;
|
||||
border-style: solid;
|
||||
border-width: 1px 1px 0 1px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.template-darkbackground .submenu-item {
|
||||
border: #ffffff;
|
||||
border-style: solid;
|
||||
border-width: 1px 1px 0 1px;
|
||||
background-color: #0e1b42;
|
||||
/* line-height: 36px; */
|
||||
/* vertical-align: middle; */
|
||||
/* align-items: center; */
|
||||
}
|
||||
|
||||
.submenu-item a {
|
||||
display: block;
|
||||
font-variation-settings: normal;
|
||||
color: #ffffff;
|
||||
color: #0e1b42;
|
||||
font-family: "Inter:Regular", "Noto Sans JP:Regular", sans-serif;
|
||||
word-break: break-word;
|
||||
font-weight: 400;
|
||||
@ -218,6 +229,10 @@ a {
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
||||
.template-darkbackground .submenu-item a {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.submenu-item a:hover,
|
||||
.submenu-item a:focus {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
@ -227,9 +242,6 @@ a {
|
||||
.header-search .search-input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* border-style: solid; */
|
||||
/* border-color: #0e1b42; */
|
||||
/* border-width: 1px; */
|
||||
}
|
||||
|
||||
.header-search {
|
||||
@ -246,7 +258,11 @@ a {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
color: #1b2140; /* icon 顏色 */
|
||||
color: #1b2140;
|
||||
}
|
||||
|
||||
.template-darkbackground .header-search .search-icon {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.header-search .search-icon svg {
|
||||
@ -254,212 +270,27 @@ a {
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.header-search .search-input {
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.template-darkbackground .header-search .search-input {
|
||||
background-color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.header-search input[type="search"] {
|
||||
border: 0;
|
||||
background: transparent;
|
||||
outline: none;
|
||||
/* color: rgba(0, 0, 0, 0.3); */
|
||||
width: 181px; /* 依需要調 */
|
||||
width: 181px;
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) {
|
||||
.site-container {
|
||||
max-width: 640px;
|
||||
}
|
||||
|
||||
.header-search input[type="search"] {
|
||||
width: 90px;
|
||||
}
|
||||
.template-darkbackground .header-search input[type="search"] {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
@media (min-width: 575px) and (max-width: 767px) {
|
||||
.site-container {
|
||||
max-width: 426px;
|
||||
}
|
||||
|
||||
.site-header .site-container {
|
||||
padding: 0 44px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.main-menu {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.header-search input[type="search"] {
|
||||
width: 163px;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
right: -28px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.site-header .site-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header-inner {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
position: absolute;
|
||||
/* top: 100%; */
|
||||
width: 220px;
|
||||
display: none;
|
||||
padding: 16px 0;
|
||||
background: #0e1b42;
|
||||
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.main-nav.is-open {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.main-menu {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
width: 220px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
flex: 0 0 auto;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.menu-item-header {
|
||||
width: 192px;
|
||||
}
|
||||
|
||||
.menu-toggle {
|
||||
display: flex;
|
||||
margin-left: 12px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.template-homepage .menu-toggle {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.template-homepage .main-nav {
|
||||
background: #0e1b42;
|
||||
}
|
||||
|
||||
.main-menu-link {
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.submenu-toggle {
|
||||
display: inline-flex;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.menu-divider {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
width: 92px;
|
||||
}
|
||||
|
||||
.menu-item.is-open .menu-divider {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.submenu {
|
||||
position: static;
|
||||
/* transform: none; */
|
||||
margin: 8px 0 0;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
pointer-events: auto;
|
||||
display: none;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* .menu-item:focus-within .submenu {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
pointer-events: auto;
|
||||
transform: translateX(-50%) translateY(2px);
|
||||
} */
|
||||
|
||||
.menu-item.is-open .submenu {
|
||||
display: block;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.submenu-item {
|
||||
background: none;
|
||||
border: 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.submenu-item a {
|
||||
padding: 6px 0 6px 18px;
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 574px) {
|
||||
.site-container {
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
/* .header-inner {
|
||||
padding: 16px 0;
|
||||
} */
|
||||
|
||||
.header-inner {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.header-search {
|
||||
width: 100%;
|
||||
order: 3;
|
||||
margin-left: 0;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.header-search input[type="search"] {
|
||||
width: 195px;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
right: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@layer figreset {
|
||||
:root {
|
||||
font-family: var( --default-font-family,ui-sans-serif,system-ui,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji' )
|
||||
}
|
||||
|
||||
html {
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
body: has([data-page-overflowx='hidden']) {
|
||||
overflow-x:hidden
|
||||
}
|
||||
|
||||
body: has([data-page-overflowx='auto']) {
|
||||
overflow-x:auto
|
||||
}
|
||||
.template-darkbackground .header-search input[type="search"]::placeholder {
|
||||
color: #ffffff88;
|
||||
}
|
||||
|
||||
footer {
|
||||
@ -497,7 +328,6 @@ footer .copyright p {
|
||||
|
||||
.footer-socials {
|
||||
display: flex;
|
||||
/* justify-content: center; */
|
||||
gap: 12px;
|
||||
margin: 16px 0;
|
||||
flex-wrap: wrap;
|
||||
@ -546,6 +376,16 @@ footer .footer-sections {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) {
|
||||
.site-container {
|
||||
max-width: 640px;
|
||||
}
|
||||
|
||||
.header-search input[type="search"] {
|
||||
width: 90px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.footer-inner {
|
||||
flex-direction: column;
|
||||
@ -577,3 +417,200 @@ footer .footer-sections {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 575px) and (max-width: 767px) {
|
||||
.site-container {
|
||||
max-width: 426px;
|
||||
}
|
||||
|
||||
.site-header .site-container {
|
||||
padding: 0 44px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.main-menu {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.header-search input[type="search"] {
|
||||
width: 163px;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
right: -28px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.site-header .site-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header-inner {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
position: absolute;
|
||||
width: 220px;
|
||||
display: none;
|
||||
padding: 16px 0;
|
||||
background: #0e1b42;
|
||||
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.main-nav.is-open {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.main-menu {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
width: 220px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
flex: 0 0 auto;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.menu-item-header {
|
||||
width: 192px;
|
||||
}
|
||||
|
||||
.menu-toggle {
|
||||
display: flex;
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.template-darkbackground .menu-toggle {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.template-darkbackground .main-nav {
|
||||
background: #0e1b42;
|
||||
}
|
||||
|
||||
.main-menu-link {
|
||||
color: #0e1b42;
|
||||
}
|
||||
|
||||
.template-darkbackground .main-menu-link {
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.submenu-toggle {
|
||||
display: inline-flex;
|
||||
color: #0e1b42;
|
||||
}
|
||||
|
||||
.template-darkbackground .submenu-toggle {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.menu-divider {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
width: 92px;
|
||||
}
|
||||
|
||||
.menu-item.is-open .menu-divider {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.submenu {
|
||||
position: static;
|
||||
margin: 8px 0 0;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
pointer-events: auto;
|
||||
display: none;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.menu-item.is-open .submenu {
|
||||
display: block;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.submenu-item {
|
||||
background: none;
|
||||
border: 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.template-darkbackground .submenu-item {
|
||||
border: 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.submenu-item a {
|
||||
padding: 6px 0 6px 18px;
|
||||
color: #0e1b42;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.template-darkbackground .submenu-item a {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 574px) {
|
||||
.site-container {
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.header-inner {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.header-search {
|
||||
width: 100%;
|
||||
order: 3;
|
||||
margin-left: 0;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.header-search input[type="search"] {
|
||||
width: 195px;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
right: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@layer figreset {
|
||||
:root {
|
||||
font-family: var( --default-font-family,ui-sans-serif,system-ui,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji' )
|
||||
}
|
||||
|
||||
html {
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%
|
||||
}
|
||||
|
||||
body: has([data-page-overflowx='hidden']) {
|
||||
overflow-x:hidden
|
||||
}
|
||||
|
||||
body: has([data-page-overflowx='auto']) {
|
||||
overflow-x:auto
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user