From 57615a380d19fa020293bad53944b9f1539bc513 Mon Sep 17 00:00:00 2001 From: Lektor Bot Date: Mon, 2 Jan 2023 02:39:06 +0000 Subject: [PATCH] Synchronized build --- docs/api/databags/index.html | 4 +- docs/api/db/query/distinct/index.html | 8 +- docs/api/db/types/boolean/index.html | 10 +- docs/api/db/types/checkboxes/index.html | 10 +- docs/api/db/types/date/index.html | 6 +- docs/api/db/types/datetime/index.html | 6 +- docs/api/db/types/float/index.html | 10 +- docs/api/db/types/flow/index.html | 8 +- docs/api/db/types/html/index.html | 8 +- docs/api/db/types/integer/index.html | 10 +- docs/api/db/types/markdown/index.html | 14 +-- docs/api/db/types/select/index.html | 10 +- docs/api/db/types/sort-key/index.html | 6 +- docs/api/db/types/string/index.html | 12 +- docs/api/db/types/strings/index.html | 8 +- docs/api/db/types/text/index.html | 6 +- docs/api/db/types/url/index.html | 6 +- docs/api/publisher/publish/index.html | 2 +- docs/api/templates/filters/tojson/index.html | 4 +- docs/content/alts/index.html | 16 +-- docs/content/databags/index.html | 18 +-- docs/deployment/ftp/index.html | 4 +- docs/deployment/ghpages/index.html | 8 +- docs/deployment/glpages/index.html | 54 ++++----- docs/deployment/index.html | 10 +- docs/deployment/rsync/index.html | 12 +- docs/deployment/travisci/index.html | 66 +++++------ docs/guides/blog/index.html | 62 +++++------ docs/guides/categories/index.html | 84 +++++++------- docs/guides/disqus/index.html | 2 +- docs/guides/error-pages/index.html | 10 +- docs/guides/page-order/index.html | 18 +-- docs/guides/pagination/index.html | 6 +- docs/guides/portfolio/index.html | 66 +++++------ docs/guides/redirects/index.html | 12 +- docs/guides/single-page/index.html | 46 ++++---- docs/guides/sitemap/index.html | 10 +- docs/guides/webpack/index.html | 104 +++++++++--------- docs/models/children/index.html | 2 +- docs/models/flow/index.html | 24 ++-- docs/models/index.html | 20 ++-- docs/plugins/howto/index.html | 10 +- docs/plugins/index.html | 6 +- docs/project/file/index.html | 54 ++++----- docs/themes/creating/index.html | 46 ++++---- docs/themes/installing/index.html | 16 +-- docs/themes/packages/index.html | 4 +- index.html | 6 +- plugins/lektor-atom/index.html | 56 +++++----- plugins/lektor-disqus-comments/index.html | 4 +- plugins/lektor-expression-type/index.html | 20 ++-- plugins/lektor-git-timestamp/index.html | 28 ++--- plugins/lektor-google-search/index.html | 6 +- plugins/lektor-image-resize/index.html | 16 +-- plugins/lektor-jinja-content/index.html | 14 +-- plugins/lektor-make/index.html | 2 +- .../lektor-markdown-header-anchors/index.html | 6 +- .../lektor-markdown-highlighter/index.html | 8 +- plugins/lektor-netlify/index.html | 20 ++-- plugins/lektor-npm-support/index.html | 42 +++---- plugins/lektor-polymorphic-type/index.html | 52 ++++----- plugins/lektor-qiniu/index.html | 50 ++++----- plugins/lektor-s3/index.html | 54 ++++----- plugins/lektor-scss/index.html | 12 +- plugins/lektor-scsscompile/index.html | 8 +- plugins/lektor-strip-html-tags/index.html | 4 +- plugins/lektor-surge/index.html | 8 +- plugins/lektor-tags/index.html | 58 +++++----- plugins/lektor-tailwind/index.html | 28 ++--- plugins/lektor-webpack-html-helper/index.html | 76 ++++++------- plugins/lektor-webpack-support/index.html | 84 +++++++------- plugins/lektor-yandex-metrica/index.html | 2 +- 72 files changed, 801 insertions(+), 801 deletions(-) diff --git a/docs/api/databags/index.html b/docs/api/databags/index.html index b54012e9..1f9a04f6 100644 --- a/docs/api/databags/index.html +++ b/docs/api/databags/index.html @@ -197,8 +197,8 @@ which can for instance be used with the

Example Databag

This is a basic example of a data bag that contains configuration values for google maps. It's stored in databags/gmaps.ini:

-
key = 1233456ABCDEFG
-api_url = https://www.google.com/maps/embed/v1/
+
key = 1233456ABCDEFG
+api_url = https://www.google.com/maps/embed/v1/
 

This can then be usde to good effect in templates:

{% macro render_map(location, width=600, height=450) %}
diff --git a/docs/api/db/query/distinct/index.html b/docs/api/db/query/distinct/index.html
index 00d8578b..b45b8291 100644
--- a/docs/api/db/query/distinct/index.html
+++ b/docs/api/db/query/distinct/index.html
@@ -237,11 +237,11 @@
       

Returns a set with all values for field_name of all Records in this query.

Example

If your blog posts have a field called tags:

-
# blog-post.ini
+
# blog-post.ini
 
-[field.tags]
-name = Tags
-type = strings
+[field.tags]
+name = Tags
+type = strings
 

You can display all your blog posts' tags with:

{% set tags = site.query('/blog').distinct('tags') %}
diff --git a/docs/api/db/types/boolean/index.html b/docs/api/db/types/boolean/index.html
index 4d85150b..0b95e9ce 100644
--- a/docs/api/db/types/boolean/index.html
+++ b/docs/api/db/types/boolean/index.html
@@ -264,11 +264,11 @@ It's most useful for representing flags that can be enabled or disabled.

The checkbox_label attribute can be used to give a description to the checkbox which otherwise looks a little bit lonely in the admin panel.

-

Field Usage

[fields.render_big]
-label = Render big
-type = boolean
-checkbox_label = If true, then the page will be rendered larger.
-default = false
+

Field Usage

[fields.render_big]
+label = Render big
+type = boolean
+checkbox_label = If true, then the page will be rendered larger.
+default = false
 

Template Usage

<div class="page{% if this.render_big %} page-large{% endif %}">
   ...
diff --git a/docs/api/db/types/checkboxes/index.html b/docs/api/db/types/checkboxes/index.html
index 5b10daa7..b42add76 100644
--- a/docs/api/db/types/checkboxes/index.html
+++ b/docs/api/db/types/checkboxes/index.html
@@ -258,11 +258,11 @@ default which means that the record's configured title will be used as
 label.
 
 

In the contents file the values are stored as comma separated list.

-

Field Usage

[fields.slideshow]
-label = Slideshow
-type = checkboxes
-description = Attached images to include in the slidehow
-source = record.attachments.images
+

Field Usage

[fields.slideshow]
+label = Slideshow
+type = checkboxes
+description = Attached images to include in the slidehow
+source = record.attachments.images
 

Template Usage

{% for image in this.attachments.images %}
   {% if image._id in this.slideshow %}
diff --git a/docs/api/db/types/date/index.html b/docs/api/db/types/date/index.html
index 8679b4bc..189a08c1 100644
--- a/docs/api/db/types/date/index.html
+++ b/docs/api/db/types/date/index.html
@@ -241,9 +241,9 @@
 than a plain old string some basic operations can be provided in the
 templates.

The canonical format for the type in text form is YYYY-MM-DD.

-

Field Usage

[fields.pub_date]
-label = Publication date
-type = date
+

Field Usage

[fields.pub_date]
+label = Publication date
+type = date
 

Template Usage

