From 55d873c450fcb3260a7969891d3e1a4fb0526ff1b9a02c0b517869b3d3ec1264 Mon Sep 17 00:00:00 2001 From: yuangyaa Date: Sun, 27 Jul 2025 23:12:12 +0800 Subject: [PATCH 1/2] Change view && setup category follow wiht details --- myblog/blog/templates/blog/detail.html | 34 +++++++++++++++--- myblog/blog/templates/blog/index.html | 50 +++++++++++++++++++++----- 2 files changed, 71 insertions(+), 13 deletions(-) diff --git a/myblog/blog/templates/blog/detail.html b/myblog/blog/templates/blog/detail.html index aa2796b..6346848 100644 --- a/myblog/blog/templates/blog/detail.html +++ b/myblog/blog/templates/blog/detail.html @@ -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 @@ - +

文章分类

- +

{{ post.title }}

- +
    {% for post in posts %} From 060388afe48059b87f1226f7840d5aa89118bd4dc04b0e35668de43054c4c929 Mon Sep 17 00:00:00 2001 From: yuangyaa Date: Sun, 27 Jul 2025 23:14:25 +0800 Subject: [PATCH 2/2] Updata python packages --- myblog/requirements.txt | 31 ------------------------------- requirements.txt | 6 +++--- 2 files changed, 3 insertions(+), 34 deletions(-) delete mode 100644 myblog/requirements.txt diff --git a/myblog/requirements.txt b/myblog/requirements.txt deleted file mode 100644 index 0e8fdbd..0000000 --- a/myblog/requirements.txt +++ /dev/null @@ -1,31 +0,0 @@ -asgiref==3.9.1 -asttokens==3.0.0 -click==8.2.1 -configparser==7.2.0 -decorator==5.2.1 -executing==2.2.0 -h11==0.16.0 -ipython==9.4.0 -ipython_pygments_lexers==1.1.1 -jedi==0.19.2 -matplotlib-inline==0.1.7 -numpy==2.3.2 -packaging==25.0 -pandas==2.3.1 -parso==0.8.4 -pexpect==4.9.0 -prompt_toolkit==3.0.51 -psutil==7.0.0 -ptyprocess==0.7.0 -pure_eval==0.2.3 -Pygments==2.19.2 -python-dateutil==2.9.0.post0 -pytz==2025.2 -six==1.17.0 -sqlparse==0.5.3 -stack-data==0.6.3 -traitlets==5.14.3 -tzdata==2025.2 -uv==0.8.3 -uvicorn==0.35.0 -wcwidth==0.2.13 diff --git a/requirements.txt b/requirements.txt index 1c810f4..51bb383 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,9 +5,9 @@ certifi==2025.7.14 charset-normalizer==3.4.2 click==8.2.1 decorator==5.2.1 -Django==5.2.4 +Django==5.1 django-mdeditor==0.1.20 -django-summernote==0.8.20.0 +emoji==2.14.1 executing==2.2.0 gunicorn==23.0.0 h11==0.16.0 @@ -15,7 +15,7 @@ idna==3.10 ipython==9.4.0 ipython_pygments_lexers==1.1.1 jedi==0.19.2 -Markdown +Markdown==3.5.2 martor==1.6.45 matplotlib-inline==0.1.7 numpy==2.3.2