change title with time
This commit is contained in:
@@ -14,7 +14,7 @@ class Post(models.Model):
|
|||||||
publish_date = models.DateTimeField(default=timezone.now)
|
publish_date = models.DateTimeField(default=timezone.now)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.title} ({self.publish_date.strftime('%Y-%m-%d')})"
|
return f"{self.title}"
|
||||||
|
|
||||||
def get_markdown_content(self):
|
def get_markdown_content(self):
|
||||||
import re
|
import re
|
||||||
@@ -63,8 +63,8 @@ class Post(models.Model):
|
|||||||
|
|
||||||
# 先转换markdown到HTML
|
# 先转换markdown到HTML
|
||||||
html_content = markdown.markdown(content)
|
html_content = markdown.markdown(content)
|
||||||
|
|
||||||
# 将emoji shortcode转换为实际的emoji字符
|
# 将emoji shortcode转换为实际的emoji字符
|
||||||
html_content = emoji.emojize(html_content, language='alias')
|
html_content = emoji.emojize(html_content, language='alias')
|
||||||
|
|
||||||
return mark_safe(html_content)
|
return mark_safe(html_content)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content pre {
|
.post-content pre {
|
||||||
background-color: #f4f4f4;
|
background-color: #f4f4f4;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content code {
|
.post-content code {
|
||||||
font-family: 'Courier New', Courier, monospace;
|
font-family: 'Courier New', Courier, monospace;
|
||||||
background-color: #f4f4f4;
|
background-color: #f4f4f4;
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content pre code {
|
.post-content pre code {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user