Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于使用Markdown #15

Open
xxer opened this issue Aug 20, 2015 · 5 comments
Open

关于使用Markdown #15

xxer opened this issue Aug 20, 2015 · 5 comments

Comments

@xxer
Copy link

xxer commented Aug 20, 2015

你好,我在GitHub上看到你的博客项目。想请问一下,像你博客的文章基于Markdown,是怎么实现的呢?在后台写的文章发布的前台是需要做什么处理么?图片是怎么处理的,我没在model看到啊?

@lzjun567
Copy link
Owner

数据库存的是纯markdown格式的文本,渲染在界面是,templatetags包下面有个markdown的解析标签,在html模板文件中使用该标签自动把markdown文本渲染。

apps/blog/templatetags/myapp_markup.py

@xxer
Copy link
Author

xxer commented Aug 25, 2015

发表的文章在后台的admin里面的“内容”里写,比如我想要像你的网站上的文章那样:字体或格式加以改变渲染,还能发表图片。这个是markdown做的还是django做的呢?

@lzjun567
Copy link
Owner

这是这个blog系统做的,后台只管往内容里面写markdown格式的文本,发布后直接会渲染成有样式的文本。

@xxer
Copy link
Author

xxer commented Aug 27, 2015

请问上传图片是交给Markdown还是Django做呢?

@lzjun567
Copy link
Owner

都不是,图片你必须先上传到其他云服务商,得到图片的地址后用再使用markdown的图片语法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants