[pluginlist-update] Adding some plugin category scaffolding.

This commit is contained in:
Joseph Nix 2018-04-20 17:52:22 -05:00
parent c2000963a6
commit 482df9ccb0
22 changed files with 176 additions and 0 deletions

View File

@ -0,0 +1 @@
name: Build

View File

@ -0,0 +1 @@
name: Content

View File

@ -0,0 +1,3 @@
_model: plugin-categories
---
_slug: plugins/categories

View File

@ -0,0 +1 @@
name: Deploy

View File

@ -0,0 +1 @@
name: Templates

View File

@ -0,0 +1,16 @@
_model: plugins
---
title: Lektor Loves Plugins
---
body:
#### banner ####
image: header.jpg
----
height: 300
----
contents: image content
#### text-block ####
text: some text
----
class: default

View File

@ -0,0 +1,5 @@
title: Disqus Comments
---
official: yes
---
categories: templates

BIN
content/plugins/header.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

View File

@ -0,0 +1,4 @@
title: Jinja Content
---
categories: content
---

View File

@ -0,0 +1,7 @@
title: Markdown Admonition
---
categories: content
---
link: https://pypi.org/project/lektor-markdown-admonition/
---
official: yes

View File

@ -0,0 +1,7 @@
title: Markdown Highlighter
---
categories: content
---
link: https://pypi.org/project/lektor-markdown-highlighter/
---
official: yes

View File

@ -0,0 +1,7 @@
title: Webpack Support
---
categories: build
---
link: https://pypi.org/project/lektor-webpack-support/
---
official: yes

View File

@ -10,6 +10,14 @@ label = Documentation
path = /showcase
label = Showcase
[plugins]
path = /plugins
label = Plugins
# [themes]
# path = /themes
# label = Themes
[community]
path = /community
label = Community

View File

@ -0,0 +1,9 @@
[model]
name = Plugin Categories
label = Plugin Categories
hidden = yes
protected = yes
[children]
model = plugin-category
order_by = name

View File

@ -0,0 +1,11 @@
[model]
name = Plugin Category
label = {{ this.name }}
hidden = yes
[children]
replaced_with = site.query('/plugins').filter(F.categories.contains(this))
[fields.name]
label = Name
type = string

27
models/plugin.ini Normal file
View File

@ -0,0 +1,27 @@
[model]
name = Plugin
inherit = page
label = {{ this.title }}
[children]
enabled = no
[fields.title]
label = Title
type = string
size = large
[fields.official]
label = Official
type = boolean
checkbox_label = If true, then the plugin will be marked as official.
default = false
[fields.link]
label = PyPI Link. We use this to scrape information about your project and display it on this site.
type = url
[fields.categories]
label = Categories
type = select
source = site.query('/plugin-categories')

7
models/plugins.ini Normal file
View File

@ -0,0 +1,7 @@
[model]
name = Plugins
inherits = page
label = {{ this.title }}
[children]
model = plugin

View File

@ -0,0 +1,26 @@
{% macro render_category_nav(active=none) %}
<ul>
{% for category in site.query('/plugin-categories') %}
<li{% if category._id == active %} class="active"{% endif
%}><a href="{{ category|url }}">{{ category.name }}</a></li>
{% endfor %}
</ul>
{% endmacro %}
{% macro render_plugin_list(plugins, active=none) %}
<ul>
{% for category in site.query('/plugin-categories') %}
<li{% if category._id == active %} class="active"{% endif
%}><a href="{{ category|url }}">{{ category.name }}</a></li>
<ul>
{% for plugin in category.children.order_by('-official', 'title') %}
{% if plugin.official %}
<li><a href="{{ plugin|url }}">* {{ plugin.title }}</a></li>
{% else %}
<li><a href="{{ plugin|url }}">{{ plugin.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endfor %}
</ul>
{% endmacro %}

View File

@ -0,0 +1,7 @@
{% extends "layout.html" %}
{% from "macros/plugins.html" import render_category_nav %}
{% block title %}Plugin Categories{% endblock %}
{% block body %}
<h1>Plugin Categories</h1>
{{ render_category_nav(active=none) }}
{% endblock %}

View File

@ -0,0 +1,9 @@
{% extends "layout.html" %}
{% from "macros/plugins.html" import render_category_nav,
render_plugin_list %}
{% block title %}Plugin Category {{ this.name }}{% endblock %}
{% block body %}
<h1>Plugin Category {{ this.name }}</h1>
{{ render_category_nav(active=this._id) }}
{{ render_plugin_list(this.children) }}
{% endblock %}

8
templates/plugin.html Normal file
View File

@ -0,0 +1,8 @@
{% extends "layout.html" %}
{% from 'macros/blocksupport.html' import render_full_width_blocks %}
{% block title %}{{ this.title }}{% endblock %}
{% block outerbody %}
<h1>{{ this.title }}</h1>1111
{{ this.summary }}2222
{{ this.repo }}333
{% endblock %}

11
templates/plugins.html Normal file
View File

@ -0,0 +1,11 @@
{% extends "layout.html" %}
{% from "macros/plugins.html" import
render_plugin_list, render_category_nav %}
{% from 'macros/blocksupport.html' import render_full_width_blocks %}
{% block title %}{{ this.title }}{% endblock %}
{% block outerbody %}
{% call render_full_width_blocks(this.body.blocks, classes='col-md-12') %}
<h1>{{ this.title }}</h1>
{{ render_plugin_list(this.children) }}
{% endcall %}
{% endblock %}