支持Emoji

This commit is contained in:
跨越晨昏 2024-09-29 19:53:18 +08:00
parent 2f334dc13b
commit 84c34e9e3d
5 changed files with 9 additions and 11 deletions

View File

@ -24,6 +24,7 @@ class ArticleInfo(models.Model):
title = models.CharField('标题', max_length=200)
content = MDTextField(verbose_name='内容')
rendered = RichTextUploadingField(verbose_name='最终内容', default='<p>默认内容</p>', editable=False)
brief = RichTextUploadingField(verbose_name='简介', default='简介')
articlephoto = models.ImageField('文章图片', blank=True, upload_to='images/article/')
reading = models.IntegerField('阅读量', default=0)
liking = models.IntegerField('点赞量', default=0)

View File

@ -42,7 +42,7 @@ a:hover { text-decoration: none; color: #000; }
}
.main {
overflow: hidden;
width: 68%;
width: 100%;
margin: 0 auto; /* 添加左右自动外边距以实现水平居中 */
display: block; /* 已经是默认值,但保持清晰 */
}

View File

@ -1,4 +1,4 @@
@charset "gb2312";
@charset "UTF-8";
.infosbox { overflow: hidden; background: rgba(255,255,255,0.8); margin-bottom: 20px }
.newsview { padding: 0 30px }
.news_con a { color: #0e6dad }

View File

@ -15,7 +15,7 @@
<h3>
<a href="{% url 'detail' id list.id %}">{{ list.title }}</a>
</h3>
<p>{{ list.rendered|safe }}</p>
<p>{{ list.brief|safe }}</p>
</li>
{% endfor %}

View File

@ -27,14 +27,11 @@
</head>
<body>
<script>
mermaid.initialize({startOnLoad:true});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
emojify.run();
});
</script>
{% verbatim %}
<script>
mermaid.initialize({startOnLoad:true});
</script>
{% endverbatim %}
<header class="header-navigation" id="header">
<nav><div class="logo"><a href="javascript:;">博客首页</a></div>
<h2 id="mnavh"><span class="navicon"></span></h2>