Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/getnikola/plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Jul 9, 2017
2 parents d6ee980 + b9b999b commit e2ecea3
Show file tree
Hide file tree
Showing 40 changed files with 317 additions and 93 deletions.
12 changes: 8 additions & 4 deletions site/conf.py
Expand Up @@ -29,21 +29,25 @@

# Package index configuration
PKGINDEX_DIRS = {
'v7': ('v7', 'plugin.tmpl')
'v7': ('v7', 'plugin.tmpl'),
'v8': ('v8', 'plugin.tmpl')
}

PKGINDEX_HANDLERS = {
'v7': ['dirname_as_title', 'parse_plugin_file']
'v7': ['dirname_as_title', 'parse_plugin_file', 'add_dummy_multiver'],
'v8': ['dirname_as_title', 'parse_plugin_file', 'add_dummy_multiver']
}
PKGINDEX_CONFIG = {
'extension': '.plugin',
'versions_supported': [7],
'versions_supported': [7, 8],
'json_filename': 'plugins.json',
}

plugins_submenu = (
('/', 'Plugins Home'),
('/categories/', 'Categories'),
('/v7/', 'Version 7'),
('/v8/', 'Version 8'),
)

# Output folder -- change if using locally
Expand Down Expand Up @@ -1211,7 +1215,7 @@

# If you hate "Filenames with Capital Letters and Spaces.md", you should
# set this to true.
UNSLUGIFY_TITLES = True
FILE_METADATA_UNSLUGIFY_TITLES = True

# Additional metadata that is added to a post when creating a new_post
# ADDITIONAL_METADATA = {}
Expand Down
13 changes: 0 additions & 13 deletions site/continuous-import.plugin

This file was deleted.

2 changes: 1 addition & 1 deletion site/pages/categories/Command.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: Command
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/Compiler.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: Compiler
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/CompilerExtension.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: CompilerExtension
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/ConfigPlugin.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: ConfigPlugin
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/LateTask.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: LateTask
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/PostScanner.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: PostScanner
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/ShortcodePlugin.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: ShortcodePlugin
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/SignalHandler.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: SignalHandler
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/Task.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: Task
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/TaskMultiplier.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: TaskMultiplier
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/TemplateSystem.rst
Expand Up @@ -4,7 +4,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: TemplateSystem
:post_type: pages
:template: plugin_list.tmpl
2 changes: 1 addition & 1 deletion site/pages/categories/gen.py
Expand Up @@ -9,7 +9,7 @@
.. category: category_page
.. post-list::
:sort: slug
:sort: slug_sortable
:categories: {0}
:post_type: pages
:template: plugin_list.tmpl
Expand Down
2 changes: 1 addition & 1 deletion site/pages/index.rst
Expand Up @@ -31,7 +31,7 @@ All available plugins
=====================

