Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yosymfony/spress-plugin-more-tag
Spress plugin for get the excerpt of your blog entries.
https://github.com/yosymfony/spress-plugin-more-tag
Last synced: about 1 month ago
JSON representation
Spress plugin for get the excerpt of your blog entries.
- Host: GitHub
- URL: https://github.com/yosymfony/spress-plugin-more-tag
- Owner: yosymfony
- License: mit
- Created: 2014-03-15T18:35:20.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-02T12:34:50.000Z (almost 9 years ago)
- Last Synced: 2024-04-20T08:22:27.797Z (8 months ago)
- Language: PHP
- Homepage: http://spress.yosymfony.com/
- Size: 10.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Get the excerpt of your content
![Spress 2 ready](https://img.shields.io/badge/Spress%202-ready-brightgreen.svg)
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](https://github.com/yosymfony/Spress-plugin-more-tag/tree/v1.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`:```json
"require": {
"yosymfony/spress-plugin-more-tag": "2.0.*"
}
```### How to use?
In Markdown syntax you can use `--more--` or `--more --`
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**:
```markdown
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
```markdown
---
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:
```markdown
---
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).
```