Merge pull request #1 from lektor/master

updating fork
This commit is contained in:
go-bears 2016-07-24 12:22:14 -07:00 committed by GitHub
commit df3c0fd9f3
45 changed files with 69 additions and 55 deletions

BIN
assets/static/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -20,7 +20,7 @@ contents:
complex and beautiful websites out of flat files — for people who do
not want to make a compromise between a CMS and a static blog engine.
<p>
Getting your ideas implemented is as easy as making breakfast eggs.
Getting your ideas implemented is as easy as frying an egg.
</div>
<div class="col-md-4 visible-md-block visible-lg-block">
<div class="download-btn"><a href="downloads/"
@ -38,15 +38,18 @@ text:
<li><a href="https://twitter.com/getlektor"
class="twitter-follow-button" data-show-count="false"
data-size="large" data-dnt="true">Follow @getlektor</a>
</li>
<li><a class="github-button" href="https://github.com/lektor/lektor"
data-style="mega" data-count-href="/lektor/lektor/stargazers"
data-count-api="/repos/lektor/lektor#stargazers_count"
data-count-aria-label="# stargazers on GitHub"
aria-label="Star lektor/lektor on GitHub">Star</a>
</li>
<li><a href="https://gitter.im/lektor/lektor"
class="js-gitter-toggle-chat-button"><img
src="https://badges.gitter.im/lektor/lektor.svg"
alt="Join the chat at https://gitter.im/lektor/lektor"></a>
</li>
</ul>
</div>
#### text-block ####
@ -95,7 +98,7 @@ image: edit-post.png
description:
The project files are neatly laid out in the filesystem and allow tracking
via cloud storage or version control.
via cloud storage like Dropbox or version control.
-----
image: filesystem.png
##### slide #####

View File

@ -20,7 +20,7 @@ differs between Python and templates. In templates you have to use the
<ul>
{% for item in this.children.filter(
(F.type == 'hotel').and(F.stars >= 3)) %}
<li>{{ item.name }}: {{ item.stars }} stars
<li>{{ item.name }}: {{ item.stars }} stars</li>
{% endfor %}
</ul>
```

View File

@ -19,7 +19,7 @@ contained in another string or a item can be contained within a list.
<h3>Projects Tagged 'amazing'</h3>
<ul>
{% for item in this.children.filter(F.tags.contains('amazing')) %}
<li>{{ item.name }}
<li>{{ item.name }}</li>
{% endfor %}
</ul>
```

View File

@ -18,7 +18,7 @@ see [endswith :ref](../endswith/).
```html+jinja
<ul>
{% for item in this.children.filter(F.name.endswith_cs('House')) %}
<li>{{ item.name }}
<li>{{ item.name }}</li>
{% endfor %}
</ul>
```

View File

@ -18,7 +18,7 @@ see [endswith_cs :ref](../endswith-cs/).
```html+jinja
<ul>
{% for item in this.children.filter(F.name.endswith('house')) %}
<li>{{ item.name }}
<li>{{ item.name }}</li>
{% endfor %}
</ul>
```

View File

@ -15,7 +15,7 @@ Typically it compares if a value matches a specific value exactly:
<h2>Our Houses</h2>
<ul>
{% for project in this.children.filter(F.type == 'house') %}
<li>{{ project.name }}
<li>{{ project.name }}</li>
{% endfor %}
</ul>
```

View File

@ -16,7 +16,7 @@ or equal to it. This behavior works best with [integers
<h3>3 or more Stars</h3>
<ul>
{% for item in this.children.filter(F.stars >= 3) %}
<li>{{ item.name }}: {{ item.stars }} stars
<li>{{ item.name }}: {{ item.stars }} stars</li>
{% endfor %}
</ul>
```

View File

@ -16,7 +16,7 @@ or [floats :ref](../../types/float/).
<h3>Well Rated Items</h3>
<ul>
{% for item in this.children.filter(F.stars > 3) %}
<li>{{ item.name }}: {{ item.stars }} stars
<li>{{ item.name }}: {{ item.stars }} stars</li>
{% endfor %}
</ul>
```

View File

@ -16,7 +16,7 @@ or equal to it. This behavior works best with [integers
<h3>Projects From Before Including 2000</h3>
<ul>
{% for item in this.children.filter(F.year <= 2000) %}
<li>{{ item.name }} ({{ item.year }})
<li>{{ item.name }} ({{ item.year }})</li>
{% endfor %}
</ul>
```

View File

