[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: body:
#### banner ####
image: header.jpg
----
height: 300
----
contents: image content
#### text-block #### #### 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 class: default

View File

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

View File

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

View File

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

View File

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

View File

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