diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7e99e36
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.pyc
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..bfb6446
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,13 @@
+language: python
+python:
+ - "2.7"
+ - "3.2"
+before_install:
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq --no-install-recommends ruby-sass
+install:
+ - pip install nose
+ - pip install -e git://github.com/getpelican/pelican.git#egg=pelican
+ - pip install --use-mirrors Markdown
+ - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install --use-mirrors webassets cssmin; fi
+script: nosetests tests
diff --git a/Contributing.rst b/Contributing.rst
new file mode 100644
index 0000000..913d71c
--- /dev/null
+++ b/Contributing.rst
@@ -0,0 +1,29 @@
+Contributing a plugin
+=====================
+
+Details of how to write a plugin is explained in the official Pelican `docs`_.
+
+If you want to contribute, please fork this repository and issue your pull
+request. Make sure that your plugin follows the structure below::
+
+ my_plugin
+ ├── __init__.py
+ ├── my_plugin.py
+ └── Readme.rst / Readme.md
+
+``my_plugin.py`` is the actual plugin implementation. Include a brief
+explanation of what the plugin does as a module docstring. Leave any further
+explanations and usage details to ``Readme`` file.
+
+``__init__.py`` should contain a single line with ``from .my_plugin import *``.
+
+If you have tests for your plugin, place them in the ``tests`` folder with name
+``test_my_plugin.py``. You can use ``test_data`` folder inside, if you need content
+or templates in your tests.
+
+**Note:** Plugins in the repository are licensed with *GNU AFFERO GENERAL PUBLIC LICENSE
+Version 3*. By submitting a pull request, you accept to release your
+contribution under same license. Please refer to the ``LICENSE`` file for
+full text of the license.
+
+.. _docs: http://docs.getpelican.com/en/latest/plugins.html#how-to-create-plugins
diff --git a/README.rst b/README.rst
deleted file mode 100644
index 41de2bd..0000000
--- a/README.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-Pelican Plugins
-###############
-
-This repository contains plugins for Pelican. At the moment, this is only a
-subset of the available plugins, with others currently residing in the primary
-Pelican repository. Those latter plugins will eventually be moved here, so all
-plugins will be in one place.
-
-That being the case, if you have a plugin to contribute, please fork this
-Pelican Plugins repository and issue your pull request from there (as opposed
-to the primary Pelican repository).
diff --git a/Readme.rst b/Readme.rst
new file mode 100644
index 0000000..5d957aa
--- /dev/null
+++ b/Readme.rst
@@ -0,0 +1,41 @@
+Pelican Plugins
+###############
+
+Beginning with version 3.0, Pelican supports plugins. Plugins are a way to add
+features to Pelican without having to directly modify the Pelican core. Starting
+with 3.2, all plugins (including the ones previously in the core) are
+moved here, so this is the central place for all plugins.
+
+How to use plugins
+==================
+
+Easiest way to install and use these plugins is cloning this repo::
+
+ git clone https://github.com/getpelican/pelican-plugins
+
+and activating the ones you want in your settings file::
+
+ PLUGIN_PATH = 'path/to/pelican-plugins'
+ PLUGINS = ['assets', 'sitemap', 'gravatar']
+
+``PLUGIN_PATH`` can be a path relative to your settings file or an absolute path.
+
+Alternatively, if plugins are in an importable path, you can omit ``PLUGIN_PATH``
+and list them::
+
+ PLUGINS = ['assets', 'sitemap', 'gravatar']
+
+or you can ``import`` the plugin directly and give that::
+
+ import my_plugin
+ PLUGINS = [my_plugin, 'assets']
+
+Please refer to the ``Readme`` file in a plugin's folder for detailed information about
+that plugin.
+
+Contributing a plugin
+=====================
+
+Please refer to the `Contributing`_ file.
+
+.. _Contributing: Contributing.rst
diff --git a/assets/Readme.rst b/assets/Readme.rst
new file mode 100644
index 0000000..a61959f
--- /dev/null
+++ b/assets/Readme.rst
@@ -0,0 +1,80 @@
+Asset management
+----------------
+
+This plugin allows you to use the `Webassets`_ module to manage assets such as
+CSS and JS files. The module must first be installed::
+
+ pip install webassets
+
+The Webassets module allows you to perform a number of useful asset management
+functions, including:
+
+* CSS minifier (``cssmin``, ``yui_css``, ...)
+* CSS compiler (``less``, ``sass``, ...)
+* JS minifier (``uglifyjs``, ``yui_js``, ``closure``, ...)
+
+Others filters include gzip compression, integration of images in CSS via data
+URIs, and more. Webassets can also append a version identifier to your asset
+URL to convince browsers to download new versions of your assets when you use
+far-future expires headers. Please refer to the `Webassets documentation`_ for
+more information.
+
+When used with Pelican, Webassets is configured to process assets in the
+``OUTPUT_PATH/theme`` directory. You can use Webassets in your templates by
+including one or more template tags. The Jinja variable ``{{ ASSET_URL }}`` can
+be used in templates and is relative to the ``theme/`` url. The
+``{{ ASSET_URL }}`` variable should be used in conjunction with the
+``{{ SITEURL }}`` variable in order to generate URLs properly. For example:
+
+.. code-block:: jinja
+
+ {% assets filters="cssmin", output="css/style.min.css", "css/inuit.css", "css/pygment-monokai.css", "css/main.css" %}
+
+ {% endassets %}
+
+... will produce a minified css file with a version identifier that looks like:
+
+.. code-block:: html
+
+
+
+These filters can be combined. Here is an example that uses the SASS compiler
+and minifies the output:
+
+.. code-block:: jinja
+
+ {% assets filters="sass,cssmin", output="css/style.min.css", "css/style.scss" %}
+
+ {% endassets %}
+
+Another example for Javascript:
+
+.. code-block:: jinja
+
+ {% assets filters="uglifyjs,gzip", output="js/packed.js", "js/jquery.js", "js/base.js", "js/widgets.js" %}
+
+ {% endassets %}
+
+The above will produce a minified and gzipped JS file:
+
+.. code-block:: html
+
+
+
+Pelican's debug mode is propagated to Webassets to disable asset packaging
+and instead work with the uncompressed assets.
+
+Many of Webasset's available compilers have additional configuration options
+(i.e. 'Less', 'Sass', 'Stylus', 'Closure_js'). You can pass these options to
+Webassets using the ``ASSET_CONFIG`` in your settings file.
+
+The following will handle Google Closure's compilation level and locate
+LessCSS's binary:
+
+.. code-block:: python
+
+ ASSET_CONFIG = (('closure_compressor_optimization', 'WHITESPACE_ONLY'),
+ ('less_bin', 'lessc.cmd'), )
+
+.. _Webassets: https://github.com/miracle2k/webassets
+.. _Webassets documentation: http://webassets.readthedocs.org/en/latest/builtin_filters.html
diff --git a/assets/__init__.py b/assets/__init__.py
new file mode 100644
index 0000000..67b75dd
--- /dev/null
+++ b/assets/__init__.py
@@ -0,0 +1 @@
+from .assets import *
diff --git a/assets/assets.py b/assets/assets.py
new file mode 100644
index 0000000..4e2d104
--- /dev/null
+++ b/assets/assets.py
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+"""
+Asset management plugin for Pelican
+===================================
+
+This plugin allows you to use the `webassets`_ module to manage assets such as
+CSS and JS files.
+
+The ASSET_URL is set to a relative url to honor Pelican's RELATIVE_URLS
+setting. This requires the use of SITEURL in the templates::
+
+
+
+.. _webassets: https://webassets.readthedocs.org/
+
+"""
+from __future__ import unicode_literals
+
+import os
+import logging
+
+from pelican import signals
+from webassets import Environment
+from webassets.ext.jinja2 import AssetsExtension
+
+
+def add_jinja2_ext(pelican):
+ """Add Webassets to Jinja2 extensions in Pelican settings."""
+
+ pelican.settings['JINJA_EXTENSIONS'].append(AssetsExtension)
+
+
+def create_assets_env(generator):
+ """Define the assets environment and pass it to the generator."""
+
+ assets_url = 'theme/'
+ assets_src = os.path.join(generator.output_path, 'theme')
+ generator.env.assets_environment = Environment(assets_src, assets_url)
+
+ if 'ASSET_CONFIG' in generator.settings:
+ for item in generator.settings['ASSET_CONFIG']:
+ generator.env.assets_environment.config[item[0]] = item[1]
+
+ logger = logging.getLogger(__name__)
+ if logging.getLevelName(logger.getEffectiveLevel()) == "DEBUG":
+ generator.env.assets_environment.debug = True
+
+
+def register():
+ """Plugin registration."""
+
+ signals.initialized.connect(add_jinja2_ext)
+ signals.generator_init.connect(create_assets_env)
diff --git a/github_activity/Readme.rst b/github_activity/Readme.rst
new file mode 100644
index 0000000..fa3b95d
--- /dev/null
+++ b/github_activity/Readme.rst
@@ -0,0 +1,30 @@
+GitHub activity
+---------------
+
+This plugin makes use of the `feedparser`_ library that you'll need to
+install.
+
+Set the ``GITHUB_ACTIVITY_FEED`` parameter to your GitHub activity feed.
+For example, to track Pelican project activity, the setting would be::
+
+ GITHUB_ACTIVITY_FEED = 'https://github.com/getpelican.atom'
+
+On the template side, you just have to iterate over the ``github_activity``
+variable, as in this example::
+
+ {% if GITHUB_ACTIVITY_FEED %}
+
+
Github Activity
+
+
+ {% for entry in github_activity %}
+
{{ entry[0] }} {{ entry[1] }}
+ {% endfor %}
+
+
+ {% endif %}
+
+``github_activity`` is a list of lists. The first element is the title,
+and the second element is the raw HTML from GitHub.
+
+.. _feedparser: https://crate.io/packages/feedparser/
diff --git a/github_activity/__init__.py b/github_activity/__init__.py
new file mode 100644
index 0000000..19b6db8
--- /dev/null
+++ b/github_activity/__init__.py
@@ -0,0 +1 @@
+from .github_activity import *
diff --git a/github_activity/github_activity.py b/github_activity/github_activity.py
new file mode 100644
index 0000000..f0b1e0b
--- /dev/null
+++ b/github_activity/github_activity.py
@@ -0,0 +1,67 @@
+# -*- coding: utf-8 -*-
+
+# NEEDS WORK
+"""
+Copyright (c) Marco Milanesi
+
+Github Activity
+---------------
+A plugin to list your Github Activity
+"""
+
+from __future__ import unicode_literals, print_function
+
+from pelican import signals
+
+
+class GitHubActivity():
+ """
+ A class created to fetch github activity with feedparser
+ """
+ def __init__(self, generator):
+ try:
+ import feedparser
+ self.activities = feedparser.parse(
+ generator.settings['GITHUB_ACTIVITY_FEED'])
+ except ImportError:
+ raise Exception("Unable to find feedparser")
+
+ def fetch(self):
+ """
+ returns a list of html snippets fetched from github actitivy feed
+ """
+
+ entries = []
+ for activity in self.activities['entries']:
+ entries.append(
+ [element for element in [activity['title'],
+ activity['content'][0]['value']]])
+
+ return entries
+
+
+def fetch_github_activity(gen, metadata):
+ """
+ registered handler for the github activity plugin
+ it puts in generator.context the html needed to be displayed on a
+ template
+ """
+
+ if 'GITHUB_ACTIVITY_FEED' in gen.settings.keys():
+ gen.context['github_activity'] = gen.plugin_instance.fetch()
+
+
+def feed_parser_initialization(generator):
+ """
+ Initialization of feed parser
+ """
+
+ generator.plugin_instance = GitHubActivity(generator)
+
+
+def register():
+ """
+ Plugin registration
+ """
+ signals.article_generator_init.connect(feed_parser_initialization)
+ signals.article_generate_context.connect(fetch_github_activity)
diff --git a/global_license/Readme.rst b/global_license/Readme.rst
new file mode 100644
index 0000000..0b314f0
--- /dev/null
+++ b/global_license/Readme.rst
@@ -0,0 +1,6 @@
+Global license
+--------------
+
+This plugin allows you to define a ``LICENSE`` setting and adds the contents of that
+license variable to the article's context, making that variable available to use
+from within your theme's templates.
diff --git a/global_license/__init__.py b/global_license/__init__.py
new file mode 100644
index 0000000..ffe2862
--- /dev/null
+++ b/global_license/__init__.py
@@ -0,0 +1 @@
+from .global_license import *
diff --git a/global_license/global_license.py b/global_license/global_license.py
new file mode 100644
index 0000000..60c4fe9
--- /dev/null
+++ b/global_license/global_license.py
@@ -0,0 +1,18 @@
+"""
+License plugin for Pelican
+==========================
+
+This plugin allows you to define a LICENSE setting and adds the contents of that
+license variable to the article's context, making that variable available to use
+from within your theme's templates.
+"""
+
+from pelican import signals
+
+def add_license(generator, metadata):
+ if 'license' not in metadata.keys()\
+ and 'LICENSE' in generator.settings.keys():
+ metadata['license'] = generator.settings['LICENSE']
+
+def register():
+ signals.article_generate_context.connect(add_license)
diff --git a/pelicanext/goodreads_activity/README.md b/goodreads_activity/Readme.md
similarity index 100%
rename from pelicanext/goodreads_activity/README.md
rename to goodreads_activity/Readme.md
diff --git a/goodreads_activity/__init__.py b/goodreads_activity/__init__.py
new file mode 100644
index 0000000..176113d
--- /dev/null
+++ b/goodreads_activity/__init__.py
@@ -0,0 +1 @@
+from .goodreads_activity import *
\ No newline at end of file
diff --git a/pelicanext/goodreads_activity/goodreads_activity.py b/goodreads_activity/goodreads_activity.py
similarity index 91%
rename from pelicanext/goodreads_activity/goodreads_activity.py
rename to goodreads_activity/goodreads_activity.py
index 8e1ebc0..e92c3d3 100644
--- a/pelicanext/goodreads_activity/goodreads_activity.py
+++ b/goodreads_activity/goodreads_activity.py
@@ -1,4 +1,13 @@
# -*- coding: utf-8 -*-
+"""
+Goodreads Activity
+==================
+
+A Pelican plugin to lists books from your Goodreads shelves.
+
+Copyright (c) Talha Mansoor
+"""
+
from __future__ import unicode_literals
from pelican import signals
import feedparser
diff --git a/gravatar/Readme.rst b/gravatar/Readme.rst
new file mode 100644
index 0000000..a37335d
--- /dev/null
+++ b/gravatar/Readme.rst
@@ -0,0 +1,15 @@
+Gravatar
+--------
+
+This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and
+makes the variable available within the article's context. You can add
+``AUTHOR_EMAIL`` to your settings file to define the default author's email
+address. Obviously, that email address must be associated with a Gravatar
+account.
+
+Alternatively, you can provide an email address from within article metadata::
+
+ :email: john.doe@example.com
+
+If the email address is defined via at least one of the two methods above,
+the ``author_gravatar`` variable is added to the article's context.
diff --git a/gravatar/__init__.py b/gravatar/__init__.py
new file mode 100644
index 0000000..cc60487
--- /dev/null
+++ b/gravatar/__init__.py
@@ -0,0 +1 @@
+from .gravatar import *
diff --git a/gravatar/gravatar.py b/gravatar/gravatar.py
new file mode 100644
index 0000000..303d3c0
--- /dev/null
+++ b/gravatar/gravatar.py
@@ -0,0 +1,31 @@
+"""
+Gravatar plugin for Pelican
+===========================
+
+This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and
+makes the variable available within the article's context.
+"""
+
+import hashlib
+import six
+
+from pelican import signals
+
+
+def add_gravatar(generator, metadata):
+
+ #first check email
+ if 'email' not in metadata.keys()\
+ and 'AUTHOR_EMAIL' in generator.settings.keys():
+ metadata['email'] = generator.settings['AUTHOR_EMAIL']
+
+ #then add gravatar url
+ if 'email' in metadata.keys():
+ email_bytes = six.b(metadata['email']).lower()
+ gravatar_url = "http://www.gravatar.com/avatar/" + \
+ hashlib.md5(email_bytes).hexdigest()
+ metadata["author_gravatar"] = gravatar_url
+
+
+def register():
+ signals.article_generate_context.connect(add_gravatar)
diff --git a/gzip_cache/Readme.rst b/gzip_cache/Readme.rst
new file mode 100644
index 0000000..c5ff76f
--- /dev/null
+++ b/gzip_cache/Readme.rst
@@ -0,0 +1,10 @@
+Gzip cache
+----------
+
+Certain web servers (e.g., Nginx) can use a static cache of gzip-compressed
+files to prevent the server from compressing files during an HTTP call. Since
+compression occurs at another time, these compressed files can be compressed
+at a higher compression level for increased optimization.
+
+The ``gzip_cache`` plugin compresses all common text type files into a ``.gz``
+file within the same directory as the original file.
diff --git a/gzip_cache/__init__.py b/gzip_cache/__init__.py
new file mode 100644
index 0000000..fb76712
--- /dev/null
+++ b/gzip_cache/__init__.py
@@ -0,0 +1 @@
+from .gzip_cache import *
diff --git a/gzip_cache/gzip_cache.py b/gzip_cache/gzip_cache.py
new file mode 100644
index 0000000..1a8dd83
--- /dev/null
+++ b/gzip_cache/gzip_cache.py
@@ -0,0 +1,84 @@
+'''
+Copyright (c) 2012 Matt Layman
+
+Gzip cache
+----------
+
+A plugin to create .gz cache files for optimization.
+'''
+
+import gzip
+import logging
+import os
+
+from pelican import signals
+
+logger = logging.getLogger(__name__)
+
+# A list of file types to exclude from possible compression
+EXCLUDE_TYPES = [
+ # Compressed types
+ '.bz2',
+ '.gz',
+
+ # Audio types
+ '.aac',
+ '.flac',
+ '.mp3',
+ '.wma',
+
+ # Image types
+ '.gif',
+ '.jpg',
+ '.jpeg',
+ '.png',
+
+ # Video types
+ '.avi',
+ '.mov',
+ '.mp4',
+]
+
+def create_gzip_cache(pelican):
+ '''Create a gzip cache file for every file that a webserver would
+ reasonably want to cache (e.g., text type files).
+
+ :param pelican: The Pelican instance
+ '''
+ for dirpath, _, filenames in os.walk(pelican.settings['OUTPUT_PATH']):
+ for name in filenames:
+ if should_compress(name):
+ filepath = os.path.join(dirpath, name)
+ create_gzip_file(filepath)
+
+def should_compress(filename):
+ '''Check if the filename is a type of file that should be compressed.
+
+ :param filename: A file name to check against
+ '''
+ for extension in EXCLUDE_TYPES:
+ if filename.endswith(extension):
+ return False
+
+ return True
+
+def create_gzip_file(filepath):
+ '''Create a gzipped file in the same directory with a filepath.gz name.
+
+ :param filepath: A file to compress
+ '''
+ compressed_path = filepath + '.gz'
+
+ with open(filepath, 'rb') as uncompressed:
+ try:
+ logger.debug('Compressing: %s' % filepath)
+ compressed = gzip.open(compressed_path, 'wb')
+ compressed.writelines(uncompressed)
+ except Exception as ex:
+ logger.critical('Gzip compression failed: %s' % ex)
+ finally:
+ compressed.close()
+
+def register():
+ signals.finalized.connect(create_gzip_cache)
+
diff --git a/html_rst_directive/Readme.rst b/html_rst_directive/Readme.rst
new file mode 100644
index 0000000..93a7a1d
--- /dev/null
+++ b/html_rst_directive/Readme.rst
@@ -0,0 +1,45 @@
+HTML tags for reStructuredText
+------------------------------
+
+This plugin allows you to use HTML tags from within reST documents.
+
+
+Directives
+----------
+
+
+::
+
+ .. html::
+
+ (HTML code)
+
+
+Example
+-------
+
+A search engine::
+
+ .. html::
+
+
+
+
+A contact form::
+
+ .. html::
+
+
diff --git a/html_rst_directive/__init__.py b/html_rst_directive/__init__.py
new file mode 100644
index 0000000..57ec228
--- /dev/null
+++ b/html_rst_directive/__init__.py
@@ -0,0 +1 @@
+from .html_rst_directive import *
diff --git a/html_rst_directive/html_rst_directive.py b/html_rst_directive/html_rst_directive.py
new file mode 100644
index 0000000..ed877da
--- /dev/null
+++ b/html_rst_directive/html_rst_directive.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+"""
+HTML tags for reStructuredText
+==============================
+
+This plugin allows you to use HTML tags from within reST documents.
+
+"""
+
+from __future__ import unicode_literals
+from docutils import nodes
+from docutils.parsers.rst import directives, Directive
+
+
+class RawHtml(Directive):
+ required_arguments = 0
+ optional_arguments = 0
+ final_argument_whitespace = True
+ has_content = True
+
+ def run(self):
+ html = ' '.join(self.content)
+ node = nodes.raw('', html, format='html')
+ return [node]
+
+
+
+def register():
+ directives.register_directive('html', RawHtml)
+
diff --git a/pelicanext/latex/Readme.md b/latex/Readme.md
similarity index 100%
rename from pelicanext/latex/Readme.md
rename to latex/Readme.md
diff --git a/latex/__init__.py b/latex/__init__.py
new file mode 100644
index 0000000..1b2ce76
--- /dev/null
+++ b/latex/__init__.py
@@ -0,0 +1 @@
+from .latex import *
\ No newline at end of file
diff --git a/latex/latex.py b/latex/latex.py
new file mode 100644
index 0000000..2ebd1c7
--- /dev/null
+++ b/latex/latex.py
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+"""
+Latex Plugin For Pelican
+========================
+
+This plugin allows you to write mathematical equations in your articles using Latex.
+It uses the MathJax Latex JavaScript library to render latex that is embedded in
+between `$..$` for inline math and `$$..$$` for displayed math. It also allows for
+writing equations in by using `\begin{equation}`...`\end{equation}`.
+"""
+
+from pelican import signals
+
+latexScript = """
+
+"""
+
+def addLatex(gen, metadata):
+ """
+ The registered handler for the latex plugin. It will add
+ the latex script to the article metadata
+ """
+ if 'LATEX' in gen.settings.keys() and gen.settings['LATEX'] == 'article':
+ if 'latex' in metadata.keys():
+ metadata['latex'] = latexScript
+ else:
+ metadata['latex'] = latexScript
+
+def register():
+ """
+ Plugin registration
+ """
+ signals.article_generate_context.connect(addLatex)
diff --git a/pelicanext/multi_part/README.md b/multi_part/Readme.md
similarity index 87%
rename from pelicanext/multi_part/README.md
rename to multi_part/Readme.md
index ec553eb..f6caf93 100644
--- a/pelicanext/multi_part/README.md
+++ b/multi_part/Readme.md
@@ -7,7 +7,9 @@ In order to mark posts as part of a multi-part post, use the `:parts:` metadata:
:parts: MY_AWESOME_MULTI_PART_POST
-You can then use the `article.related_posts` variable in your templates to display other parts of current post.
+You can then use the `article.metadata.parts_articles` variable in your templates
+to display other parts of current post.
+
For example:
{% if article.metadata.parts_articles %}
diff --git a/multi_part/__init__.py b/multi_part/__init__.py
new file mode 100644
index 0000000..6e00046
--- /dev/null
+++ b/multi_part/__init__.py
@@ -0,0 +1 @@
+from .multi_part import *
diff --git a/pelicanext/multi_part/multi_part.py b/multi_part/multi_part.py
similarity index 53%
rename from pelicanext/multi_part/multi_part.py
rename to multi_part/multi_part.py
index 0581b50..8aa3bca 100644
--- a/pelicanext/multi_part/multi_part.py
+++ b/multi_part/multi_part.py
@@ -6,33 +6,8 @@ Multiple part support
=====================
Create a navigation menu for multi-part related_posts
-
-Article metadata:
-------------------
-
-:parts: a unique identifier for multi-part posts, must be the same in each
-post part.
-
-Usage
------
- {% if article.metadata.parts_articles %}
-
- {% for part_article in article.metadata.parts_articles %}
- {% if part_article == article %}
-
- {% endif %}
- {% endfor %}
-
- {% endif %}
"""
+
from collections import defaultdict
from pelican import signals
diff --git a/pelicanext/neighbors/README.rst b/neighbors/Readme.rst
similarity index 55%
rename from pelicanext/neighbors/README.rst
rename to neighbors/Readme.rst
index e772fde..e6f7eb5 100644
--- a/pelicanext/neighbors/README.rst
+++ b/neighbors/Readme.rst
@@ -4,23 +4,6 @@ Neighbor Articles Plugin for Pelican
This plugin adds ``next_article`` (newer) and ``prev_article`` (older)
variables to the article's context
-Installation
-------------
-To enable, ensure that ``neighbors.py`` is in somewhere you can ``import``.
-Then use the following in your `settings`::
-
- PLUGINS = ["neighbors"]
-
-Or you can put the plugin in ``plugins`` folder in pelican installation. You
-can find the location by typing::
-
- python -c 'import pelican.plugins as p, os; print os.path.dirname(p.__file__)'
-
-Once you get the folder, copy the ``neighbors.py`` there and use the following
-in your settings::
-
- PLUGINS = ["pelican.plugins.neighbors"]
-
Usage
-----
@@ -41,4 +24,4 @@ Usage
{% endif %}
-
\ No newline at end of file
+
diff --git a/neighbors/__init__.py b/neighbors/__init__.py
new file mode 100644
index 0000000..9038d7e
--- /dev/null
+++ b/neighbors/__init__.py
@@ -0,0 +1 @@
+from .neighbors import *
diff --git a/pelicanext/neighbors/neighbors.py b/neighbors/neighbors.py
similarity index 100%
rename from pelicanext/neighbors/neighbors.py
rename to neighbors/neighbors.py
diff --git a/pelicanext/latex/latex.py b/pelicanext/latex/latex.py
deleted file mode 100644
index 8785fdf..0000000
--- a/pelicanext/latex/latex.py
+++ /dev/null
@@ -1,112 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-Latex Plugin For Pelican
-========================
-
-This plugin allows you to write mathematical equations in your articles using Latex.
-It uses the MathJax Latex JavaScript library to render latex that is embedded in
-between `$..$` for inline math and `$$..$$` for displayed math. It also allows for
-writing equations in by using `\begin{equation}`...`\end{equation}`.
-
-Installation
-------------
-
-To enable, ensure that `latex.py` is put somewhere that is accessible.
-Then use as follows by adding the following to your settings.py:
-
- PLUGINS = ["latex"]
-
-Be careful: Not loading the plugin is easy to do, and difficult to detect. To
-make life easier, find where pelican is installed, and then copy the plugin
-there. An easy way to find where pelican is installed is to verbose list the
-available themes by typing `pelican-themes -l -v`.
-
-Once the pelican folder is found, copy `latex.py` to the `plugins` folder. Then
-add to settings.py like this:
-
- PLUGINS = ["pelican.plugins.latex"]
-
-Now all that is left to do is to embed the following to your template file
-between the `` parameters (for the NotMyIdea template, this file is base.html)
-
- {% if article and article.latex %}
- {{ article.latex }}
- {% endif %}
-
-Usage
------
-Latex will be embedded in every article. If however you want latex only for
-selected articles, then in settings.py, add
-
- LATEX = 'article'
-
-And in each article, add the metadata key `latex:`. For example, with the above
-settings, creating an article that I want to render latex math, I would just
-include 'Latex' as part of the metadata without any value:
-
- Date: 1 sep 2012
- Status: draft
- Latex:
-
-Latex Examples
---------------
-###Inline
-Latex between `$`..`$`, for example, `$`x^2`$`, will be rendered inline
-with respect to the current html block.
-
-###Displayed Math
-Latex between `$$`..`$$`, for example, `$$`x^2`$$`, will be rendered centered in a
-new paragraph.
-
-###Equations
-Latex between `\begin` and `\end`, for example, `begin{equation}` x^2 `\end{equation}`,
-will be rendered centered in a new paragraph with a right justified equation number
-at the top of the paragraph. This equation number can be referenced in the document.
-To do this, use a `label` inside of the equation format and then refer to that label
-using `ref`. For example: `begin{equation}` `\label{eq}` X^2 `\end{equation}`. Now
-refer to that equation number by `$`\ref{eq}`$`.
-
-Template And Article Examples
------------------------------
-To see an example of this plugin in action, look at
-[this article](http://doctrina.org/How-RSA-Works-With-Examples.html). To see how
-this plugin works with a template, look at
-[this template](https://github.com/barrysteyn/pelican_theme-personal_blog).
-"""
-
-from pelican import signals
-
-latexScript = """
-
-"""
-
-def addLatex(gen, metadata):
- """
- The registered handler for the latex plugin. It will add
- the latex script to the article metadata
- """
- if 'LATEX' in gen.settings.keys() and gen.settings['LATEX'] == 'article':
- if 'latex' in metadata.keys():
- metadata['latex'] = latexScript
- else:
- metadata['latex'] = latexScript
-
-def register():
- """
- Plugin registration
- """
- signals.article_generate_context.connect(addLatex)
diff --git a/pelicanext/random_article/Readme.md b/pelicanext/random_article/Readme.md
deleted file mode 100644
index f12a899..0000000
--- a/pelicanext/random_article/Readme.md
+++ /dev/null
@@ -1,36 +0,0 @@
-Random Article Plugin For Pelican
-========================
-
-This plugin generates a html file which redirect to a random article
-using javascript's window.location. The generated html file is
-saved at SITEURL.
-
-Only published articles are listed to redirect.
-
-
-Installation
-------------
-
-To enable, ensure that `random_article.py` is put somewhere that is accessible.
-Then use as follows by adding the following to your settings.py:
-
- PLUGINS = ["random_article"]
-
-An easy way to find where pelican is installed is to verbose list the
-available themes by typing `pelican-themes -l -v`.
-
-Once the pelican folder is found, copy `random_article.py` to the `plugins` folder. Then
-add to settings.py like this:
-
- PLUGINS = ["pelican.plugins.random_article"]
-
-Usage
------
-
-To use it you have to add in your config file the name of the file to use:
-
- RANDOM = 'random.html'
-
-Then in some template you add:
-
- random article
diff --git a/pelicanext/sitemap/__init__.py b/pelicanext/sitemap/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/random_article/Readme.md b/random_article/Readme.md
new file mode 100644
index 0000000..fcf00a1
--- /dev/null
+++ b/random_article/Readme.md
@@ -0,0 +1,19 @@
+Random Article Plugin For Pelican
+========================
+
+This plugin generates a html file which redirect to a random article
+using javascript's `window.location`. The generated html file is
+saved at `SITEURL`.
+
+Only published articles are listed to redirect.
+
+Usage
+-----
+
+To use it you have to add in your config file the name of the file to use:
+
+ RANDOM = 'random.html'
+
+Then in some template you add:
+
+ random article
diff --git a/random_article/__init__.py b/random_article/__init__.py
new file mode 100644
index 0000000..b59a6a0
--- /dev/null
+++ b/random_article/__init__.py
@@ -0,0 +1 @@
+from .random_article import *
diff --git a/pelicanext/random_article/random_article.py b/random_article/random_article.py
similarity index 89%
rename from pelicanext/random_article/random_article.py
rename to random_article/random_article.py
index 056c542..8f49448 100644
--- a/pelicanext/random_article/random_article.py
+++ b/random_article/random_article.py
@@ -1,4 +1,13 @@
# -*- coding: utf-8 -*-
+"""
+Random Article Plugin For Pelican
+========================
+
+This plugin generates a html file which redirect to a random article
+using javascript's window.location. The generated html file is
+saved at SITEURL.
+"""
+
from __future__ import unicode_literals
import os.path
diff --git a/related_posts/Readme.rst b/related_posts/Readme.rst
new file mode 100644
index 0000000..db97149
--- /dev/null
+++ b/related_posts/Readme.rst
@@ -0,0 +1,19 @@
+Related posts
+-------------
+
+This plugin adds the ``related_posts`` variable to the article's context.
+By default, up to 5 articles are listed. You can customize this value by
+defining ``RELATED_POSTS_MAX`` in your settings file::
+
+ RELATED_POSTS_MAX = 10
+
+You can then use the ``article.related_posts`` variable in your templates.
+For example::
+
+ {% if article.related_posts %}
+
+ {% for related_post in article.related_posts %}
+
Comments !
+ + +