@ -16,7 +16,7 @@ or equal to it. This behavior works best with [integers
<h3>Projects From Before 2000</h3>
<ul>
{% for item in this.children.filter(F.year < 2000) %}
<li>{{ item.name }} ({{ item.year }})
<li>{{ item.name }} ({{ item.year }})</li>
{% endfor %}
</ul>
```

View File

@ -15,7 +15,7 @@ by doing an exact comparison:
<h2>Everything Other Than Houses</h2>
<ul>
{% for project in this.children.filter(F.type != 'house') %}
<li>{{ project.name }}
<li>{{ project.name }}</li>
{% endfor %}
</ul>
```

View File

@ -20,7 +20,7 @@ differs between Python and templates. In templates you have to use the
<ul>
{% for item in this.children.filter(
(F.type == 'hotel').or(F.type == 'apartment')) %}
<li>{{ item.name }} ({{ item.type}})
<li>{{ item.name }} ({{ item.type}})</li>
{% endfor %}
</ul>
```

View File

@ -19,7 +19,7 @@ see [startswith :ref](../startswith/).
<h1>A</h1>
<ul>
{% for item in this.children.filter(F.name.startswith_cs('A')) %}
<li>{{ item.name }}
<li>{{ item.name }}</li>
{% endfor %}
</ul>
```

View File

@ -19,7 +19,7 @@ see [startswith_cs :ref](../startswith-cs/).
<h1>A</h1>
<ul>
{% for item in this.children.filter(F.name.startswith('a')) %}
<li>{{ item.name }}
<li>{{ item.name }}</li>
{% endfor %}
</ul>
```

View File

@ -22,7 +22,7 @@ Accessing an attributes creates an [Expression :ref](../expression/).
```html+jinja
<ul>
{% for item in this.children.filter(F.status == 'published') %}
<li>{{ item.title }}
<li>{{ item.title }}</li>
{% endfor %}
</ul>
```

View File

@ -28,7 +28,7 @@ used to provide alts with a humand readable title.
<p>Other languages:
<ul>
{% for alt in get_alts(this) %}
<li><a href="{{ '.'|url(alt=alt) }}">{{ alt|title }}</a>
<li><a href="{{ '.'|url(alt=alt) }}">{{ alt|title }}</a></li>
{% endfor %}
</ul>
```

View File

@ -18,7 +18,7 @@ and will also include hidden pages.
```html+jinja
<ul>
{% for project in site.query('/projects') %}
<li>{{ project.name }}: {{ project.year }}
<li>{{ project.name }}: {{ project.year }}</li>
{% endfor %}
</ul>
```

View File

@ -18,7 +18,7 @@ handy.
{% if items %}
<ul>
{% for item in items %}
<li>{{ item.name }}
<li>{{ item.name }}</li>
{% endfor %}
</ul>
{% endif %}

View File

@ -22,7 +22,7 @@ Here a basic example of how to filter something in a template:
```html+jinja
<ul>
{% for item in this.children.filter(F.status == 'published') %}
<li>{{ item.title }}
<li>{{ item.title }}</li>
{% endfor %}
</ul>
```

View File

@ -22,7 +22,7 @@ Here a basic example of how to filter something in a template:
```html+jinja
<ul>
{% for item in this.children.filter(F.status == 'published') %}
<li>{{ item.title }}
<li>{{ item.title }}</li>
{% endfor %}
</ul>
```

View File

@ -24,7 +24,7 @@ Here a basic example of how to filter something in a template:
```html+jinja
<ul>
{% for item in this.children.include_hidden(true) %}
<li>{{ item.title }}{% if item.is_hidden %} (hidden){% endif %}
<li>{{ item.title }}{% if item.is_hidden %} (hidden){% endif %}</li>
{% endfor %}
</ul>
```

View File

@ -25,7 +25,7 @@ Here a basic example of how to filter something in a template:
```html+jinja
<ul>
{% for item in this.children.include_undiscoverable(true) %}
<li>{{ item.title }}
<li>{{ item.title }}</li>
{% endfor %}
</ul>
```

View File

@ -17,7 +17,7 @@ of matching records.
<h3>Our Top 3</h3>
<ul>
{% for item in this.children.order_by('-rating').limit(3) %}
<li>{{ item.title }}
<li>{{ item.title }}</li>
{% endfor %}
</ul>
```

View File

@ -23,7 +23,7 @@ order by year and within a year it will order by name.
```html+jinja
<ul>
{% for project in this.children.order_by('-year', 'name') %}
<li>{{ project.year }}: {{ project.name }}
<li>{{ project.year }}: {{ project.name }}</li>
{% endif %}
</ul>
```

View File

@ -25,6 +25,7 @@ there is a good reason to use it.
<li>
Items on the first page of {{ child.title }}:
{{ child.pagination.items.count() }}
</li>
{% endfor %}
</ul>
```

View File

@ -27,7 +27,7 @@ via the [query :ref](../../pad/query/) method of the pad.
```html+jinja
<ul>
{% for child in this.children %}
<li>{{ child.title }}
<li>{{ child.title }}</li>
{% endfor %}
</ul>
```

View File

@ -19,7 +19,7 @@ The following attributes exist on the pagination object:
| ------------ | ------------
| `current` | The current record
| `prev` | The record for the last page (might be `None`)
| `next` | The record for the net page (might be `None`)
| `next` | The record for the next page (might be `None`)
| `total` | The total number of items across all pages
| `pages` | The total number of pages
| `page` | The number of current page
@ -42,7 +42,7 @@ page:
```html+jinja
<ul>
{% for child in this.pagination.items %}
<li>{{ child.title }}
<li>{{ child.title }}</li>
{% endfor %}
</ul>
```

View File

@ -17,7 +17,7 @@ a page that might use different independent models.
```html+jinja
<ul>
{% for child in this.children %}
<li><a href="{{ child|url }}">{{ child.record_label }}</a>
<li><a href="{{ child|url }}">{{ child.record_label }}</a></li>
{% endfor %}
</ul>
```

View File

@ -17,7 +17,7 @@ This field is most useful for filtering when operating on mixed collections.
```html+jinja
<ul class="projects">
{% for child in this.children.filter(F._model == 'project') %}
<li>{{ child.name }}
<li>{{ child.name }}</li>
{% endfor %}
</ul>
```

View File

@ -6,7 +6,7 @@ type: type
---
body:
The `strings` type one that is a mixture of the [string :ref](../string/)
The `strings` type one that is a mixture of the [string :ref](../string/)
and [text :ref](../text/) type. It renders as a multi-line text area in the
admin but the template will see each line of text separately. It's primarily
useful for some advanced scenarios where enumerations and other things
@ -28,7 +28,7 @@ description = A list of things that would be good to buy
<h2>Shopping List</h2>
<ul>
{% for item in this.things_to_buy %}
<li>{{ item }}
<li>{{ item }}</li>
{% endfor %}
</ul>
```

View File

@ -32,8 +32,8 @@ the website.
```html+jinja
<ul class="nav">
<li><a href="{{ '/'|url }}">Index</a>
<li><a href="{{ '/about'|url }}">About</a>
<li><a href="{{ '/'|url }}">Index</a></li>
<li><a href="{{ '/about'|url }}">About</a></li>
</ul>
```

View File

@ -102,6 +102,7 @@ page.
<a href="{{ post|url }}">{{ post.title }}</a> —
by {{ post.author }}
on {{ post.pub_date|dateformat }}
</li>
{% endfor %}
</ul>

View File

@ -197,7 +197,7 @@ markup that appears on multiple pages.
<ul>
{% for category in site.query('/project-categories') %}
<li{% if category._id == active %} class="active"{% endif
%}><a href="{{ category|url }}">{{ category.name }}</a>
%}><a href="{{ category|url }}">{{ category.name }}</a></li>
{% endfor %}
</ul>
{% endmacro %}
@ -205,7 +205,7 @@ markup that appears on multiple pages.
{% macro render_project_list(projects) %}
<ul>
{% for project in projects %}
<li><a href="{{ project|url }}">{{ project.name }}</a>
<li><a href="{{ project|url }}">{{ project.name }}</a></li>
{% endfor %}
</ul>
{% endmacro %}

View File

@ -65,6 +65,7 @@ create a `sitemap/contents.lr` file instead and use a template like
{% if page.children %}
<ul>{{ loop(page.children) }}</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -43,9 +43,14 @@ a flow.
## Templates
Now that we have a model for our flow block, we need to create a template
for it. When a flow block is added to a Flow, it will automatically
render it by default through the template `blocks/NAME.html` (so in our
case `blocks/text.html`). Here is a suitable template for this:
for it. Templates for blocks are stored in the `blocks` subdirectory of the
`templates` folder.
The name for the block template is automatically derived from the config file
that keeps the flow block definition (`templates/blocks/NAME.html`):
In our case the expected template is `templates/blocks/text.html`,
as our flow block is defined in a file called `text.ini`.
Here is a suitable template for this:
```html+jinja
<div class="text-block text-block-{{ this.class }}">

View File

@ -43,6 +43,7 @@ so they might not keep pace with development on Lektor.
* [tags :ext](https://github.com/ajdavis/lektor-tags): For each tag on site, build a list of pages with that tag.
* [i18n :ext](https://github.com/numericube/lektor-i18n-plugin): Use GetText .PO files to translate your site **content**.
* [htmlmin :ext](https://github.com/vesuvium/lektor-htmlmin): Automatically minifies .html files in build directory
* [creative-commons :ext](https://github.com/humrochagf/lektor-creative-commons): Add Creative Commons license to your pages
! Have your own plugin and you want to see it here? Just [edit this page
on GitHub :ref](https://github.com/lektor/lektor-website/edit/master/content/docs/plugins/list/contents.lr),

View File

@ -32,7 +32,7 @@ some basic configuration for you.
If you want a video walkthrough you can have a look at the screencast which
explains the quickstart project a bit:
<iframe width="100%" height=410 frameborder="0" allowfullscreen="allowfullscreen"
<iframe width="100%" height="410" frameborder="0" allowfullscreen="allowfullscreen"
src="https://www.youtube.com/embed/lTWTCwuPdrU?autoplay=0&fs=1">
</iframe>

View File

@ -27,8 +27,8 @@ Because the path starts with a slash it will be treated as absolute path:
```html+jinja
<ul class="nav">
<li><a href="{{ '/'|url }}">Index</a>
<li><a href="{{ '/about'|url }}">About</a>
<li><a href="{{ '/'|url }}">Index</a></li>
<li><a href="{{ '/about'|url }}">About</a></li>
</ul>
```
@ -59,7 +59,7 @@ link to all children of a page:
```html+jinja
<ul class="nav">
{% for page in this.children %}
<li><a href="{{ page|url }}">{{ page.title }}</a>
<li><a href="{{ page|url }}">{{ page.title }}</a></li>
{% endfor %}
</ul>
```

View File

@ -8,7 +8,7 @@
There have been posts in the following years:
<ul>
{% for archive in this.year_archives %}
<li><a href="{{ archive|url }}">{{ archive.year }}</a>
<li><a href="{{ archive|url }}">{{ archive.year }}</a></li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -6,7 +6,7 @@
<a href="{{ '..'|url }}">&laquo; Back to {{ this.year }}</a>
<ul>
{% for post in this.items %}
<li><a href="{{ post|url }}">{{ post.title }}</a> by {{ post.author }} on {{ post.pub_date|dateformat }}
<li><a href="{{ post|url }}">{{ post.title }}</a> by {{ post.author }} on {{ post.pub_date|dateformat }}</li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -10,9 +10,10 @@
<ul>
{% for post in items %}
<li><a href="{{ post|url }}">{{ post.title }}</a> by {{ post.author }}
on {{ post.pub_date|dateformat }}
on {{ post.pub_date|dateformat }}</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -21,12 +21,12 @@
Subscribe for the latest news about Lektor as well as content
management and web development.
<ul>
<li><a href="{{ '@atom/transcript'|url }}">RSS Feed</a>
<li><a href="https://twitter.com/getlektor">Follow us on Twitter</a>
<li><a href="{{ '@atom/transcript'|url }}">RSS Feed</a></li>
<li><a href="https://twitter.com/getlektor">Follow us on Twitter</a></li>
</ul>
<h3>Missed a Post?</h3>
<ul>
<li><a href="{{ '@blog-archive'|url }}">Blog Archives</a>
<li><a href="{{ '@blog-archive'|url }}">Blog Archives</a></li>
</ul>
</div>
</div>

View File

@ -23,7 +23,7 @@
<ul class="toc">
{% for item in this.body.toc recursive %}
<li><a href="#{{ item.anchor }}">{{ item.title }}</a>{%
if item.children %}<ul>{{ loop(item.children) }}</ul>{% endif %}
if item.children %}<ul>{{ loop(item.children) }}</ul>{% endif %}</li>
{% endfor %}
</ul>
</div>
@ -35,19 +35,19 @@
<ul class=page-meta>
{% if this.type == 'method' %}
<li>Method of {{ get_doc_link(this.parent) }}
<li>Method of {{ get_doc_link(this.parent) }}</li>
{% elif this.type == 'property' %}
<li>Property of {{ get_doc_link(this.parent) }}
<li>Property of {{ get_doc_link(this.parent) }}</li>
{% elif this.type == 'operator' %}
<li>Operator of {{ get_doc_link(this.parent) }}
<li>Operator of {{ get_doc_link(this.parent) }}</li>
{% endif %}
{% if this.template_var %}
<li>Template variable: <a href="{{ (
'/docs/api/templates/globals/' ~ this.template_var|lower ~ '/')|url
}}"><code>{{ this.template_var }}</code></a>
}}"><code>{{ this.template_var }}</code></a></li>
{% endif %}
{% if this.version_added %}
<li>New in Lektor Version <em>{{ this.version_added }}</em>
<li>New in Lektor Version <em>{{ this.version_added }}</em></li>
{% endif %}
</ul>

View File

@ -4,6 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/static/styles.css'|asseturl }}">
<link rel="stylesheet" href="{{ get_pygments_stylesheet()|url }}">
<link rel="shortcut icon" href="{{ '/static/favicon.png'|asseturl }}">
<title>{% block title %}Hello{% endblock %} | Lektor Static Content Management System</title>
<body class="{% block bodyclass %}default{% endblock %}">
<nav class="navbar navbar-inverse navbar-static-top">