<p>Published: {{ this.pub_date.strftime('%d/%m/%Y') }}
 
diff --git a/docs/api/db/types/datetime/index.html b/docs/api/db/types/datetime/index.html index bad7de55..167e3d3d 100644 --- a/docs/api/db/types/datetime/index.html +++ b/docs/api/db/types/datetime/index.html @@ -271,9 +271,9 @@ or pub_date: 2016-01-13 07:53:22 +0900
-

Field Usage

[fields.pub_date]
-label = Publication date
-type = datetime
+

Field Usage

[fields.pub_date]
+label = Publication date
+type = datetime
 

Template Usage

<p>Published: {{ this.pub_date.strftime('%Y-%m-%d %H:%M:%S') }}
 
diff --git a/docs/api/db/types/float/index.html b/docs/api/db/types/float/index.html index f5eab371..fbb7149d 100644 --- a/docs/api/db/types/float/index.html +++ b/docs/api/db/types/float/index.html @@ -239,11 +239,11 @@

The float type is similar to the integer one but it can store floating points instead of just integer values.

-

Field Usage

[fields.percentage]
-label = Percentage
-type = float
-description = Just a percentage of a progress bar.
-addon_label = %
+

Field Usage

[fields.percentage]
+label = Percentage
+type = float
+description = Just a percentage of a progress bar.
+addon_label = %
 

Template Usage

<div class="progress-bar">
   <span class="progress" style="width: {{ this.percentage }}%"></span>
diff --git a/docs/api/db/types/flow/index.html b/docs/api/db/types/flow/index.html
index 48bee732..d1e2db38 100644
--- a/docs/api/db/types/flow/index.html
+++ b/docs/api/db/types/flow/index.html
@@ -267,10 +267,10 @@ field-2: value 2
 within it, but the blocks can be individually accessed through the
 blocks attribute.  Each block's attributes are the individual fields which
 you are free to access if so desired.

-

Field Usage

[fields.body]
-label = Body
-type = flow
-flow_blocks = text, image
+

Field Usage

[fields.body]
+label = Body
+type = flow
+flow_blocks = text, image
 

Template Usage

<div class="body">
   {{ this.body }}
diff --git a/docs/api/db/types/html/index.html b/docs/api/db/types/html/index.html
index adaa58be..c4522f05 100644
--- a/docs/api/db/types/html/index.html
+++ b/docs/api/db/types/html/index.html
@@ -240,10 +240,10 @@
       

The html type is basically the same as the text type but in templates it's rendered directly as HTML instead of being escaped.

It renders as a multi-line input field in the admin interface.

-

Field Usage

[fields.tracking_code]
-label = Tracking Code
-description = raw HTML that is inserted for ad tracking purposes.
-type = html
+

Field Usage

[fields.tracking_code]
+label = Tracking Code
+description = raw HTML that is inserted for ad tracking purposes.
+type = html
 

Template Usage

{{ this.tracking_code }}
 
diff --git a/docs/api/db/types/integer/index.html b/docs/api/db/types/integer/index.html index cf304a32..4aa210e4 100644 --- a/docs/api/db/types/integer/index.html +++ b/docs/api/db/types/integer/index.html @@ -241,11 +241,11 @@ arbitrary natural numbers both negative and positive. It should be used instead of a string when a real number with such behavior is wanted as it sorts numbers correctly and the numbers can be manipulated.

-

Field Usage

[fields.image_width]
-label = Image width
-type = integer
-description = The intended image width in pixels.
-addon_label = px
+

Field Usage

[fields.image_width]
+label = Image width
+type = integer
+description = The intended image width in pixels.
+addon_label = px
 

Template Usage

<img
   src="{{ this.image.thumbnail(this.image_width - 10) }}"
diff --git a/docs/api/db/types/markdown/index.html b/docs/api/db/types/markdown/index.html
index 6004e0fa..bd2af1a7 100644
--- a/docs/api/db/types/markdown/index.html
+++ b/docs/api/db/types/markdown/index.html
@@ -265,9 +265,9 @@ there are some special attributes on it to access more information:

Additional attributes can become available through the use of plugins.

-

Field Usage

[fields.body]
-label = Body
-type = markdown
+

Field Usage

[fields.body]
+label = Body
+type = markdown
 

Template Usage

<div class="body">
   {{ this.body }}
@@ -297,10 +297,10 @@ include an explicit scheme or netloc.

As an example, to force the old behavior, wherein links were never resolved via the Lektor database, configure a markdown field like so:

-
[fields.body]
-label = Body
-type = markdown
-resolve_links = never
+
[fields.body]
+label = Body
+type = markdown
+resolve_links = never
 

Linking to a Specific Alt

When links are resolved through the Lektor database, URLs to specific _alt_s may be obtained by adding an alt query arg to the link. For example, to link to the current page, but in the French alt:

diff --git a/docs/api/db/types/select/index.html b/docs/api/db/types/select/index.html index 799f9591..d12839f8 100644 --- a/docs/api/db/types/select/index.html +++ b/docs/api/db/types/select/index.html @@ -241,11 +241,11 @@ but unlike it you can only select a single item. For configuration options refer directly to the checkboxes type.

In the contents file the values are stored as a single textual item.

-

Field Usage

[fields.class]
-label = Class
-type = select
-choices = full-width, pull-left, pull-right
-choice_labels = Full Width, Pull Left, Pull Right
+

Field Usage

[fields.class]
+label = Class
+type = select
+choices = full-width, pull-left, pull-right
+choice_labels = Full Width, Pull Left, Pull Right
 

Template Usage

<div class="{{ this.class }}">
   ...
diff --git a/docs/api/db/types/sort-key/index.html b/docs/api/db/types/sort-key/index.html
index b28d3bd9..978bb15e 100644
--- a/docs/api/db/types/sort-key/index.html
+++ b/docs/api/db/types/sort-key/index.html
@@ -240,9 +240,9 @@ basic ones in Lektor.  It can store arbitrary natural numbers both negative and
 positive.  It's intended for giving pages a sort order.  The reason it's a
 special type is that future versions of Lektor can take advantage of this to
 implement a widget for ordering.

-

Field Usage

[fields.sort_key]
-label = Sort order
-type = sort_key
+

Field Usage

[fields.sort_key]
+label = Sort order
+type = sort_key
 
diff --git a/docs/api/db/types/string/index.html b/docs/api/db/types/string/index.html index e204a083..946ef4d5 100644 --- a/docs/api/db/types/string/index.html +++ b/docs/api/db/types/string/index.html @@ -241,12 +241,12 @@ arbitrary text. It's useful for many places where you want to show a bit of text without any special formatting (titles, basic summaries and more).

It renders as a basic input field in the admin interface.

-

Field Usage

[fields.title]
-label = Title
-type = string
-size = large
-description = The title of the page
-addon_label = [[header]]
+

Field Usage

[fields.title]
+label = Title
+type = string
+size = large
+description = The title of the page
+addon_label = [[header]]
 

Template Usage

<h1>{{ this.title }}</h1>
 
diff --git a/docs/api/db/types/strings/index.html b/docs/api/db/types/strings/index.html index 1a83c0fd..f0893906 100644 --- a/docs/api/db/types/strings/index.html +++ b/docs/api/db/types/strings/index.html @@ -242,10 +242,10 @@ and text type. It renders as a multi-line te admin but the template will see each line of text separately. It's primarily useful for some advanced scenarios where enumerations and other things should be rendered.

-

Field Usage

[fields.things_to_buy]
-label = Things to buy
-type = strings
-description = A list of things that would be good to buy
+

Field Usage

[fields.things_to_buy]
+label = Things to buy
+type = strings
+description = A list of things that would be good to buy
 

Template Usage

<h2>Shopping List</h2>
 <ul>
