Compare commits

..

4 Commits

Author SHA256 Message Date
479f59f0f3 add update_time 2025-07-26 21:25:53 +08:00
bbc3fcef08 change blog title into left 2025-07-26 21:11:03 +08:00
a32cd6aadd fix 'change the push_date into right' 2025-07-26 21:06:24 +08:00
8401704aa6 fix 'change return_home to right' 2025-07-26 20:50:45 +08:00
9 changed files with 81 additions and 12 deletions

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

30
.idea/blog.iml generated Normal file
View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$/myblog" />
<option name="settingsModule" value="myblog/settings.py" />
<option name="manageScript" value="$MODULE_DIR$/myblog/manage.py" />
<option name="environment" value="&lt;map/&gt;" />
<option name="doNotUseTestRunner" value="false" />
<option name="trackFilePattern" value="migrations" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/myblog" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.12 (blog) (2)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Django" />
</component>
</module>

View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

7
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.12 (blog) (2)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (blog) (2)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/blog.iml" filepath="$PROJECT_DIR$/.idea/blog.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -11,7 +11,7 @@ class PostAdmin(admin.ModelAdmin):
} }
# 设置列表显示字段 # 设置列表显示字段
list_display = ('title', 'publish_date', 'created_at') list_display = ('title', 'publish_date', 'created_at', 'updated_at')
# 设置搜索字段 # 设置搜索字段
search_fields = ('title', 'content') search_fields = ('title', 'content')

View File

@@ -7,12 +7,17 @@
<body> <body>
<!-- 添加样式使整个页面内容居中显示 --> <!-- 添加样式使整个页面内容居中显示 -->
<div style="max-width: 800px; margin: 0 auto; padding: 0 20px;"> <div style="max-width: 800px; margin: 0 auto; padding: 0 20px;">
<!-- 添加网站标题 -->
<h1 style="text-align: left;">六桂流芳的com</h1>
<h1 style="text-align: center;">{{ post.title }}</h1> <h1 style="text-align: center;">{{ post.title }}</h1>
<p>发布时间:{{ post.publish_date|date:"Y年n月j日 H:i" }}</p> <!-- 将返回首页链接放在发布时间的右侧 -->
<div style="display: flex; align-items: center; justify-content: space-between;">
<p>发布时间:{{ post.publish_date|date:"Y年n月j日 H:i" }}</p>
<a href="{% url 'index' %}" style="margin-left: 20px; white-space: nowrap;">返回首页</a>
</div>
<!-- 使用get_markdown_content方法渲染Markdown内容 --> <!-- 使用get_markdown_content方法渲染Markdown内容 -->
<div>{{ post.get_markdown_content|safe }}</div> <div>{{ post.get_markdown_content|safe }}</div>
<br> <br>
<a href="{% url 'index' %}">返回首页</a>
</div> </div>
<footer style="position: fixed; bottom: 0; width: 100%; text-align: center; font-size: 12px; color: #999; background-color: white; padding: 5px 0;"> <footer style="position: fixed; bottom: 0; width: 100%; text-align: center; font-size: 12px; color: #999; background-color: white; padding: 5px 0;">
<a href="https://beian.miit.gov.cn/" target="_blank">闽ICP备2023010767号-2</a> <a href="https://beian.miit.gov.cn/" target="_blank">闽ICP备2023010767号-2</a>

View File

@@ -5,14 +5,16 @@
<title>六桂流芳的com</title> <title>六桂流芳的com</title>
</head> </head>
<body> <body>
<!-- 添加样式使整个页面内容居中显示 --> <!-- 修改样式使页面内容靠左对齐,标题显示在左上角 -->
<div style="max-width: 800px; margin: 0 auto; padding: 0 20px; text-align: center;"> <div style="max-width: 800px; margin: 0 auto; padding: 0 20px; text-align: left;">
<h1>六桂流芳的com</h1> <h1 style="text-align: left;">六桂流芳的com</h1>
<ul style="list-style: none; padding: 0;"> <ul style="list-style: none; padding: 0;">
{% for post in posts %} {% for post in posts %}
<li style="margin: 10px 0; text-align: left;"> <li style="margin: 10px 0; text-align: left;">
<a href="{% url 'detail' post.id %}">{{ post.title }}</a> - <div style="display: flex; justify-content: space-between; align-items: center;">
发布时间:{{ post.publish_date|date:"Y年n月j日 H:i" }} <a href="{% url 'detail' post.id %}">{{ post.title }}</a>
<span style="margin-left: 10px; white-space: nowrap;">发布时间:{{ post.publish_date|date:"Y年n月j日 H:i" }}</span>
</div>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
@@ -22,6 +24,3 @@
</footer> </footer>
</body> </body>
</html> </html>