change title with time

This commit is contained in:
2025-07-27 18:43:48 +08:00
parent 6dd9da4da0
commit 3d29569c22
2 changed files with 6 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ class Post(models.Model):
publish_date = models.DateTimeField(default=timezone.now)
def __str__(self):
return f"{self.title} ({self.publish_date.strftime('%Y-%m-%d')})"
return f"{self.title}"
def get_markdown_content(self):
import re
@@ -63,8 +63,8 @@ class Post(models.Model):
# 先转换markdown到HTML
html_content = markdown.markdown(content)
# 将emoji shortcode转换为实际的emoji字符
html_content = emoji.emojize(html_content, language='alias')
return mark_safe(html_content)

View File

@@ -24,7 +24,7 @@
display: block;
margin: 10px 0;
}
.post-content pre {
background-color: #f4f4f4;
border: 1px solid #ddd;
@@ -33,7 +33,7 @@
overflow-x: auto;
margin: 10px 0;
}
.post-content code {
font-family: 'Courier New', Courier, monospace;
background-color: #f4f4f4;
@@ -41,7 +41,7 @@
border-radius: 3px;
font-size: 0.9em;
}
.post-content pre code {
background-color: transparent;
padding: 0;