diff --git a/docs/api/db/types/text/index.html b/docs/api/db/types/text/index.html
index 54f13e90..c8b51fdb 100644
--- a/docs/api/db/types/text/index.html
+++ b/docs/api/db/types/text/index.html
@@ -241,9 +241,9 @@
 can store multiple lines.  It does not support any formatting but is very
 useful for storing code and other things.

It renders as a multi-line input field in the admin interface.

-

Field Usage

[fields.code]
-label = Code
-type = text
+

Field Usage

[fields.code]
+label = Code
+type = text
 

Template Usage

<pre>{{ this.code }}</pre>
 
diff --git a/docs/api/db/types/url/index.html b/docs/api/db/types/url/index.html index 4436c1c9..c1a0227b 100644 --- a/docs/api/db/types/url/index.html +++ b/docs/api/db/types/url/index.html @@ -288,9 +288,9 @@ other attributes that are useful:

-

Field Usage

[fields.website]
-label = Website
-type = url
+

Field Usage

[fields.website]
+label = Website
+type = url
 

Template Usage

<a href="{{ this.url }}">{{ this.url.host }}</a>
 
diff --git a/docs/api/publisher/publish/index.html b/docs/api/publisher/publish/index.html index d5f01a40..ab361722 100644 --- a/docs/api/publisher/publish/index.html +++ b/docs/api/publisher/publish/index.html @@ -231,7 +231,7 @@ into a new location.

self.env.add_publisher('copy', CopyPublisher)

This publisher registers with the copy scheme and could be used like this:

-
target_url = copy:///path/to/destination/folder
+
target_url = copy:///path/to/destination/folder
 
diff --git a/docs/api/templates/filters/tojson/index.html b/docs/api/templates/filters/tojson/index.html index a8918b91..f87287e7 100644 --- a/docs/api/templates/filters/tojson/index.html +++ b/docs/api/templates/filters/tojson/index.html @@ -196,8 +196,8 @@ supported by JSON directly and the return value will be in a format that allows safe embedding in HTML. However if you want to use this value in an attribute of an element it needs to use single quotes otherwise it will generate a syntax error due to the embedded quotes.

-

Examples

<script type="text/javascript">
-  var options = {{ {'foo': 'bar'}|tojson }};
+

Examples

<script type="text/javascript">
+  var options = {{ {'foo': 'bar'}|tojson }};
 </script>
 

If used in attributes, single quotes are required:

diff --git a/docs/content/alts/index.html b/docs/content/alts/index.html index fd7ce7ed..f6a4579f 100644 --- a/docs/content/alts/index.html +++ b/docs/content/alts/index.html @@ -165,15 +165,15 @@ the system will refuse to build the website.

-
[alternatives.en]
-name = English
-primary = yes
-locale = en_US
+
[alternatives.en]
+name = English
+primary = yes
+locale = en_US
 
-[alternatives.fr]
-name = French
-url_prefix = /fr/
-locale = fr
+[alternatives.fr]
+name = French
+url_prefix = /fr/
+locale = fr
 

The locale key is used to define the locale that Lektor assumes for the alternative. This is for instance used for date formatting.

diff --git a/docs/content/databags/index.html b/docs/content/databags/index.html index e1f0f65f..ac961df3 100644 --- a/docs/content/databags/index.html +++ b/docs/content/databags/index.html @@ -157,9 +157,9 @@ menu or similar things.

folder. The files there are accessible by their name sans the file extension. All ordering in the source files is retained. So for instance this could be the main-nav.ini data file for a basic navigation:

-
/downloads = Download
-/docs = Documentation
-/blog = Blog
+
/downloads = Download
+/docs = Documentation
+/blog = Blog
 

And the template could access it like this:

<ul class="nav">
@@ -178,14 +178,14 @@ within the bag.  For instance you could use this to look up values that might
 change depending on the alternative of a page for instance.

In this case the system is used to translate buttons. Take buttons.ini as an example:

-
[en]
-download = Download
+
[en]
+download = Download
 
-[de]
-download = Herunterladen
+[de]
+download = Herunterladen
 
-[ru]
-download = Скачать
+[ru]
+download = Скачать
 

And in a template it could be used like this:

<h2>{{ bag('buttons', this.alt, 'download') }}</h2>
diff --git a/docs/deployment/ftp/index.html b/docs/deployment/ftp/index.html
index 95f475c5..717bd39b 100644
--- a/docs/deployment/ftp/index.html
+++ b/docs/deployment/ftp/index.html
@@ -163,8 +163,8 @@ and not very portable.

