Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vsespb/jekyll-cut-filter
https://github.com/vsespb/jekyll-cut-filter
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/vsespb/jekyll-cut-filter
- Owner: vsespb
- License: mit
- Created: 2012-12-28T17:48:15.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-28T17:55:52.000Z (almost 12 years ago)
- Last Synced: 2023-03-27T17:12:50.807Z (over 1 year ago)
- Language: Ruby
- Size: 104 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jekyll-cut-filter
This is a [Liquid](http://liquidmarkup.org/) filter intended to be used with [Jekyll](http://github.com/mojombo/jekyll) static site generator.
## Installation
Copy `jekyll-cut.rb` file into `_plugins` directory.
## Usage
Use `` tag in .textile files to hide content below it and `cut` filter in Liquid templates:
{{ post.content | cut }}
Note that `` tag should be removed while rendering full post:{{ post.content | remove:"" }}
(Example)
```
Index: _includes/themes/twitter/post.html
===================================================================
--- _includes/themes/twitter/post.html
+++ _includes/themes/twitter/post.html
@@ -4,7 +4,7 @@
- {{ content }}
+ {{ content | remove:"" }}
Index: atom.xml
===================================================================
--- atom.xml
+++ atom.xml
@@ -21,7 +21,7 @@
{{ post.date | date_to_xmlschema }}
{{ site.production_url }}{{ post.id }}
- {{ post.content | xml_escape }}
+ {{ post.content | remove:"" | xml_escape }}
{% endfor %}
```