Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b98448a

Browse files
committed
[documentation] add blog documentation
1 parent 6deb7eb commit b98448a

File tree

1 file changed

+48
-23
lines changed

1 file changed

+48
-23
lines changed

docs/plugins/blog.rst

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,65 @@
1-
.. note::
2-
3-
This documentation is under construction, more to come soon
4-
5-
6-
71
Blog
82
====
93

10-
add a ``blog.post`` node
11-
124
Features
135
~~~~~~~~
146

15-
- Insert here the different feature available for this plugin
7+
- Expose a ``blog.post`` node handler
8+
169

1710
Configuration
18-
~~~~~~~~~~~~~
11+
-------------
1912

20-
- Insert the yaml configuration for the DI
13+
There is no configuration option. You only need to enable the plugin by adding this line into the IoC configuration file.
2114

2215
.. code-block:: yaml
2316
24-
element.plugins.cache:
25-
cache_control:
26-
- { "path": "^.*\\.(txt|jpg|png|gif|xls|doc|docx)$", "Cache-Control": ['public', 's-maxage=14212800']}
27-
- { "path": "^(blog|gallery).*", "Cache-Control": ['public', 's-maxage=3600']}
28-
- { "path": "^.*\\.rss", "Cache-Control": ['public', 's-maxage=3600']}
29-
- { "path": "^contact.*", "Cache-Control": ['private', 'must-revalidate']}
30-
- { "path": "^/$", "Cache-Control": ['public', 's-maxage=3600']}
17+
element.plugins.blog:
18+
19+
Usage
20+
-----
21+
22+
You can create a blog index by creating a ``node.index`` node with the following value. The node will list all children of ``/blog`` with types = ``blog.post``.
23+
24+
.. code-block:: yaml
25+
26+
# /blog/_index.yml
27+
title: Posts
28+
type: node.index
29+
filters:
30+
limit: 64
31+
path: /blog
32+
types: [blog.post]
33+
34+
35+
A blog post is defined as:
36+
37+
.. code-block:: yaml
38+
39+
type: blog.post
40+
title: Are my services coool ?
41+
format: markdown
42+
enabled: 1
43+
published_at: Fri, 18 Sep 2009 19:19:16
44+
comment_enabled:
45+
content: |
46+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras gravida malesuada tellus,
47+
at tincidunt lorem accumsan vel. Vestibulum varius sodales sagittis. Quisque tristique
48+
tempus ligula blandit sodales. Nunc luctus, orci in interdum porttitor, urna massa scelerisque
49+
felis, eget hendrerit sapien eros sed augue. Ut quam mauris, feugiat nec laoreet pellentesque,
50+
molestie eget orci. Vivamus leo leo, convallis et sodales vel, fermentum sed leo. Cras sit
51+
amet dui vel sapien consectetur adipiscing. Pellentesque lectus massa, aliquet et ultrices
52+
sit amet, volutpat vel leo. Nulla aliquet sodales enim ac dictum. Proin mattis arcu a metus
53+
aliquam pulvinar. Phasellus sed lectus elit. Donec vitae urna magna. Vestibulum id volutpat eros.
54+
55+
The ``format`` option defines how to handle the ``content`` field. You can provide a markdown content or a html content.
3156

3257
Events
33-
~~~~~~
58+
------
3459

35-
- List event or entry points for this plugin
60+
The default template used is ``element.plugins.blog:post.html`` and declare two nodes events that can be used to extends the template.
3661

37-
Architecture
38-
~~~~~~~~~~~~
62+
- ``node.comment.list``: the listener should return the comment list related to the provided node
63+
- ``node.comment.form``: the listener should return the comment form
3964

40-
- Provide information about how the feature is implemented
65+
The ::doc::`element.plugins.discus</plugins/discus>` plugin can be used to handle comments.

0 commit comments

Comments
 (0)