[pluginlist-update] Better template layouts.

This commit is contained in:
Joseph Nix 2018-04-23 16:44:05 -05:00
parent ac23ef384a
commit 56dc0ae10a
10 changed files with 85 additions and 52 deletions

View File

@ -1 +1,8 @@
name: Build
body:
#### text-block ####
text: par
----
class: default
---
title: Build

View File

@ -1 +1,8 @@
name: Content
title: Content
---
body:
#### text-block ####
text: adsf
----
class: default

View File

@ -1 +1,8 @@
name: Deploy
body:
#### text-block ####
text: ds
----
class: default
---
title: Deploy

View File

@ -1 +1,8 @@
name: Templates
body:
#### text-block ####
text: saf
----
class: default
---
title: Templates

View File

@ -4,13 +4,11 @@ title: Lektor Loves Plugins
---
body:
#### banner ####
image: header.jpg
----
height: 300
----
contents: image content
#### text-block ####
text: some text
text:
Lektor is a young project but it has a growing list of both official and community supported plugins. Official plugins were developed by the authors of Lektor and kept in good shape together with the rest of the project. Community plugins are moderated and updated regularly, but they might not keep pace with development on Lektor. They are maintained by the community.
This is a list of currently known plugins. Official plugins are prefixed with as asterisk (*) and are listed first in each section and separated by an underline.
----
class: default

View File

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

View File

@ -7,23 +7,19 @@
</ul>
{% endmacro %}
{% macro render_plugin_list(plugins, active=none) %}
{% for category in site.query('/plugin-categories') %}
<h2><a href="{{ category|url }}">{{ category.name }}</a></h2>
<ul>
{% for plugin in category.children.order_by('-official', 'title') %}
{% if plugin.official %}
<li><a href="{{ plugin|url }}">* {{ plugin.name }}</a></li>
{% if loop.nextitem %}
{% if not loop.nextitem.official %}
---
{% endif %}
{% endif %}
{% else %}
<li><a href="{{ plugin|url }}">{{ plugin.name }}</a></li>
{% macro render_plugin_list(category) %}
<ul>
{% for plugin in category.children.order_by('-official', 'title') %}
{% if plugin.official %}
<li><a href="{{ plugin|url }}">* {{ plugin.name }}</a></li>
{% if loop.nextitem %}
{% if not loop.nextitem.official %}
---
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% else %}
<li><a href="{{ plugin|url }}">{{ plugin.name }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endmacro %}

View File

@ -1,9 +1,8 @@
{% extends "layout.html" %}
{% from "macros/plugins.html" import render_category_nav,
render_plugin_list %}
{% block title %}Plugin Category {{ this.name }}{% endblock %}
{% extends "plugins.html" %}
{% block body %}
<h1>Plugin Category {{ this.name }}</h1>
{{ render_category_nav(active=this._id) }}
{{ render_plugin_list(this.children) }}
<h1>{{ this.title }}</h1>
{% call render_full_width_blocks(this.body.blocks, classes='col-md-12') %}
{% endcall %}
{{ render_plugin_list(this) }}
{% endblock %}

View File

@ -1,11 +1,15 @@
{% extends "layout.html" %}
{% from 'macros/blocksupport.html' import render_full_width_blocks %}
{% block title %}{{ this.title }}{% endblock %}
{% block outerbody %}
{% extends "plugins.html" %}
{% block body %}
<h1>{{ this.name }}</h1>
{% set pd = project_data(this.name) %}
{{ pd }}
<br>
{{ pd.description }}
{{ pd }}<br>
111<br>
{{ pd.author }}<br>
{{ pd.version }}<br>
{{ pd.home_page }}<br>
{{ pd.summary }}<br>
<br>
{{ pd.description|markdown }}
{% endblock %}

View File

@ -1,11 +1,22 @@
{% extends "layout.html" %}
{% from "macros/plugins.html" import
render_plugin_list, render_category_nav %}
{% from "macros/plugins.html" import render_plugin_list %}
{% 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 %}
{% set image = site.get('/plugins').attachments.images.first() %}
{% if image %}
<div class="page-banner page-banner-300" style="background-image: url({{ image|url }})"></div>
{% endif %}
{{ super() }}
{% endblock %}
{% block body %}
<h1>{{ this.title }}</h1>
{% call render_full_width_blocks(this.body.blocks, classes='col-md-12') %}
{% endcall %}
{% for category in site.query('/plugin-categories') %}
<h2><a href="{{ category|url }}">{{ category.title }}</a></h2>
{{ render_plugin_list(category) }}
{% endfor %}
{% endblock %}