|
1 |
| -.. note:: |
2 |
| - |
3 |
| - This documentation is under construction, more to come soon |
4 |
| - |
5 |
| - |
6 |
| - |
7 | 1 | Blog
|
8 | 2 | ====
|
9 | 3 |
|
10 |
| -add a ``blog.post`` node |
11 |
| - |
12 | 4 | Features
|
13 | 5 | ~~~~~~~~
|
14 | 6 |
|
15 |
| - - Insert here the different feature available for this plugin |
| 7 | + - Expose a ``blog.post`` node handler |
| 8 | + |
16 | 9 |
|
17 | 10 | Configuration
|
18 |
| -~~~~~~~~~~~~~ |
| 11 | +------------- |
19 | 12 |
|
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. |
21 | 14 |
|
22 | 15 | .. code-block:: yaml
|
23 | 16 |
|
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. |
31 | 56 |
|
32 | 57 | Events
|
33 |
| -~~~~~~ |
| 58 | +------ |
34 | 59 |
|
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. |
36 | 61 |
|
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 |
39 | 64 |
|
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