惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
V
V2EX
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
S
SegmentFault 最新的问题
量子位
Engineering at Meta
Engineering at Meta
Forbes - Security
Forbes - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog
I
Intezer
V
Vulnerabilities – Threatpost
NISL@THU
NISL@THU
P
Proofpoint News Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
Google DeepMind News
Google DeepMind News
T
Tenable Blog
Know Your Adversary
Know Your Adversary
Cisco Talos Blog
Cisco Talos Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Scott Helme
Scott Helme
Stack Overflow Blog
Stack Overflow Blog
博客园 - 【当耐特】
S
Securelist
T
Tailwind CSS Blog
Simon Willison's Weblog
Simon Willison's Weblog
Microsoft Security Blog
Microsoft Security Blog
博客园_首页
P
Privacy International News Feed
K
Kaspersky official blog
T
Tor Project blog
L
LINUX DO - 热门话题
Apple Machine Learning Research
Apple Machine Learning Research
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threat Research - Cisco Blogs
G
GRAHAM CLULEY
Last Week in AI
Last Week in AI
L
LangChain Blog
C
Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
Netflix TechBlog - Medium
博客园 - 叶小钗
I
InfoQ

博客园 - CoderZh

[公告]这里的博客将不再更新,最新博客请移步至blog.coderzh.com 使用ThreadSanitizer线程检查工具 小记:《技术进步引发的灵感革命》网易游戏学院第二届公开日 强制链接静态库所有符号(包括未被使用的) 开启Github之旅 Cocos2d-x3.6 Android编译问题 读《程序员的思维训练》 最近的一些变化 成大事者不纠结 读《从0到1》 OpenWrt资料汇总 C++开源代码覆盖率工具OpenCppCoverage介绍(Windows) Facebook网络模拟测试工具ATC使用 为什么心跳包(HeartBeat)是必须的? DigitalOcean上使用Tornado+MongoDB+Nginx+Supervisor+DnsPod快速搭建个人博客 创业三年来的一些感想 - 创业篇1 创业三年来的一些感想 - 游戏篇 ViEmuVS2013-3.2.1 破解 从CEGUI源码看代码规范
使用Jekyll官方的ReadMore摘要功能
CoderZh · 2015-08-15 · via 博客园 - CoderZh

今天才发现,Jekyll官方就支持ReadMore摘要功能,记录一下。

我之前的方法,在index.html中

{{ post.content ||split:'<!-- more -->' | first }}

然后在Post里,需要分隔的摘要后面加<!-- more -->。

摘要内容...
<!-- more -->
正文内容...

官方做法: excerpt

官方的方法是,在_config.yml里,指定摘要的分隔符:

excerpt_separator:  '<!-- more -->'

然后,在index.html中:

{{ post.excerpt }}

一般情况下,摘要需要去掉html标签,所以一般这样用:

{{ post.excerpt | strip_html }}

然后,和前一种方法一样,在摘要后面加<!-- more --> 即可。