.. post-list::
:sort: slug
:sort: slug_sortable
:tags: plugin
:post_type: pages
:template: plugin_list.tmpl
Expand Down
2 changes: 1 addition & 1 deletion site/pages/sidemenu.rst
Expand Up @@ -6,7 +6,7 @@
.. url_type: full_path
.. post-list::
:sort: slug
:sort: slug_sortable
:tags: plugin
:post_type: pages
:template: sidemenu_list.tmpl
4 changes: 2 additions & 2 deletions site/pages/v7.rst
Expand Up @@ -4,7 +4,7 @@
.. category: version_page
.. post-list::
:sort: slug
:tags: plugin, v7
:sort: slug_sortable
:tags: v7
:post_type: pages
:template: plugin_list.tmpl
10 changes: 10 additions & 0 deletions site/pages/v8.rst
@@ -0,0 +1,10 @@
.. title: Version 8
.. slug: v8
.. date: 1970-01-01 00:00:00 UTC
.. category: version_page
.. post-list::
:sort: slug_sortable
:tags: v8
:post_type: pages
:template: plugin_list.tmpl
6 changes: 3 additions & 3 deletions site/templates/plugin.tmpl
Expand Up @@ -20,9 +20,9 @@
${post.meta('author')}
% endif
<p class="minverline">Supports Nikola v${post.meta('minver')}
% if post.meta('maxver'):
% if post.meta('maxver') and post.meta('maxver') != post.meta('minver'):
through ${post.meta('maxver')}
% else:
% elif not post.meta('maxver'):
or newer
% endif
</p>
Expand Down Expand Up @@ -64,5 +64,5 @@
</article>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidemenu-container"></div>
<script>var pkgindex_item_name = "${post.meta('slug')}";</script>
<script>var pkgindex_item_name = "${post.meta('slug_versioned')}";</script>
</%block>
4 changes: 4 additions & 0 deletions site/templates/plugin_list.tmpl
Expand Up @@ -6,8 +6,12 @@
<ul class="post-list">
% for post in posts:
<li class="post-list-item">
% if post.meta('multiver'):
<a href="${post.permalink(lang)}"><span class="text-muted">v${post.meta('dirver')}/</span>${post.title(lang)|h}</a> — ${post.meta('description')}
% else:
<a href="${post.permalink(lang)}">${post.title(lang)|h}</a> — ${post.meta('description')}
</li>
% endif
% endfor
</ul>
%endif
Expand Down
6 changes: 5 additions & 1 deletion site/templates/sidemenu_list.tmpl
Expand Up @@ -3,7 +3,11 @@
%if posts:
<div class="list-group">
% for post in posts:
<a class="list-group-item sidemenu-item" data-name="${post.meta('slug')}" href="${post.permalink(lang)}">${post.title(lang)|h}</a>
% if post.meta('multiver'):
<a class="list-group-item sidemenu-item" data-name="${post.meta('slug_versioned')}" href="${post.permalink(lang)}"><span class="text-muted">v${post.meta('dirver')}/</span>${post.title(lang)|h}</a>
% else:
<a class="list-group-item sidemenu-item" data-name="${post.meta('slug_versioned')}" href="${post.permalink(lang)}">${post.title(lang)|h}</a>
% endif
% endfor
</div>
%endif
Expand Down
1 change: 1 addition & 0 deletions site/v8
2 changes: 0 additions & 2 deletions v7/helloworld/helloworld.plugin
Expand Up @@ -4,8 +4,6 @@ Module = helloworld
Tests = test_helloworld

[Nikola]
MinVersion = 6.0.0
MaxVersion = 7.0.0
PluginCategory = Task

[Documentation]
Expand Down
8 changes: 4 additions & 4 deletions v7/ical/README.md
Expand Up @@ -9,13 +9,13 @@ external file, or embedded in your document.
Example with external file:

```
{{% calendar file=my_event.ical %}}
{{% raw %}}{{% calendar file=my_event.ical %}}{{% /raw %}}
```

Example with embedded calendar:

```
{{% calendar %}}
{{% raw %}}{{% calendar %}}
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
Expand All @@ -28,7 +28,7 @@ DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
{{% /calendar %}}
{{% /calendar %}}{{% /raw %}}
```

Expand All @@ -37,5 +37,5 @@ a different template, just use the ``template`` argument (it will be loaded from
or from ``templates/``:

```
{{% calendar file=my_event.ical template=my_fancy_template.tmpl %}}
{{% raw %}}{{% calendar file=my_event.ical template=my_fancy_template.tmpl %}}{{% /raw %}}
```
2 changes: 1 addition & 1 deletion v7/notebook_shortcode/README.md
Expand Up @@ -4,7 +4,7 @@ adapting an existing notebook into a post with additional markup.
Usage:

```
{{% notebook path/to/notebook.ipynb %}}
{{% raw %}}{{% notebook path/to/notebook.ipynb %}}{{% /raw %}}
```

Note: `ipynb` must be enabled and configured (COMPILERS, POSTS/PAGES) for CSS to appear properly. If you are using math
Expand Down
14 changes: 14 additions & 0 deletions v7/orgmode/README.md
Expand Up @@ -30,3 +30,17 @@ You can add any customization variables that you wish to add, to modify the
output generated by org-mode to `conf.el` inside the plugin directory. This
lets you have custom configuration, that doesn't get wiped out each time the
plugin is updated.

## Teasers

You may use teasers by enabling `INDEX_TEASERS = True` in conf.py, and
use `{{{TEASER_END}}}` to generate `<!-- TEASER_END -->` in org posts.

## Image URLs

The image url in ox-html is a little fuzzy. For example, `[[/images/test.jpg]]` will be
generated as `<img src="file:///images/test.jpg" alt="test.jpg">`
because the path is considered as an absolute file path.

In order to correctly generate image urls, you may write `[[img-url:/images/test.jpg]]`,
and then it should be generated as `<img src="/images/test.jpg" alt="test.jpg">`.

0 comments on commit e2ecea3

Please sign in to comment.