Compare commits
No commits in common. "3de1c033c549d8868a8a9d2e2329137893b17dc9" and "8c4ce7b92ef6a88b447cb95169f5fb3802bb91db" have entirely different histories.
3de1c033c5
...
8c4ce7b92e
@ -63,7 +63,7 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
column-count: 2;
|
column-count: 2;
|
||||||
column-gap: 28px;
|
column-gap: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-menu-list li {
|
.footer-menu-list li {
|
||||||
|
|||||||
@ -75,15 +75,10 @@ a {
|
|||||||
|
|
||||||
.menu-item {
|
.menu-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
flex: 0 0 auto;
|
flex: 1 1 0;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-item:hover,
|
|
||||||
.menu-item:focus-within {
|
|
||||||
z-index: 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-item-header {
|
.menu-item-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -177,13 +172,10 @@ a {
|
|||||||
.submenu {
|
.submenu {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
left: 0;
|
left: 50%;
|
||||||
width: max-content;
|
transform: translateX(-50%);
|
||||||
min-width: 100%;
|
|
||||||
max-width: calc(100vw - 32px);
|
|
||||||
transform: none;
|
|
||||||
margin-top: -2px;
|
margin-top: -2px;
|
||||||
margin-left: 10px;
|
margin-left: 20px;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding-inline-start: 0;
|
padding-inline-start: 0;
|
||||||
border-bottom: #0e1b42;
|
border-bottom: #0e1b42;
|
||||||
@ -192,7 +184,6 @@ a {
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: 20;
|
|
||||||
transition: opacity 160ms ease, transform 160ms ease;
|
transition: opacity 160ms ease, transform 160ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,11 +198,11 @@ a {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
transform: translateY(2px);
|
transform: translateX(-50%) translateY(2px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.submenu-item {
|
.submenu-item {
|
||||||
min-width: 0;
|
min-width: 94px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
border: #0e1b42;
|
border: #0e1b42;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
@ -230,8 +221,7 @@ a {
|
|||||||
display: block;
|
display: block;
|
||||||
font-variation-settings: normal;
|
font-variation-settings: normal;
|
||||||
font-family: "Inter:Regular", "Noto Sans JP:Regular", sans-serif;
|
font-family: "Inter:Regular", "Noto Sans JP:Regular", sans-serif;
|
||||||
white-space: nowrap;
|
word-break: break-word;
|
||||||
word-break: keep-all;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@ -286,7 +276,7 @@ a {
|
|||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
outline: none;
|
outline: none;
|
||||||
width: 140px;
|
width: 153px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.template-darkbackground .header-search input[type="search"] {
|
.template-darkbackground .header-search input[type="search"] {
|
||||||
@ -339,19 +329,7 @@ a {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) and (max-width: 1023px) {
|
@media (max-width: 768px) {
|
||||||
.main-nav {
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-menu {
|
|
||||||
flex-wrap: wrap;
|
|
||||||
row-gap: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-menu-link {
|
|
||||||
padding: 4px 4px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 575px) and (max-width: 767px) {
|
@media (min-width: 575px) and (max-width: 767px) {
|
||||||
@ -454,8 +432,6 @@ a {
|
|||||||
|
|
||||||
.submenu {
|
.submenu {
|
||||||
position: static;
|
position: static;
|
||||||
min-width: 0;
|
|
||||||
max-width: none;
|
|
||||||
margin: 8px 0 0;
|
margin: 8px 0 0;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
@ -487,8 +463,6 @@ a {
|
|||||||
.submenu-item a {
|
.submenu-item a {
|
||||||
padding: 6px 0 6px 18px;
|
padding: 6px 0 6px 18px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
white-space: normal;
|
|
||||||
word-break: break-word;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@
|
|||||||
padding: 0 10px 0 0;
|
padding: 0 10px 0 0;
|
||||||
border-radius: 36px;
|
border-radius: 36px;
|
||||||
background: #ffffff1a;
|
background: #ffffff1a;
|
||||||
border: 1px solid #0e1b0e;
|
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);
|
backdrop-filter: blur(12px);
|
||||||
|
|||||||
@ -11,7 +11,6 @@ from search import views as search_views
|
|||||||
from home.feeds import LatestArticlesFeed
|
from home.feeds import LatestArticlesFeed
|
||||||
from home import views as home_views
|
from home import views as home_views
|
||||||
from base import views as base_views
|
from base import views as base_views
|
||||||
from mysite import views as mysite_views
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("django-admin/", admin.site.urls),
|
path("django-admin/", admin.site.urls),
|
||||||
@ -19,7 +18,6 @@ urlpatterns = [
|
|||||||
path("documents/", include(wagtaildocs_urls)),
|
path("documents/", include(wagtaildocs_urls)),
|
||||||
path("feed.xml", LatestArticlesFeed(), name="article_feed"),
|
path("feed.xml", LatestArticlesFeed(), name="article_feed"),
|
||||||
path("sitemap.xml", sitemap, name="sitemap"),
|
path("sitemap.xml", sitemap, name="sitemap"),
|
||||||
path("media/<path:path>", mysite_views.media_proxy, name="media_proxy"),
|
|
||||||
path("health", base_views.health_check, name="health_check"),
|
path("health", base_views.health_check, name="health_check"),
|
||||||
# use <str:slug> so Unicode tag slugs (e.g. 台北美食) still resolve
|
# use <str:slug> so Unicode tag slugs (e.g. 台北美食) still resolve
|
||||||
path("tags/<str:slug>/", home_views.hashtag_search, name="hashtag_search"),
|
path("tags/<str:slug>/", home_views.hashtag_search, name="hashtag_search"),
|
||||||
|
|||||||
@ -1,25 +0,0 @@
|
|||||||
import mimetypes
|
|
||||||
import posixpath
|
|
||||||
|
|
||||||
from django.core.exceptions import SuspiciousFileOperation
|
|
||||||
from django.core.files.storage import default_storage
|
|
||||||
from django.http import FileResponse, Http404
|
|
||||||
|
|
||||||
|
|
||||||
def media_proxy(request, path):
|
|
||||||
normalized_path = posixpath.normpath(path).lstrip("/")
|
|
||||||
if (
|
|
||||||
not normalized_path
|
|
||||||
or normalized_path == "."
|
|
||||||
or normalized_path.startswith("../")
|
|
||||||
or path.startswith("/")
|
|
||||||
):
|
|
||||||
raise SuspiciousFileOperation("Invalid media path")
|
|
||||||
|
|
||||||
try:
|
|
||||||
file_obj = default_storage.open(normalized_path, "rb")
|
|
||||||
except FileNotFoundError as exc:
|
|
||||||
raise Http404("Media file not found") from exc
|
|
||||||
|
|
||||||
content_type, _ = mimetypes.guess_type(normalized_path)
|
|
||||||
return FileResponse(file_obj, content_type=content_type)
|
|
||||||
Loading…
x
Reference in New Issue
Block a user