|
@@ -1,13 +1,15 @@
|
|
|
# Installation
|
|
|
-Activate the plugin by adding it to your `pelicanconf.py`
|
|
|
+
|
|
|
+Activate the plugin by adding it to your `pelicanconf.py`:
|
|
|
|
|
|
PLUGIN_PATH = ['/path/to/pelican-plugins']
|
|
|
PLUGINS = ['pelican_comment_system']
|
|
|
PELICAN_COMMENT_SYSTEM = True
|
|
|
|
|
|
-And modify your `article.html` theme (see below).
|
|
|
+Then, modify your `article.html` theme as follows below.
|
|
|
|
|
|
## Settings
|
|
|
+
|
|
|
Name | Type | Default | Description
|
|
|
-----------------------------------------------|-----------|------------------------------|-------
|
|
|
`PELICAN_COMMENT_SYSTEM` | `boolean` | `False` | Activates or deactivates the comment system
|
|
@@ -21,12 +23,14 @@ Name | Type | Default
|
|
|
`COMMENT_URL` | `string` | `#comment-{slug}` | `{slug}` gets replaced with the slug of the comment. More info [here](feed.md)
|
|
|
|
|
|
## Folder structure
|
|
|
-Every comment file has to be stored in a sub folder of `PELICAN_COMMENT_SYSTEM_DIR`.
|
|
|
-Sub folders are named after the `slug` of the articles.
|
|
|
+
|
|
|
+Every comment file has to be stored in a sub-folder of `PELICAN_COMMENT_SYSTEM_DIR`.
|
|
|
+
|
|
|
+Sub-folders are named after the `slug` of the articles.
|
|
|
|
|
|
So the comments to your `foo-bar` article are stored in `comments/foo-bar/`
|
|
|
|
|
|
-The filenames of the comment files are up to you. But the filename is the Identifier of the comment (**with** extension).
|
|
|
+The filenames of the comment files are up to you. But the filename is the identifier of the comment (**with** extension).
|
|
|
|
|
|
##### Example folder structure
|
|
|
|
|
@@ -42,7 +46,9 @@ The filenames of the comment files are up to you. But the filename is the Identi
|
|
|
|
|
|
|
|
|
## Comment file
|
|
|
+
|
|
|
### Meta information
|
|
|
+
|
|
|
Tag | Required | Description
|
|
|
--------------|-----------|----------------
|
|
|
`date` | yes | Date when the comment was posted
|
|
@@ -63,25 +69,29 @@ Every other (custom) tag gets parsed as well and will be available through the t
|
|
|
Content of the comment.
|
|
|
|
|
|
## Theme
|
|
|
-In the `article.html` theme file are now two more variables available.
|
|
|
+
|
|
|
+In the `article.html` template file, there are now two additional variables available.
|
|
|
|
|
|
Variables | Description
|
|
|
-------------------------|--------------------------
|
|
|
-`article.comments_count` | Amount of total comments for this article (including replies to comments)
|
|
|
-`article.comments` | Array containing the top level comments for this article (no replies to comments)
|
|
|
+`article.comments_count` | Number of total comments for this article (including replies to comments)
|
|
|
+`article.comments` | Array containing the top-level comments for this article (no replies to comments)
|
|
|
|
|
|
### Comment object
|
|
|
-The comment object is a [content](https://github.com/getpelican/pelican/blob/master/pelican/contents.py#L34) object, so all common attributes are available (like author, content, date, local_date, slug, metadata, ...).
|
|
|
|
|
|
-Additional following attributes are added:
|
|
|
+The comment object is a [content](https://github.com/getpelican/pelican/blob/master/pelican/contents.py#L34) object, so all common attributes are available (author, content, date, local_date, slug, metadata, etc.).
|
|
|
+
|
|
|
+The additional following attributes are also available:
|
|
|
|
|
|
Attribute | Description
|
|
|
-----------|--------------------------
|
|
|
`replies` | Array containing the top level replies for this comment
|
|
|
`avatar` | Path to the avatar or identicon of the comment author
|
|
|
|
|
|
-##### Example article.html theme
|
|
|
-(only the comment section)
|
|
|
+##### Example article.html template
|
|
|
+
|
|
|
+(only the comment section is shown here)
|
|
|
+
|
|
|
```html
|
|
|
{% if article.comments %}
|
|
|
{% for comment in article.comments recursive %}
|