change title with time
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user