The system supports FTP (ftp://) and FTP over TLS (ftps://). Passive mode can be enabled/disabled with the optional ?passive parameter. It defaults to true.

-

Example

[servers.production]
-target = ftps://myuser:mypassword@ftp.example.com/var/www/example
+

Example

[servers.production]
+target = ftps://myuser:mypassword@ftp.example.com/var/www/example
 

Credentials

FTP is considered a largely insecure protocol for Lektor. As such if you want to use it you should keep your project file safe as credentials will diff --git a/docs/deployment/ghpages/index.html b/docs/deployment/ghpages/index.html index e93e50e4..e65df39c 100644 --- a/docs/deployment/ghpages/index.html +++ b/docs/deployment/ghpages/index.html @@ -163,8 +163,8 @@ can also accept username:password@ in the URL to hold the credentia addition to accepting username and password from the command line or environment variables.

Example:

-
[servers.ghpages]
-target = ghpages://your-user/your-repository
+
[servers.ghpages]
+target = ghpages://your-user/your-repository
 

Credentials

This deployment method has two implementations: ghpages (also known as ghpages+ssh) which uses SSH and ghpages+https which uses HTTPS. They @@ -180,8 +180,8 @@ with behavior for GitHub Pages.

CNAME Support

If you want to use a custom domain with GitHub pages (also known as a CNAME), provide the intended CNAME in the target URL using the ?cname parameter:

-
[servers.production]
-target = ghpages://your-user/your-repository?cname=www.example.com
+
[servers.production]
+target = ghpages://your-user/your-repository?cname=www.example.com
 

Note that this will overwrite whatever custom domain you may have set on GitHub with every deployment.

diff --git a/docs/deployment/glpages/index.html b/docs/deployment/glpages/index.html index d0495a3a..67408f9f 100644 --- a/docs/deployment/glpages/index.html +++ b/docs/deployment/glpages/index.html @@ -168,17 +168,17 @@ repository for it needs to be named <username>.gitlab.io.

.gitlab-ci.yml which contains a configuration for gitlab pages.

Configuration

To enable support for Lektor you need to create a .gitlab-ci.yml config next to your .lektorproject file with the following contents:

-
image: python:latest
+
image: python:latest
 
-pages:
-  script:
-    - pip install lektor
-    - lektor build --output-path public
-  artifacts:
-    paths:
-      - public
-  only:
-    - master
+pages:
+  script:
+    - pip install lektor
+    - lektor build --output-path public
+  artifacts:
+    paths:
+      - public
+  only:
+    - master
 

It's important that the output path is set to public as this is what will be served up. In case you want to use a different branch than master @@ -192,26 +192,26 @@ To do so, you have to:

  • configure Gitlab to cache this directory.
  • See the example below.

    -
    image: python:latest
    +
    image: python:latest
     
    -default:
    -  cache:
    -    paths:
    -      - .cache/lektor
    -      - .cache/pip
    +default:
    +  cache:
    +    paths:
    +      - .cache/lektor
    +      - .cache/pip
     
    -variables:
    -  XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
    +variables:
    +  XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
     
    -pages:
    -  script:
    -    - pip install lektor
    -    - lektor build --output-path public
    -  artifacts:
    -    paths:
    -      - public
    -  only:
    -    - master
    +pages:
    +  script:
    +    - pip install lektor
    +    - lektor build --output-path public
    +  artifacts:
    +    paths:
    +      - public
    +  only:
    +    - master
     

    CNAME Support

    If you want to use a CNAME with GitLab pages you can configure it in the GitLab settings:

    diff --git a/docs/deployment/index.html b/docs/deployment/index.html index d0b8b960..f3904ec7 100644 --- a/docs/deployment/index.html +++ b/docs/deployment/index.html @@ -179,11 +179,11 @@ keys are name for an optional human readable name of the server, true) and target which is the URL to publish to. Additionally one of the servers can have default set to yes to set it as default. Here is an example:

    -
    [servers.production]
    -name = Production
    -enabled = yes
    -default = yes
    -target = rsync://server/path/to/folder
    +
    [servers.production]
    +name = Production
    +enabled = yes
    +default = yes
    +target = rsync://server/path/to/folder
     

    To trigger a deploy you can use the deploy command:

    $ lektor deploy production
    diff --git a/docs/deployment/rsync/index.html b/docs/deployment/rsync/index.html
    index 8d52159f..d77c44a0 100644
    --- a/docs/deployment/rsync/index.html
    +++ b/docs/deployment/rsync/index.html
    @@ -154,8 +154,8 @@ way.  It uses the system's SSH config so for authentication just configure
     SSH as you would normally do.  The username part is optional and defaults
     to the current user that is signed into the machine or whatever is picked up
     as default from the .ssh/config.

    -

    Example

    [servers.production]
    -target = rsync://deploy@example.com/var/www/example.com
    +

    Example

    [servers.production]
    +target = rsync://deploy@example.com/var/www/example.com
     

    Credentials

    The rsync deploy method supports both username and password parameter though it's recommended to use .ssh/config and an SSH agent to secure @@ -175,8 +175,8 @@ assumed.

    it's necessary to explicitly tell rsync to remove files or directories on target that don't exist on source anymore. This can be done using the ?delete URL parameter:

    -
    [servers.production]
    -target = rsync://server/path/to/folder?delete
    +
    [servers.production]
    +target = rsync://server/path/to/folder?delete
     

    If the parameter is provided Lektor will issue a rsync --delete-delay, which performs deletions after all other transfers ended, and only in case @@ -186,8 +186,8 @@ on target that does not exist on source. This means that if you have files in the target tree that are not managed by lektor, they will get removed.

    Exclusion Support

    You can exclude items from being synced by using one or more exclude parameters. This is also useful in combination with delete to prevent removal of files in the target tree that are not managed by lektor:

    -
    [servers.production]
    -target = rsync://server/path/to/folder?delete&exclude=target_item_1&exclude=target_item_2
    +
    [servers.production]
    +target = rsync://server/path/to/folder?delete&exclude=target_item_1&exclude=target_item_2
     
    diff --git a/docs/deployment/travisci/index.html b/docs/deployment/travisci/index.html index 618d7705..99dd727d 100644 --- a/docs/deployment/travisci/index.html +++ b/docs/deployment/travisci/index.html @@ -167,13 +167,13 @@ GitHub account.

    This guide is also available as a 7 minute screencast.

    Travis Config

    Once you have signed up for Travis-CI you need to add a .travis.yml config file into your repository. You can copy paste this over:

    -
    language: python
    -python: 3.6
    -install: "pip install Lektor"
    -script: "lektor build"
    -deploy:
    -  provider: script
    -  script: "lektor deploy ghpages"
    +
    language: python
    +python: 3.6
    +install: "pip install Lektor"
    +script: "lektor build"
    +deploy:
    +  provider: script
    +  script: "lektor deploy ghpages"
     

    Because Travis already comes with all dependencies we need other than Lektor itself we just need to pip install Lektor and we're ready to go. For @@ -182,8 +182,8 @@ the build step we invoke lektor build, and for the deploy step we i to configure that.

    Project Server Config

    For the above example the best way to configure the server for the deployment in the project file would be to use ghpages+https like this:

    -
    [servers.ghpages]
    -target = ghpages+https://username/repository
    +
    [servers.ghpages]
    +target = ghpages+https://username/repository
     

    You need to add this to your .lektorproject file.

    Whenever Travis builds it will automatically throw the end result into the @@ -227,17 +227,17 @@ the Travis CI documentation.

    Speeding up Builds with Caching

    In the default setting Travis will have to rebuild everything because between builds it does not cache the build results. You can change this by enabling caching. Adjust your .travis.yml file to look like this:

    -
    language: python
    -python: 3.6
    -cache:
    -  directories:
    -    - $HOME/.cache/pip
    -    - $HOME/.cache/lektor/builds
    -install: "pip install Lektor"
    -script: "lektor build"
    -deploy:
    -  provider: script
    -  script: "lektor deploy ghpages"
    +
    language: python
    +python: 3.6
    +cache:
    +  directories:
    +    - $HOME/.cache/pip
    +    - $HOME/.cache/lektor/builds
    +install: "pip install Lektor"
    +script: "lektor build"
    +deploy:
    +  provider: script
    +  script: "lektor deploy ghpages"
     

    Note that it is also possible to set the cache directory of Lektor using the environment variable XDG_CACHE_HOME, and cache this directory instead, @@ -245,19 +245,19 @@ as done with Gitlab pages.

    Restricting Branches

    If you plan on having different branches and contributors you should disable the deployment to the master branch only. You can do this with the following config:

    -
    language: python
    -python: 3.6
    -cache:
    -  directories:
    -    - $HOME/.cache/pip
    -    - $HOME/.cache/lektor/builds
    -install: "pip install Lektor"
    -script: "lektor build"
    -deploy:
    -  provider: script
    -  script: "lektor deploy ghpages"
    -  on:
    -    branch: master
    +
    language: python
    +python: 3.6
    +cache:
    +  directories:
    +    - $HOME/.cache/pip
    +    - $HOME/.cache/lektor/builds
    +install: "pip install Lektor"
    +script: "lektor build"
    +deploy:
    +  provider: script
    +  script: "lektor deploy ghpages"
    +  on:
    +    branch: master
     
    diff --git a/docs/guides/blog/index.html b/docs/guides/blog/index.html index 771a1475..e3614821 100644 --- a/docs/guides/blog/index.html +++ b/docs/guides/blog/index.html @@ -188,48 +188,48 @@ page and what the order is. We also set it to hidden and pro will make it unavailable in the admin (hidden) for new pages and make it impossible to delete (protected). This means we need to manually create the one page later which will use this.

    -
    [model]
    -name = Blog
    -label = Blog
    -hidden = yes
    -protected = yes
    +
    [model]
    +name = Blog
    +label = Blog
    +hidden = yes
    +protected = yes
     
    -[children]
    -model = blog-post
    -order_by = -pub_date, title
    +[children]
    +model = blog-post
    +order_by = -pub_date, title
     
    -[pagination]
    -enabled = yes
    -per_page = 10
    +[pagination]
    +enabled = yes
    +per_page = 10
     

    blog-post.ini

    Each blog post has a title, publication date, author and body. The publication date and title are also used for sorting if you look into the blog.ini. Lastly we set up the label of the page to be the title of the blog post. We can also set it to hidden as the model is automatically selected in the admin whenever a page is created in the blog.

    -
    [model]
    -name = Blog Post
    -label = {{ this.title }}
    -hidden = yes
    +
    [model]
    +name = Blog Post
    +label = {{ this.title }}
    +hidden = yes
     
    -[fields.title]
    -label = Title
    -type = string
    -size = large
    +[fields.title]
    +label = Title
    +type = string
    +size = large
     
    -[fields.pub_date]
    -label = Publication date
    -type = date
    -width = 1/2
    +[fields.pub_date]
    +label = Publication date
    +type = date
    +width = 1/2
     
    -[fields.author]
    -label = Author
    -type = string
    -width = 1/2
    +[fields.author]
    +label = Author
    +type = string
    +width = 1/2
     
    -[fields.body]
    -label = Body
    -type = markdown
    +[fields.body]
    +label = Body
    +type = markdown
     

    The Templates

    Now that we have the models set up, we want to create the templates.

    blog.html

    Let's start with the blog overview page. This template is used for our blog @@ -284,7 +284,7 @@ with the name of your blog. For instance just content/blog and put into the URL? That's thankfully very easy. All you need to do is to set up a new URL format for the children. Just edit blog.ini and add this to the [children] section:

    -
    slug_format = {{ (this.pub_date|dateformat('YYYY/M/') if this.pub_date) ~ this._id }}
    +
    slug_format = {{ (this.pub_date|dateformat('YYYY/M/') if this.pub_date) ~ this._id }}
     

    What this does is that it will prepend the year (YYYY) and month (M) to the ID of the page if the publication date is configured. Otherwise it will diff --git a/docs/guides/categories/index.html b/docs/guides/categories/index.html index 6e0a7bd3..4c87d91f 100644 --- a/docs/guides/categories/index.html +++ b/docs/guides/categories/index.html @@ -200,64 +200,64 @@ different categories and it should be possible to see which projects belong to which category.

    The Models

    So we will end up with four models: projects.ini, project.ini, project-categories.ini and project-category.ini. Here is how they look:

    -

    projects.ini

    [model]
    -name = Projects
    -label = Projects
    -hidden = yes
    -protected = yes
    +

    projects.ini

    [model]
    +name = Projects
    +label = Projects
    +hidden = yes
    +protected = yes
     
    -[children]
    -model = project
    -order_by = -date, name
    +[children]
    +model = project
    +order_by = -date, name
     
    -

    project.ini

    [model]
    -name = Project
    -label = {{ this.name }}
    -hidden = yes
    +

    project.ini

    [model]
    +name = Project
    +label = {{ this.name }}
    +hidden = yes
     
    -[fields.name]
    -label = Name
    -type = string
    +[fields.name]
    +label = Name
    +type = string
     
    -[fields.date]
    -label = Date
    -type = date
    +[fields.date]
    +label = Date
    +type = date
     
    -[fields.description]
    -label = Description
    -type = markdown
    +[fields.description]
    +label = Description
    +type = markdown
     
    -[fields.categories]
    -label = Categories
    -type = checkboxes
    -source = site.query('/project-categories')
    +[fields.categories]
    +label = Categories
    +type = checkboxes
    +source = site.query('/project-categories')
     

    The above models should be mostly clear. What is probably not entirely clear is the source parameter for the categories. Essentially we instruct the admin panel to fill the selection for the checkboxes from the child pages below the project-categories folder. This is where we will maintain the categories.

    -

    project-categories.ini

    [model]
    -name = Project Categories
    -label = Project Categories
    -hidden = yes
    -protected = yes
    +

    project-categories.ini

    [model]
    +name = Project Categories
    +label = Project Categories
    +hidden = yes
    +protected = yes
     
    -[children]
    -model = project-category
    -order_by = name
    +[children]
    +model = project-category
    +order_by = name
     
    -

    project-category.ini

    [model]
    -name = Project Category
    -label = {{ this.name }}
    -hidden = yes
    +

    project-category.ini

    [model]
    +name = Project Category
    +label = {{ this.name }}
    +hidden = yes
     
    -[children]
    -replaced_with = site.query('/projects').filter(F.categories.contains(this))
    +[children]
    +replaced_with = site.query('/projects').filter(F.categories.contains(this))
     
    -[fields.name]
    -label = Name
    -type = string
    +[fields.name]
    +label = Name
    +type = string
     

    So this is where the magic lives. the replaced_with key in the [children] section tells Lektor to ignore the child pages that would normally exist below diff --git a/docs/guides/disqus/index.html b/docs/guides/disqus/index.html index e9ac3f35..77697716 100644 --- a/docs/guides/disqus/index.html +++ b/docs/guides/disqus/index.html @@ -178,7 +178,7 @@ for you:

    website. Just create a file named disqus-comments.ini into your configs/ folder and configure the shortname key with the name of your disqus community:

    -
    shortname = YOUR_SHORTNAME
    +
    shortname = YOUR_SHORTNAME
     

    In Templates

    Now you can add a discussion box to any of your templates by just using the render_disqus_comments function. Just calling it is enough to diff --git a/docs/guides/error-pages/index.html b/docs/guides/error-pages/index.html index d1c77b2d..6d6d5add 100644 --- a/docs/guides/error-pages/index.html +++ b/docs/guides/error-pages/index.html @@ -184,8 +184,8 @@ development server. To test those you will need to explicitly navigate to that relative URLs will not work. If you want to use custom error pages you will have to set the url_style to absolute as otherwise URLs on an error page will not work. Just add this to your project file:

    -
    [project]
    -url_style = absolute
    +
    [project]
    +url_style = absolute
     

    For more information about this you can read the Project File Documentation.

    Creating an Error Page

    You can easily add a 404 page by creating a 404.html/contents.lr @@ -203,16 +203,16 @@ work slightly differently.

    Apache

    Making custom error pages work is easiest with Apache. If .htaccess files are enabled you can just put a file with that name into your assets folder and add the following line to it:

    -
    ErrorDocument 404 /404.html
    +
    ErrorDocument 404 /404.html
     

    Alternatively you can add the above line into a VirtualHost or Directory section in your main config file.

    nginx

    For nginx you need to enable the error document in your main config file. Just add it to your server section:

    -
    error_page 404 /404.html;
    +
    error_page 404 /404.html;
     

    lighttpd

    If you are using lighttpd you can configure an error page for 404 this way:

    -
    server.error-handler-404 = "/404.html"
    +
    server.error-handler-404 = "/404.html"
     
    diff --git a/docs/guides/page-order/index.html b/docs/guides/page-order/index.html index f8cf55d3..b918b7dc 100644 --- a/docs/guides/page-order/index.html +++ b/docs/guides/page-order/index.html @@ -169,24 +169,24 @@ children. This way an order can be defined that is used by default for any query involving the children of a page. So what can you order by? You can order by any field you want. For instance to order by the name of a page you can do this:

    -
    [children]
    -model = project
    -order_by = name
    +
    [children]
    +model = project
    +order_by = name
     

    This will automatically order the .children query by the name of a project. You can define more than one ordering. For instance you could order blog posts by dates in decreasing order and secondarily by the blog title:

    -
    [children]
    -model = blog-post
    -order_by = -pub_date, title
    +
    [children]
    +model = blog-post
    +order_by = -pub_date, title
     

    A minus sign as prefix reverses the order.

    Specific Order

    But what to do if you want to order something specifically? In that case you can use the sort_key type and configure that:

    -
    [children]
    -model = doc-page
    -order_by = sort_key
    +
    [children]
    +model = doc-page
    +order_by = sort_key
     

    Currently you need to explicitly give numbers in this field but future versions of Lektor will provide support for automatically reordering them in the admin diff --git a/docs/guides/pagination/index.html b/docs/guides/pagination/index.html index 81922667..6a3ba742 100644 --- a/docs/guides/pagination/index.html +++ b/docs/guides/pagination/index.html @@ -171,9 +171,9 @@ subset of the child records per page.

    Configuring Pagination

    First you need to enable the pagination in the model. Primarily you need to enable the pagination and set how many items show up on a page. Just add this to the parent model:

    -
    [pagination]
    -enabled = yes
    -per_page = 10
    +
    [pagination]
    +enabled = yes
    +per_page = 10
     

    Selecting the Children

    Now that you have the pagination configured you need to iterate only over the children of an active page in your template rather than the children of the diff --git a/docs/guides/portfolio/index.html b/docs/guides/portfolio/index.html index affe999a..0c65e7a3 100644 --- a/docs/guides/portfolio/index.html +++ b/docs/guides/portfolio/index.html @@ -182,51 +182,51 @@ for new pages and make it impossible to delete (protected). This m need to manually create the one page later which will use this.

    Because we only have a single page for the projects overview we give it a static label manually (label = Projects).

    -
    [model]
    -name = Projects
    -label = Projects
    -hidden = yes
    -protected = yes
    +
    [model]
    +name = Projects
    +label = Projects
    +hidden = yes
    +protected = yes
     
    -[children]
    -model = project
    -order_by = -date, name
    +[children]
    +model = project
    +order_by = -date, name
     

    project.ini

    Next up is the model for the project. This is completely up to you, we will go with some things here that might appear on such a portfolio page. In addition we will do something with the attachments of this page, but more about that later. For now we just order them by their filename (_id):

    -
    [model]
    -name = Project
    -label = {{ this.name }}
    -hidden = yes
    +
    [model]
    +name = Project
    +label = {{ this.name }}
    +hidden = yes
     
    -[attachments]
    -order_by = _id
    +[attachments]
    +order_by = _id
     
    -[fields.name]
    -label = Name
    -type = string
    -size = large
    +[fields.name]
    +label = Name
    +type = string
    +size = large
     
    -[fields.date]
    -label = Date
    -type = date
    -width = 1/4
    +[fields.date]
    +label = Date
    +type = date
    +width = 1/4
     
    -[fields.type]
    -label = Project type
    -type = string
    -width = 1/4
    +[fields.type]
    +label = Project type
    +type = string
    +width = 1/4
     
    -[fields.website]
    -label = Website
    -type = url
    -width = 1/2
    +[fields.website]
    +label = Website
    +type = url
    +width = 1/2
     
    -[fields.description]
    -label = Description
    -type = markdown
    +[fields.description]
    +label = Description
    +type = markdown
     

    Templates

    So now that we have models, we should probably go over what we can do with the attachments. Because each page in Lektor can have attachments added we can diff --git a/docs/guides/redirects/index.html b/docs/guides/redirects/index.html index f7823c59..3015b58b 100644 --- a/docs/guides/redirects/index.html +++ b/docs/guides/redirects/index.html @@ -169,13 +169,13 @@

    Setting up a flexible redirect system to make HTML redirects in Lektor is easy. A better setup would likely be on the server level, for instance in nginx, or configured on your CDN. The redirect will be more performant on the server level. Though this is not the best kind of redirect, it is pretty robust and will work in most situations. This example is flexible and can handle multiple redirects for your site.

    Models and Templates

    Set up the models to have a simple field that can hold the value of the target path. This is the path the page will be redirected to.

    -

    models/redirect.ini

    [model]
    -name = Redirect
    +

    models/redirect.ini

    [model]
    +name = Redirect
     
    -[fields.target]
    -label = Redirect Target
    -type = string
    -description = Target is of type 'string' to allow relative paths. Converted to url in the template.
    +[fields.target]
    +label = Redirect Target
    +type = string
    +description = Target is of type 'string' to allow relative paths. Converted to url in the template.
     

    The template contains the minimal amount of html needed to initiate a redirect, along with a query for the target path.

    templates/redirect.html

    <meta http-equiv="refresh" content="0; URL='{{ this.target|url }}'" />
    diff --git a/docs/guides/single-page/index.html b/docs/guides/single-page/index.html
    index e5a5b531..a892cb5b 100644
    --- a/docs/guides/single-page/index.html
    +++ b/docs/guides/single-page/index.html
    @@ -193,35 +193,35 @@ parts of our big page.
     

    We will just sort all the documentation pages by the page ID so it's possible to just order the pages by prefixing the page with a number (0001-installation, 0002-quickstart etc.)

    -

    index.ini

    [model]
    -name = Documentation
    -label = {{ this.title }}
    -hidden = yes
    -protected = yes
    +

    index.ini

    [model]
    +name = Documentation
    +label = {{ this.title }}
    +hidden = yes
    +protected = yes
     
    -[fields.title]
    -type = string
    +[fields.title]
    +type = string
     
    -

    doc-pages.ini

    [model]
    -name = Documentation Pages
    -label = Documentation Pages
    -hidden = yes
    -protected = yes
    +

    doc-pages.ini

    [model]
    +name = Documentation Pages
    +label = Documentation Pages
    +hidden = yes
    +protected = yes
     
    -[children]
    -model = doc-page
    -order_by = _id
    +[children]
    +model = doc-page
    +order_by = _id
     
    -

    doc-page.ini

    [model]
    -name = Documentation Page
    -label = {{ this.title }}
    -hidden = yes
    +

    doc-page.ini

    [model]
    +name = Documentation Page
    +label = {{ this.title }}
    +hidden = yes
     
    -[fields.title]
    -type = string
    +[fields.title]
    +type = string
     
    -[fields.body]
    -type = markdown
    +[fields.body]
    +type = markdown
     

    Initializing the Contents

    Now that we have the models we need to set up the initial pages. All our models are hidden which means that we cannot use the admin panel to setup diff --git a/docs/guides/sitemap/index.html b/docs/guides/sitemap/index.html index daac52d0..c2d412ee 100644 --- a/docs/guides/sitemap/index.html +++ b/docs/guides/sitemap/index.html @@ -181,11 +181,11 @@ pages which should be excluded from navigation or automatic link generation.

    iterate over all pages of the site recursively. This also automatically skips hidden pages so those will not be generated out.

    <?xml version="1.0" encoding="UTF-8"?>
    -<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    -  {%- for page in [site.root] if page != this recursive %}
    -  <url><loc>{{ page|url(external=true) }}</loc></url>
    -  {{- loop(page.children|sort(attribute='path')) }}
    -  {%- endfor %}
    +<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    +  {%- for page in [site.root] if page != this recursive %}
    +  <url><loc>{{ page|url(external=true) }}</loc></url>
    +  {{- loop(page.children|sort(attribute='path')) }}
    +  {%- endfor %}
     </urlset>
     

    Sorting the page using |sort(attribute='path') is not mandatory, but can be diff --git a/docs/guides/webpack/index.html b/docs/guides/webpack/index.html index 55691d53..a6bba9f2 100644 --- a/docs/guides/webpack/index.html +++ b/docs/guides/webpack/index.html @@ -200,17 +200,17 @@ values) and then generate a package.json file for you.

    It should look similar to the following example. Please do not just copy-paste this! Instead run the tool, so that your package.json meets the latest format specification.

    -
    {
    -  "name": "lektor-example",
    -  "version": "0.1.0",
    -  "description": "",
    -  "main": "index.js",
    -  "scripts": {
    -    "test": "echo \"Error: no test specified\" && exit 1"
    -  },
    -  "author": "",
    -  "license": "MIT"
    -}
    +
    {
    +  "name": "lektor-example",
    +  "version": "0.1.0",
    +  "description": "",
    +  "main": "index.js",
    +  "scripts": {
    +    "test": "echo \"Error: no test specified\" && exit 1"
    +  },
    +  "author": "",
    +  "license": "MIT"
    +}
     

    Now we can npm install all the things we want:

    $ npm install --save-dev webpack babel-core node-sass babel-loader sass-loader css-loader url-loader style-loader file-loader extract-text-webpack-plugin
    @@ -232,48 +232,48 @@ installed for as long as someone else ran it before.

  • all built files will go to assets/static/gen
  • there will be a gen/app.js and a gen/styles.css file to include
  • -
    var webpack = require('webpack');
    -var path = require('path');
    -var ExtractTextPlugin = require('extract-text-webpack-plugin');
    +
    var webpack = require('webpack');
    +var path = require('path');
    +var ExtractTextPlugin = require('extract-text-webpack-plugin');
     
    -module.exports = {
    -  entry: {
    -    'app': './js/main.js',
    -    'styles': './scss/main.scss'
    -  },
    -  output: {
    -    path: path.dirname(__dirname) + '/assets/static/gen',
    -    filename: '[name].js'
    -  },
    -  devtool: '#cheap-module-source-map',
    -  resolve: {
    -    modules: ['node_modules'],
    -    extensions: ['.js']
    -  },
    -  module: {
    -    rules: [
    -      { test: /\.js$/, exclude: /node_modules/,
    -        loader: 'babel-loader' },
    -      { test: /\.scss$/,
    -        loader: ExtractTextPlugin.extract({
    -          fallback: 'style-loader',
    -          use: 'css-loader!sass-loader' } ) },
    -      { test: /\.css$/,
    -        loader: ExtractTextPlugin.extract({
    -          fallback: 'style-loader',
    -          use: 'css-loader' } ) },
    -      { test: /\.(woff2?|ttf|eot|svg|png|jpe?g|gif)$/,
    -        loader: 'file' }
    -    ]
    -  },
    -  plugins: [
    -    new ExtractTextPlugin({
    -      filename: 'styles.css',
    -      allChunks: true
    -    }),
    -    new webpack.optimize.UglifyJsPlugin()
    -  ]
    -};
    +module.exports = {
    +  entry: {
    +    'app': './js/main.js',
    +    'styles': './scss/main.scss'
    +  },
    +  output: {
    +    path: path.dirname(__dirname) + '/assets/static/gen',
    +    filename: '[name].js'
    +  },
    +  devtool: '#cheap-module-source-map',
    +  resolve: {
    +    modules: ['node_modules'],
    +    extensions: ['.js']
    +  },
    +  module: {
    +    rules: [
    +      { test: /\.js$/, exclude: /node_modules/,
    +        loader: 'babel-loader' },
    +      { test: /\.scss$/,
    +        loader: ExtractTextPlugin.extract({
    +          fallback: 'style-loader',
    +          use: 'css-loader!sass-loader' } ) },
    +      { test: /\.css$/,
    +        loader: ExtractTextPlugin.extract({
    +          fallback: 'style-loader',
    +          use: 'css-loader' } ) },
    +      { test: /\.(woff2?|ttf|eot|svg|png|jpe?g|gif)$/,
    +        loader: 'file' }
    +    ]
    +  },
    +  plugins: [
    +    new ExtractTextPlugin({
    +      filename: 'styles.css',
    +      allChunks: true
    +    }),
    +    new webpack.optimize.UglifyJsPlugin()
    +  ]
    +};
     

    Creating the App

    Now we can start building our app. We configured at least two files in webpack: js/main.js and scss/main.scss. Those are the entry diff --git a/docs/models/children/index.html b/docs/models/children/index.html index 3fa0a6a2..b0834bfd 100644 --- a/docs/models/children/index.html +++ b/docs/models/children/index.html @@ -195,7 +195,7 @@ important about this is that the slug expression must not fail even if fields are empty! This is necessary because new pages will start out with the fields not being filled in.

    This for instance includes a date in the URL if set:

    -
    slug_format = {{ (this.date|dateformat('YYYY/M/') if this.date) ~ this._id }}
    +
    slug_format = {{ (this.date|dateformat('YYYY/M/') if this.date) ~ this._id }}
     

    Pagination

    In general a source document renders into a single page. The exception to that rule are pages with children which show the children on the rendered diff --git a/docs/models/flow/index.html b/docs/models/flow/index.html index 050996d1..b52f8c41 100644 --- a/docs/models/flow/index.html +++ b/docs/models/flow/index.html @@ -147,20 +147,20 @@ Documentation to Flow first.

    are stored in the flowblocks/ folder and are ini files just like models.

    Instead of using [model] as section, the section is called [block].

    Here a very basic flow block model flowblocks/text.ini:

    -
    [block]
    -name = Text Block
    -button_label = Text
    +
    [block]
    +name = Text Block
    +button_label = Text
     
    -[fields.text]
    -label = Text
    -type = markdown
    +[fields.text]
    +label = Text
    +type = markdown
     
    -[fields.class]
    -label = Class
    -type = select
    -choices = default, centered
    -choice_labels = Default, Centered
    -default = default
    +[fields.class]
    +label = Class
    +type = select
    +choices = default, centered
    +choice_labels = Default, Centered
    +default = default
     

    This should be self explanatory. One thing that is different about blocks compared to regular models is that they support the button_label attribute diff --git a/docs/models/index.html b/docs/models/index.html index a3e25814..c51bb8c2 100644 --- a/docs/models/index.html +++ b/docs/models/index.html @@ -150,18 +150,18 @@ model has been explicitly selected, a default model will be selected. For most situations this will be the model with the name page. Detailed information can be found under Default Model Selection.

    Here is an example of a very basic model (models/page.ini):

    -
    [model]
    -name = Page
    -label = {{ this.title }}
    +
    [model]
    +name = Page
    +label = {{ this.title }}
     
    -[fields.title]
    -label = Title
    -type = string
    -size = large
    +[fields.title]
    +label = Title
    +type = string
    +size = large
     
    -[fields.body]
    -label = Body
    -type = markdown
    +[fields.body]
    +label = Body
    +type = markdown
     

    In this particular case, we have a model with the id page (as defined by the filename) and a name Page which will appear like that in the UI. Pages that diff --git a/docs/plugins/howto/index.html b/docs/plugins/howto/index.html index 37aca91e..f26f89ba 100644 --- a/docs/plugins/howto/index.html +++ b/docs/plugins/howto/index.html @@ -183,8 +183,8 @@ returns a dict like object to access the ini file.

    value = config.get('section.key', 'default_value')

    This would correspond to this config in configs/my-plugin.ini:

    -
    [section]
    -key = the value
    +
    [section]
    +key = the value
     

    Dependency Tracking

    While a lot of dependencies are tracked automatically, when you develop a plugin you probably will discover that sometimes you need to track your own @@ -228,9 +228,9 @@ function we also track the plugin's filename to rebuild if the plugin changes.Adding New Field Types

    Let's say you want to add an "asciidoc" field type so you can write with AsciiDoc markup.

    First install AsciiDoc so its command-line program is available. Then update blog-post.ini from the blog guide like so:

    -
    [fields.body]
    -label = Body
    -type = asciidoc  # Custom type.
    +
    [fields.body]
    +label = Body
    +type = asciidoc  # Custom type.
     

    In a blog post's contents.lr, write some AsciiDoc like:

    body:
    diff --git a/docs/plugins/index.html b/docs/plugins/index.html
    index 07231c8f..01d1cb63 100644
    --- a/docs/plugins/index.html
    +++ b/docs/plugins/index.html
    @@ -142,9 +142,9 @@ to use plugins and how to build your own.

    For completely automated plugin management just open your project file in a text editor and edit or extend the [packages] section. Just add a line for each plugin in the form name = version:

    -
    [packages]
    -lektor-cool-plugin = 1.0
    -lektor-other-plugin = 1.2
    +
    [packages]
    +lektor-cool-plugin = 1.0
    +lektor-other-plugin = 1.2
     

    It's also possible to use the plugins add command lektor plugin add NAME to automatically add the latest version of a plugin diff --git a/docs/project/file/index.html b/docs/project/file/index.html index 6c0a4f35..24441b77 100644 --- a/docs/project/file/index.html +++ b/docs/project/file/index.html @@ -146,8 +146,8 @@ identify the project for the user interface. The project file is an INI file (UTF-8 encoded like everything else in Lektor) and the minimal content is the name of the project:

    -
    [project]
    -name = My Fancy Project
    +
    [project]
    +name = My Fancy Project
     

    The name of the file can be arbitrary but must have the .lektorproject extension or Lektor will not be able to find it. When Lektor looks for a @@ -247,19 +247,19 @@ or match your custom excluded_assets pattern. The wildcard syntax f fnmatch.

    Example:

    -
    [project]
    -name = My Website
    -url = https://www.mywebsite.invalid/
    -locale = de_DE
    -excluded_assets = *.backup, *~
    -included_assets = _special_file
    +
    [project]
    +name = My Website
    +url = https://www.mywebsite.invalid/
    +locale = de_DE
    +excluded_assets = *.backup, *~
    +included_assets = _special_file
     

    [packages]

    This section controls the packages (plugins) that should be installed for this project. It's a simple key/value list where the key is the plugin name and the value is the version number.

    Example:

    -
    [packages]
    -lektor-webpack-support = 0.1
    +
    [packages]
    +lektor-webpack-support = 0.1
     

    [servers.*]

    This section can be repeated and each instance sets up a server. The * needs to be replaced with the ID of the server. This ID is used by the @@ -281,11 +281,11 @@ to the deployment guides.

    is configured it's an implicit default.

    Example:

    -
    [servers.production]
    -name = Production
    -enabled = yes
    -default = yes
    -target = rsync://server/path/to/folder
    +
    [servers.production]
    +name = Production
    +enabled = yes
    +default = yes
    +target = rsync://server/path/to/folder
     

    [alternatives.*]

    This configures Alternatives. It is repeated for each intended alternative. The default behavior is that alternatives are @@ -309,22 +309,22 @@ more information about this refer to the guide.

    This setting can override the global site locale for a specific alternative.

    Example:

    -
    [alternatives.en]
    -name = English
    -primary = yes
    -locale = en_US
    +
    [alternatives.en]
    +name = English
    +primary = yes
    +locale = en_US
     
    -[alternatives.fr]
    -name = French
    -url_prefix = /fr/
    -locale = fr
    +[alternatives.fr]
    +name = French
    +url_prefix = /fr/
    +locale = fr
     

    [attachment_types]

    Lektor does some basic attachment type detection based on file extension. This is what powers the this.attachemnts.images and this.attachments.videos attributes for instance. If the built-in map does not cover your file extension you can extend it or add new attachement types on a project by project basis.

    Example:

    -
    [attachment_types]
    -; <.file-ext> = <type>
    -.gpx = gpx
    -.ogv = video
    +
    [attachment_types]
    +; <.file-ext> = <type>
    +.gpx = gpx
    +.ogv = video
     
    diff --git a/docs/themes/creating/index.html b/docs/themes/creating/index.html index acae6deb..9f7dd089 100644 --- a/docs/themes/creating/index.html +++ b/docs/themes/creating/index.html @@ -145,7 +145,7 @@

    Not implemented yet.

    You could create a basic empty theme with the following command:

    -
    $ lektor dev new-theme
    +
    $ lektor dev new-theme
     

    Theme Components:

    A theme could provide templates, assets, and models (also flowblocks):

    demo-theme
    @@ -156,13 +156,13 @@
     

    The theme_settings Variable

    A theme_settings section in .lektorproject file could be used to parametrize themes:

    -
    [theme_settings]
    -name = "Lektor"
    -github_url = "https://github.com/lektor"
    +
    [theme_settings]
    +name = "Lektor"
    +github_url = "https://github.com/lektor"
     

    And those settings will be accessed in templates through the config env variable:

    -
    {{ config.theme_settings.<variable_name> }}
    +
    {{ config.theme_settings.<variable_name> }}
     

    Example:

    <a href="{{ config.theme_settings.github_url }}">Github</a>
    @@ -173,27 +173,27 @@ variable:

    The theme.ini File

    Themes could provide a theme.ini file, that is optional, but it's required if you want to add your theme to the lektor community themes.

    Example:

    -
    [theme]
    -name = Demo theme
    -license = MIT
    -licenselink = https://github.com/lektor/lektor-demo-theme/blob/master/LICENSE.md
    -description = Simple, minimal theme for Lektor
    -homepage = https://github.com/lektor/lektor-demo-theme
    -tags = simple, minimal, demo
    -features = blog
    -lektor_minimum_required_version = 3.1
    +
    [theme]
    +name = Demo theme
    +license = MIT
    +licenselink = https://github.com/lektor/lektor-demo-theme/blob/master/LICENSE.md
    +description = Simple, minimal theme for Lektor
    +homepage = https://github.com/lektor/lektor-demo-theme
    +tags = simple, minimal, demo
    +features = blog
    +lektor_minimum_required_version = 3.1
     
    -[author]
    -name = lektor
    -homepage = http://getlektor.com/
    +[author]
    +name = lektor
    +homepage = http://getlektor.com/
     
    -[original]
    -author =
    -homepage =
    -repo =
    +[original]
    +author =
    +homepage =
    +repo =
     
    -[packages]
    -lektor-disqus-comments = 0.2
    +[packages]
    +lektor-disqus-comments = 0.2
     

    The [original] section is only required if you are porting an existing theme.

    Not implemented yet

    The lektor_minimum_required_version is used by Lektor to check the diff --git a/docs/themes/installing/index.html b/docs/themes/installing/index.html index f78d0b19..32149cfb 100644 --- a/docs/themes/installing/index.html +++ b/docs/themes/installing/index.html @@ -149,12 +149,12 @@

    Themes are normally distributed by public Git repositories, so you could install a theme by cloning the repo:

    -
    cd themes
    -git clone URL_TO_THEME_REPO
    +
    cd themes
    +git clone URL_TO_THEME_REPO
     

    For example, for installing lektor-theme-nix:

    -
    cd themes
    -git clone https://github.com/rlaverde/lektor-theme-nix.git
    +
    cd themes
    +git clone https://github.com/rlaverde/lektor-theme-nix.git
     

    If you download several themes, setting themes variable will allow you to only load a particular theme.

    @@ -163,8 +163,8 @@ search in the community themes and automatically install it.

    -
    [project]
    -themes = lektor-theme-nix
    +
    [project]
    +themes = lektor-theme-nix
     

    Installing Multiple Themes

    Lektor also supports installing several themes. Copy them to the themes/ folder, and set the themes variable to indicate the precedence (optional).

    @@ -177,8 +177,8 @@ folder, and set the themes variable to indicate the precedence (opt ├── lektor-theme-other-theme/ └── lektor-theme-nix/
    -
    [project]
    -themes = lektor-theme-nix, lektor-theme-other-theme
    +
    [project]
    +themes = lektor-theme-nix, lektor-theme-other-theme
     

    This will make lektor-theme-nix, because it's listed first, have a higher precedence. Files present in multiple themes will be loaded from right to left, so that the first (left-most) diff --git a/docs/themes/packages/index.html b/docs/themes/packages/index.html index 9f18f9d3..ec6f8deb 100644 --- a/docs/themes/packages/index.html +++ b/docs/themes/packages/index.html @@ -134,8 +134,8 @@ the theme.

    1. You could use the [packages] section of the theme.ini to install released packages:

      -
      [packages]
      -lektor-disqus-comments = 0.2
      +
      [packages]
      +lektor-disqus-comments = 0.2
       
    2. Plugins can be added to the packages/ folder in the theme. Each plugin has diff --git a/index.html b/index.html index bd749c93..beed14e9 100644 --- a/index.html +++ b/index.html @@ -151,7 +151,7 @@ speak multiple languages and allow you to easily create localized websites.

    3. -