Change view && setup category follow wiht details
This commit is contained in:
@@ -9,29 +9,41 @@
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
/ / 修改: 确保容器支持sticky定位 min-height: 100 vh;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 250px;
|
||||
padding-right: 20px;
|
||||
border-right: 1px solid #eee;
|
||||
/ / 修改: 添加侧边栏固定定位相关样式 position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 20px;
|
||||
align-self: flex-start;
|
||||
height: fit-content;
|
||||
}
|
||||
|
||||
.sidebar h3 {
|
||||
color: #333;
|
||||
border-bottom: 2px solid #007cba;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.sidebar ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sidebar ul li {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.sidebar ul li a {
|
||||
text-decoration: none;
|
||||
color: #666;
|
||||
@@ -40,14 +52,17 @@
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.sidebar ul li a:hover,
|
||||
.sidebar ul li a.active {
|
||||
background-color: #007cba;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.search-box input[type="text"] {
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
@@ -55,6 +70,7 @@
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.search-box input[type="submit"] {
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
@@ -65,35 +81,43 @@
|
||||
cursor: pointer;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.search-box input[type="submit"]:hover {
|
||||
background-color: #005a87;
|
||||
}
|
||||
|
||||
.search-type {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.search-type label {
|
||||
display: block;
|
||||
margin: 5px 0;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.search-type input[type="radio"] {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
flex: 1;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.main-content h1 {
|
||||
color: #333;
|
||||
border-bottom: 2px solid #eee;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.post-content img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
@@ -124,6 +148,7 @@
|
||||
border-radius: 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
@@ -147,7 +172,6 @@
|
||||
<div class="search-box">
|
||||
<form method="get" action="{% url 'index' %}">
|
||||
<input type="text" name="q" placeholder="搜索文章..." value="{{ query|default:'' }}">
|
||||
|
||||
<div class="search-type">
|
||||
<label>
|
||||
<input type="radio" name="search_type" value="all" checked>
|
||||
|
||||
@@ -9,29 +9,41 @@
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 250px;
|
||||
padding-right: 20px;
|
||||
border-right: 1px solid #eee;
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 20px;
|
||||
align-self: flex-start;
|
||||
height: fit-content;
|
||||
}
|
||||
|
||||
.sidebar h3 {
|
||||
color: #333;
|
||||
border-bottom: 2px solid #007cba;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.sidebar ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sidebar ul li {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.sidebar ul li a {
|
||||
text-decoration: none;
|
||||
color: #666;
|
||||
@@ -40,14 +52,17 @@
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.sidebar ul li a:hover,
|
||||
.sidebar ul li a.active {
|
||||
background-color: #007cba;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.search-box input[type="text"] {
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
@@ -55,6 +70,7 @@
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.search-box input[type="submit"] {
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
@@ -65,54 +81,67 @@
|
||||
cursor: pointer;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.search-box input[type="submit"]:hover {
|
||||
background-color: #005a87;
|
||||
}
|
||||
|
||||
.search-type {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.search-type label {
|
||||
display: block;
|
||||
margin: 5px 0;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.search-type input[type="radio"] {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
flex: 1;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.main-content h1 {
|
||||
color: #333;
|
||||
border-bottom: 2px solid #eee;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.posts-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.posts-list li {
|
||||
padding: 15px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.posts-list li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.post-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.post-title a {
|
||||
text-decoration: none;
|
||||
color: #007cba;
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.post-category {
|
||||
display: inline-block;
|
||||
background-color: #f0f0f0;
|
||||
@@ -121,11 +150,13 @@
|
||||
font-size: 12px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.post-summary {
|
||||
margin: 10px 0;
|
||||
line-height: 1.6;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
footer {
|
||||
}
|
||||
</style>
|
||||
@@ -144,15 +175,18 @@
|
||||
|
||||
<div class="search-type">
|
||||
<label>
|
||||
<input type="radio" name="search_type" value="all" {% if search_type != 'title' and search_type != 'content' %}checked{% endif %}>
|
||||
<input type="radio" name="search_type" value="all"
|
||||
{% if search_type != 'title' and search_type != 'content' %}checked{% endif %}>
|
||||
全文搜索
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="search_type" value="title" {% if search_type == 'title' %}checked{% endif %}>
|
||||
<input type="radio" name="search_type" value="title"
|
||||
{% if search_type == 'title' %}checked{% endif %}>
|
||||
标题搜索
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="search_type" value="content" {% if search_type == 'content' %}checked{% endif %}>
|
||||
<input type="radio" name="search_type" value="content"
|
||||
{% if search_type == 'content' %}checked{% endif %}>
|
||||
内容搜索
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user