定制 yosymfony/spress-plugin-more-tag 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yosymfony/spress-plugin-more-tag

Composer 安装命令:

composer require yosymfony/spress-plugin-more-tag

包简介

More tag for post in Spress sites

README 文档

README

Spress 2 ready

You can use more tag to get a excerpt of your content like blog entries.

This plugin requires Spress >= 2.0. If you are using Spress 1.x, go to 1.0.1 version of the plugin.

How to install?

Go to your Spress site and add the following to your composer.json and run composer update:

"require": {
    "yosymfony/spress-plugin-more-tag": "2.0.*"
}

How to use?

In Markdown syntax you can use --more-- or --more <your-more-label>-- like `--more More information-- to get a excerpt of your blog entries. The content located before of more tag will be a excerpt. The more tag require a new line at the end:

This is wrong:

Your main text
--more-- Explain text

The template side

This plugin provides some Twig filters and one test to handle excerpt concern:

  • excerpt filter gets the excerpt of content. {{ post.content | excerpt }}.
  • content filter gets the content without more tag text. {{ post.content | content }}.
  • excerpt_label filter gets the label associated to more tag text.
  • with_excerpt test lets you check if a variable has the more tag text.

Examples

---
layout: default
---

Hello and welcome to **Spress, a static site generator capable to generate
blogs sites**.

--more--

Your post can be write in Markdown and your templates are
writing with [Twig](http://twig.sensiolabs.org/documentation).

Example 2:

---
layout: default
---

Hello and welcome to **Spress, a static site generator capable to generate
blogs sites**.

--more More information--

Your post can be write in Markdown and your templates are
writing with [Twig](http://twig.sensiolabs.org/documentation).

统计信息

  • 总下载量: 150
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固