diff --git a/index.html b/index.html index 750625b6..f7eea0be 100644 --- a/index.html +++ b/index.html @@ -151,7 +151,7 @@ speak multiple languages and allow you to easily create localized websites.
Here is a basic configuration:
[feed]
-name = My Site's Blog
+name = My Site's Blog
source_path = /blog
url_path = /feed.xml
@@ -153,14 +153,14 @@
name = My Blog
source_path = /
url_path = /feed.xml
-items = site.query('/').filter(F.type == 'post')
+items = site.query('/').filter(F.type == 'post')
item_model = blog-post
[coffee]
name = My Blog: Articles About Coffee
source_path = /
url_path = /category/coffee/feed.xml
-items = site.query('/blog').filter(F.categories.contains('coffee'))
+items = site.query('/blog').filter(F.categories.contains('coffee'))
item_model = blog-post
The section names, like blog
and coffee
, are just used as internal identifiers.
For the default template, you can also add the following javascript to show some entries if you have a long list (relies on jquery):
$(document).ready(function()
{
- $(".BIBTeX").hide();
- $(".BIBTeXtoggle").click( function () {
- $(this).parent().children(".BIBTeX").toggle(300);
+ $(".BIBTeX").hide();
+ $(".BIBTeXtoggle").click( function () {
+ $(this).parent().children(".BIBTeX").toggle(300);
return false;
});
- $(".BIBYear").hide();
- $(".BIBYear:first").show();
- $(".BIBYearheader").click( function () {
- $(this).parent().children(".BIBYear").toggle(300);
+ $(".BIBYear").hide();
+ $(".BIBYear:first").show();
+ $(".BIBYearheader").click( function () {
+ $(this).parent().children(".BIBYear").toggle(300);
return false;
});
- $(".bibshowall").click( function () {
- $(".BIBYear").show();
+ $(".bibshowall").click( function () {
+ $(".BIBYear").show();
});
- $(".bibhideall").click( function () {
- $(".BIBYear").hide();
- $(".BIBYear:first").show();
+ $(".bibhideall").click( function () {
+ $(".BIBYear").hide();
+ $(".BIBYear:first").show();
});
});
diff --git a/plugins/lektor-citation/index.html b/plugins/lektor-citation/index.html
index 60558781..af228269 100644
--- a/plugins/lektor-citation/index.html
+++ b/plugins/lektor-citation/index.html
@@ -149,7 +149,7 @@ link = /for-example/link-to-your/biblioprahy
<ul id="literatur">
+ <ul id="literatur">
{% for entry in citation_entries() %}
{{ citation_short_output(entry)|decode|safe }}
{% endfor %}
@@ -166,16 +166,16 @@ link = /for-example/link-to-your/biblioprahy
produces
<h2>{title}</h2><h3>{authors} ({pubYear})</h3>
<p>{note}</p>
-<dl class="literature">
-<dt class="edition"></dt>
+<dl class="literature">
+<dt class="edition"></dt>
<dd>{edition}</dd>
-<dt class="editors"></dt>
+<dt class="editors"></dt>
<dd>{editors}</dd>
-<dt class="pages"></dt>
+<dt class="pages"></dt>
<dd>{pages}</dd>
-<dt class="issbn"></dt>
+<dt class="issbn"></dt>
<dd>{issbn}</dd>
-<dt class="publisher"></dt>
+<dt class="publisher"></dt>
<dd>{publisher}</dd>
</dl>
@@ -206,8 +206,8 @@ citation_note(entry)
In-text Cites
To cite a certain entry in your texts you can use the jinja_env globals:
-citation_full_cite(id, link="")
-citation_full_citeNP(id, link="")
+citation_full_cite(id, link="")
+citation_full_citeNP(id, link="")
Both methods create a complete hyperlink inside your text for the entry with id. You may give it any url to the link parameter to e.g. link it to your bibliography page. The NP in the second stands for No Parantheses. So you'll receive e.g.
AuthorI & AuthorII (2019)
diff --git a/plugins/lektor-creative-commons/index.html b/plugins/lektor-creative-commons/index.html
index 63a9fbfa..d497cae4 100644
--- a/plugins/lektor-creative-commons/index.html
+++ b/plugins/lektor-creative-commons/index.html
@@ -140,7 +140,7 @@
Lektor plugin to add Creative Commons license to your pages
Usage
On your templates use:
-<div class="license">{{ render_cc_license(type, size, template, caller) }}</div>
+<div class="license">{{ render_cc_license(type, size, template, caller) }}</div>
type
is a string
with the license type (e.g.: 'by'
, 'by-sa'
, 'by-nc-sa'
).
@@ -151,12 +151,12 @@
Examples
Simply rendering the license of your choice:
-<div class="license">{{ render_cc_license('by-sa') }}</div>
+<div class="license">{{ render_cc_license('by-sa') }}</div>
Using Jinja2 call block to inject your own template:
{% call(license, license_url, icon_path) render_cc_license('by-sa', size='normal') %}
- <a class="nav-item" rel="license" target="_blank" href="{{ license_url }}">
- <img alt="{{ license }}" style="border-width:0" src="{{ icon_path }}" />
+ <a class="nav-item" rel="license" target="_blank" href="{{ license_url }}">
+ <img alt="{{ license }}" style="border-width:0" src="{{ icon_path }}" />
</a>
{% endcall %}
diff --git a/plugins/lektor-disqus-comments/index.html b/plugins/lektor-disqus-comments/index.html
index a34741e7..0a889657 100644
--- a/plugins/lektor-disqus-comments/index.html
+++ b/plugins/lektor-disqus-comments/index.html
@@ -152,7 +152,7 @@ your disqus community:
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
get the comment box:
-<div class="comments">{{ render_disqus_comments() }}</div>
+<div class="comments">{{ render_disqus_comments() }}</div>
Optionally the function accepts a few arguemnts:
diff --git a/plugins/lektor-expression-type/index.html b/plugins/lektor-expression-type/index.html
index b85f3fc2..8d183af8 100644
--- a/plugins/lektor-expression-type/index.html
+++ b/plugins/lektor-expression-type/index.html
@@ -181,11 +181,11 @@ then in the page template (e.g. in templates/index.html
) one could
reference the items
field (e.g. {% for page in this.items %}
)
to determine which pages to display on the page.
Author
-Jeff Dairiki dairiki@dairiki.org
+Jeff Dairiki dairiki@dairiki.org
Changelog
0.1 — 2021-02-05
No code changes.
-Update development status classifier to "stable".
+Update development status classifier to "stable".
Fixes
- Include the correct LICENSE file.
diff --git a/plugins/lektor-git-timestamp/index.html b/plugins/lektor-git-timestamp/index.html
index 3cd88976..957f44f0 100644
--- a/plugins/lektor-git-timestamp/index.html
+++ b/plugins/lektor-git-timestamp/index.html
@@ -244,7 +244,7 @@ Unfortunately, the last released version of Lektor (as of August 12,
to install Lektor from git if you want to be able to sort records by
gittimestamp
.
Author
-Jeff Dairiki dairiki@dairiki.org
+Jeff Dairiki dairiki@dairiki.org
Changelog
Release 0.1.0.post1 (2021-08-12)
No code changes.
@@ -252,7 +252,7 @@ to install Lektor from git if you want to be able to sort records by
required in order to be able to sort records by gittimestamp
fields.
Release 0.1 (2021-02-05)
No code changes.
-Update development status classifier to "stable".
+Update development status classifier to "stable".
Add functional tests.
Release 0.1a2 (2021-02-03)
Bugs Fixed
diff --git a/plugins/lektor-google-analytics/index.html b/plugins/lektor-google-analytics/index.html
index a8cd1591..e464eee8 100644
--- a/plugins/lektor-google-analytics/index.html
+++ b/plugins/lektor-google-analytics/index.html
@@ -157,7 +157,7 @@ folder in your Lektor project’s base directory. And, put the
Using in Templates
Now you can add a Google analytics code-snippet in your templates by
just calling the generate_google_analytics function inside its <body> </body> tags.
-
<div class="ga-script">{{ generate_google_analytics() }}</div>
+<div class="ga-script">{{ generate_google_analytics() }}</div>
That’s it. All the HTML files that rendered from that template will
include Google-Analytics code automatically.
diff --git a/plugins/lektor-hal/index.html b/plugins/lektor-hal/index.html
index 9f122344..587c8266 100644
--- a/plugins/lektor-hal/index.html
+++ b/plugins/lektor-hal/index.html
@@ -131,17 +131,17 @@ can deposit scholarly documents from all academic fields.
In ./configs/hal.ini
, the query field must be specified, following to the
HAL docs
Example:
-query = ((authIdHal_s:my-id-hal) OR (authFullName_s:"My Name"))
+query = ((authIdHal_s:my-id-hal) OR (authFullName_s:"My Name"))
Usage
Example
-<ul class="publications" id="publications">
+<ul class="publications" id="publications">
{% for publi in hal_publications %}
<li>
<a href={{ publi.link }}>{{ publi.title }}</a>
@
{{ publi.where }} -
- {{ publi.authors|join(', ') }}
+ {{ publi.authors|join(', ') }}
({{ publi.date }})
</li>
{% endfor %}
@@ -158,7 +158,7 @@ HAL API.
hal_id
: The HAL ID of the publication
authors
: A list of strings (author names)
date
: A string (producedDate_s
)
-type
: The publication type, eg "ART", "COMM", "POSTER", etc/
+type
: The publication type, eg "ART", "COMM", "POSTER", etc/
and properties:
@@ -171,7 +171,7 @@ if missing)
Known caveat
Lektor will not 'know' that the page must be rebuilt when new entries are
returned by the HAL API request.
-As a workaround, the plugin allows to mark any page as "dirty", so it is rebuilt
+As a workaround, the plugin allows to mark any page as "dirty", so it is rebuilt
everytime. Add this to the template that uses the publications list:
{{ volatile() }}
diff --git a/plugins/lektor-image-resize/index.html b/plugins/lektor-image-resize/index.html
index bf278564..1f45b0d4 100644
--- a/plugins/lektor-image-resize/index.html
+++ b/plugins/lektor-image-resize/index.html
@@ -146,14 +146,14 @@ For example, you may have an image called waffle.jpg
, and to link t
All images will be converted to webp using Pillow.
You can use the images like that:
<!-- Simple example -->
-<a href="waffle.jpg"><img src="waffle-small.jpg" /></a>
+<a href="waffle.jpg"><img src="waffle-small.jpg" /></a>
<!-- example with srcset -->
-<a href="waffle-small.webp">
- <img src="waffle-small.webp"
- srcset="waffle-small.webp 640w, // Viewport bis zu 640
+<a href="waffle-small.webp">
+ <img src="waffle-small.webp"
+ srcset="waffle-small.webp 640w, // Viewport bis zu 640
waffle-medium.webp 1280w, // Viewport größer als 1280
- waffle-woowee.webp 1920w" // Viewport größer als 1920
+ waffle-woowee.webp 1920w" // Viewport größer als 1920
/>
</a>
diff --git a/plugins/lektor-index-pages/index.html b/plugins/lektor-index-pages/index.html
index 595ab420..c1a24df3 100644
--- a/plugins/lektor-index-pages/index.html
+++ b/plugins/lektor-index-pages/index.html
@@ -157,7 +157,7 @@ the build process down too excruciatingly much.
PyPI
Author
-Jeff Dairiki dairiki@dairiki.org
+Jeff Dairiki dairiki@dairiki.org
Changelog
Release 1.1.0 (2023-06-16)
@@ -193,7 +193,7 @@ the build process down too excruciatingly much.
Release 0.1 (2021-02-05)
No code changes.
-Update development status classifier to "stable".
+Update development status classifier to "stable".
Release 0.1a3 (2020-05-08)
API changes
diff --git a/plugins/lektor-jinja-content/index.html b/plugins/lektor-jinja-content/index.html
index 4d124515..4deb25cb 100644
--- a/plugins/lektor-jinja-content/index.html
+++ b/plugins/lektor-jinja-content/index.html
@@ -153,7 +153,7 @@
{% if meaning_of_life == meaning_of_universe == 42 %}
{% set meaning_of_it_all = meaning_of_life %}
{% else %}
- {% set meaning_of_it_all = 'Undefined' %}
+ {% set meaning_of_it_all = 'Undefined' %}
{% endif %}
{{ meaning_of_it_all }}
diff --git a/plugins/lektor-limit-dependencies/index.html b/plugins/lektor-limit-dependencies/index.html
index 67cb2c6f..aae99abb 100644
--- a/plugins/lektor-limit-dependencies/index.html
+++ b/plugins/lektor-limit-dependencies/index.html
@@ -133,8 +133,8 @@ in the sidebar of your Lektor-based site. This can be done by adding
something like to your site base template:
<h3>Recent Posts</h3>
<ul>
- {% for post in site.query('/blog').order_by('-pub_date').limit(3) %}
- <li><a href="{{ post|url }}">{{ post.title }}</a></li>
+ {% for post in site.query('/blog').order_by('-pub_date').limit(3) %}
+ <li><a href="{{ post|url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
@@ -177,8 +177,8 @@ most-recent posts.)
Thus, the example above, if replaced by:
<h3>Recent Posts</h3>
<ul>
- {% for post in site.query('/blog').order_by('-pub_date').limit(3)|limit_dependencies %}
- <li><a href="{{ post|url }}">{{ post.title }}</a></li>
+ {% for post in site.query('/blog').order_by('-pub_date').limit(3)|limit_dependencies %}
+ <li><a href="{{ post|url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
@@ -191,7 +191,7 @@ of the three most recent posts.
See the Lektor plugin documentation for more information.
Author
-Jeff Dairiki dairiki@dairiki.org
+Jeff Dairiki dairiki@dairiki.org
Changelog
Release 1.0.0 (2023-01-31)
No code changes from 1.0.0b1.
@@ -200,7 +200,7 @@ of the three most recent posts.
Drop support for python<3.7 and lektor<3.3.
Release 0.1 (2021-02-05)
No code changes.
-Update development status classifier to "stable".
+Update development status classifier to "stable".
Test under python 3.9. Stop testing under 3.5.
Release 0.1a1 (2020-05-19)
Initial release.
diff --git a/plugins/lektor-markdown-admonition/index.html b/plugins/lektor-markdown-admonition/index.html
index a73d4bbe..6b5a7f94 100644
--- a/plugins/lektor-markdown-admonition/index.html
+++ b/plugins/lektor-markdown-admonition/index.html
@@ -158,19 +158,19 @@ inspired by the extension in Python Markdown but simplified.
!
-<div class="admonition admonition-note">
+<div class="admonition admonition-note">
!!
-<div class="admonition admonition-info">
+<div class="admonition admonition-info">
!!!
-<div class="admonition admonition-tip">
+<div class="admonition admonition-tip">
!!!!
-<div class="admonition admonition-warning">
+<div class="admonition admonition-warning">
diff --git a/plugins/lektor-markdown-header-anchors/index.html b/plugins/lektor-markdown-header-anchors/index.html
index 1b057b3f..01691377 100644
--- a/plugins/lektor-markdown-header-anchors/index.html
+++ b/plugins/lektor-markdown-header-anchors/index.html
@@ -159,9 +159,9 @@ markdown data. It's a list where each item has the following attributes:
Example rendering:
<h4>Table Of Contents</h4>
-<ul class="toc">
+<ul class="toc">
{% for item in this.body.toc recursive %}
- <li><a href="#{{ item.anchor }}">{{ item.title }}</a>{%
+ <li><a href="#{{ item.anchor }}">{{ item.title }}</a>{%
if item.children %}<ul>{{ loop(item.children) }}</ul>{% endif %}</li>
{% endfor %}
</ul>
diff --git a/plugins/lektor-markdown-highlighter/index.html b/plugins/lektor-markdown-highlighter/index.html
index ed72659d..4f083d9b 100644
--- a/plugins/lektor-markdown-highlighter/index.html
+++ b/plugins/lektor-markdown-highlighter/index.html
@@ -152,22 +152,22 @@ for Pygments. Just create a file named markdown-highlighter.ini
in
You can use this to select any of the built-in Pygments styles. Support for
custom styles will come in the future.
-The config file is considered the "source" for the Pygments stylesheet, so you must create the configuration file (it can be empty) or Lektor's build will prune pygments.css
.
+The config file is considered the "source" for the Pygments stylesheet, so you must create the configuration file (it can be empty) or Lektor's build will prune pygments.css
.
In Markdown
To use the syntax highlighter you need to use fenced blocks and pass the name
of the pygments lexer after the opening fence:
```python
-print("Hello World!")
+print("Hello World!")
```
In Templates
In templates the plugin provides the get_pygments_stylesheet
function which
can be used to generate and retrieve a link to the pygments stylesheet:
-<link rel="stylesheet" href="{{ get_pygments_stylesheet()|url }}">
+<link rel="stylesheet" href="{{ get_pygments_stylesheet()|url }}">
In addition the |pygmentize
filter can be used to highlight code from
templates. It takes one argument which is the lexer name:
-{{ 'print "Hello World!"'|pygmentize('python') }}
+{{ 'print "Hello World!"'|pygmentize('python') }}
diff --git a/plugins/lektor-markdown-ruby-blocks/index.html b/plugins/lektor-markdown-ruby-blocks/index.html
index 4fa31fe4..ae6f388f 100644
--- a/plugins/lektor-markdown-ruby-blocks/index.html
+++ b/plugins/lektor-markdown-ruby-blocks/index.html
@@ -128,14 +128,14 @@ HTML ruby tags to Markdown.
^^
This will generate the following HTML:
-<span class="ruby-line">
+<span class="ruby-line">
<ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
The rendering result:
- <ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
+ 歩(ある)く
You can combine adjacent ruby text like this:
@@ -144,15 +144,15 @@ HTML ruby tags to Markdown.
^^
And this will be rendered like this:
-<span class="ruby-line">
+<span class="ruby-line">
<ruby>自<rp>(</rp><rt>じ</rt><rp>)</rp></ruby>
<ruby>分<rp>(</rp><rt>ぶん</rt><rp>)</rp></ruby>
</span>
Rendered output:
- <ruby>自<rp>(</rp><rt>じ</rt><rp>)</rp></ruby>
- <ruby>分<rp>(</rp><rt>ぶん</rt><rp>)</rp></ruby>
+ 自(じ)
+ 分(ぶん)
Newline
This plugin will automatically add <br />
between each line in a ruby-block:
@@ -162,11 +162,11 @@ HTML ruby tags to Markdown.
^^
This will output:
-<span class="ruby-line">
+<span class="ruby-line">
<ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
<br />
-<span class="ruby-line">
+<span class="ruby-line">
<ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
@@ -178,12 +178,12 @@ HTML ruby tags to Markdown.
^^
Output:
-<span class="ruby-line">
+<span class="ruby-line">
<ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
<br />
<br />
-<span class="ruby-line">
+<span class="ruby-line">
<ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
@@ -196,12 +196,12 @@ with specified color.
^^
This will generate the following HTML pieces:
-<span class="ruby-line" style="color: #44cc00">
+<span class="ruby-line" style="color: #44cc00">
<ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
Raw lines
-Prepend %
to create a raw line. Raw lines are not converted to ruby tags,
+
Prepend %
to create a raw line. Raw lines are not converted to ruby tags,
not affected by the color settings, and have a different class.
Example:
^^#44cc00
@@ -210,11 +210,11 @@ not affected by the color settings, and have a different class.
^^
Output:
-<span class="ruby-line" style="color: #44cc00">
+<span class="ruby-line" style="color: #44cc00">
<ruby>歩<rp>(</rp><rt>ある</rt><rp>)</rp></ruby>く
</span>
<br />
-<span class="non-ruby-line">
+<span class="non-ruby-line">
(aru)[ku]
</span>
diff --git a/plugins/lektor-netlify/index.html b/plugins/lektor-netlify/index.html
index 0d6e2580..0d4f9703 100644
--- a/plugins/lektor-netlify/index.html
+++ b/plugins/lektor-netlify/index.html
@@ -142,7 +142,7 @@
target = netlify://my-domain.com
Access Token
-Get a personal access token from Netlify's "applications" page:
+Get a personal access token from Netlify's "applications" page:
diff --git a/plugins/lektor-npm-support/index.html b/plugins/lektor-npm-support/index.html
index 7065119f..2ac0b7b0 100644
--- a/plugins/lektor-npm-support/index.html
+++ b/plugins/lektor-npm-support/index.html
@@ -179,13 +179,13 @@
parcel/package.json
This is a standard package.json
file. It should contain two entries in the scripts
section. The build
script is used during lektor build -f npm
, and the watch
script is used during lektor server -f npm
.
{
- "name": "my-parcel-project",
- "version": "1.0.0",
- "scripts": {
- "watch": "NODE_ENV=development parcel --out-dir=../assets/static/gen --out-file=main.js --public-url=./assets/ main.js",
- "build": "NODE_ENV=production parcel build --out-dir=../assets/static/gen --out-file=main.js --public-url=./assets/ main.js"
+ "name": "my-parcel-project",
+ "version": "1.0.0",
+ "scripts": {
+ "watch": "NODE_ENV=development parcel --out-dir=../assets/static/gen --out-file=main.js --public-url=./assets/ main.js",
+ "build": "NODE_ENV=production parcel build --out-dir=../assets/static/gen --out-file=main.js --public-url=./assets/ main.js"
},
- "private": true
+ "private": true
}
Now we can use yarn add
to add Parcel, Babel and Sass:
@@ -195,7 +195,7 @@ $ yarn add parcel-bundler babel-preset-env node-sass
parcel/babelr.rc
Next up is a simple Babel config file, using the recommended env
preset.
{
- "presets": ["env"]
+ "presets": ["env"]
}
parcel/main.scss
@@ -206,7 +206,7 @@ $ yarn add parcel-bundler babel-preset-env node-sass
parcel/main.js
A simple Javascript file that imports the SCSS file so that Parcel will know to include it as well.
-import './main.scss';
+import './main.scss';
Running the Server
Now you're ready to go. When you run lektor server
nothing wil happen,
@@ -220,8 +220,8 @@ Lektor website that use this plugin.
To manually trigger a build that also invokes webpack you can use lektor build -f npm
.
Including The Files
Now you need to include the files in your template. This will do it:
-<link rel="stylesheet" href="{{ '/static/gen/main.css'| asseturl }}">
-<script type=text/javascript src="{{ '/static/gen/main.js'| asseturl }}" charset="utf-8"></script>
+<link rel="stylesheet" href="{{ '/static/gen/main.css'| asseturl }}">
+<script type=text/javascript src="{{ '/static/gen/main.js'| asseturl }}" charset="utf-8"></script>
Complete Working Example
The examples
folder of this repository contains working projects.
diff --git a/plugins/lektor-polymorphic-type/index.html b/plugins/lektor-polymorphic-type/index.html
index 1c83ee3d..47bf5114 100644
--- a/plugins/lektor-polymorphic-type/index.html
+++ b/plugins/lektor-polymorphic-type/index.html
@@ -188,17 +188,17 @@ determine whether the body
field is interpreted as being mark
[fields.body]
label = Body
type = polymorphic
-polymorphic_type = 'html' if this.body.lstrip().startswith('<') else 'markdown'
+polymorphic_type = 'html' if this.body.lstrip().startswith('<') else 'markdown'
In this case, the body
field will be interpreted as raw HTML if the
content of that field starts with a “<
”, otherwise it will be
interpreted as Markdown text.
Author
-Jeff Dairiki dairiki@dairiki.org
+Jeff Dairiki dairiki@dairiki.org
Changelog
0.1 — 2021-02-05
No code changes.
-Update development status classifier to "stable".
+Update development status classifier to "stable".
Test under python 3.9. Stop testing under 3.5.
0.1b1 — 2020-05-04
Initial release.
diff --git a/plugins/lektor-qiniu/index.html b/plugins/lektor-qiniu/index.html
index 33354d8a..5137f803 100644
--- a/plugins/lektor-qiniu/index.html
+++ b/plugins/lektor-qiniu/index.html
@@ -163,7 +163,7 @@
enabled = yes
target = qiniu://<YOUR-BUCKET>/<NAME-OF-FOLDER>
-for example, if you want to deploy your site to a bucket name "abcde", folder "fjhi", you will need to add a server section as below:
+for example, if you want to deploy your site to a bucket name "abcde", folder "fjhi", you will need to add a server section as below:
[servers.qiniu]
name = qiniu
enabled = yes
diff --git a/plugins/lektor-root-relative-path/index.html b/plugins/lektor-root-relative-path/index.html
index 84f38c90..83121ee7 100644
--- a/plugins/lektor-root-relative-path/index.html
+++ b/plugins/lektor-root-relative-path/index.html
@@ -145,7 +145,7 @@
How to use
Insert the following line in the template (e.g. layout.html) which you would like to show navigation.
{% for i in this._path | root_relative_path_list %}
- >><a href="{{i[0]}}">{{i[1]}}</a>
+ >><a href="{{i[0]}}">{{i[1]}}</a>
{% endfor %}
Then, navigation is shown as below in case the page 'blog/first-post/'
@@ -154,7 +154,7 @@
If you do not want to show current page in the navigation, modify template as below.
{% for i in this._path | root_relative_path_list %}
{% if not loop.last %}
- >><a href="{{i[0]}}">{{i[1]}}</a>
+ >><a href="{{i[0]}}">{{i[1]}}</a>
{% endif %}
{% endfor %}
diff --git a/plugins/lektor-shortcodes/index.html b/plugins/lektor-shortcodes/index.html
index 7c71b2bd..8d5e2f5e 100644
--- a/plugins/lektor-shortcodes/index.html
+++ b/plugins/lektor-shortcodes/index.html
@@ -140,17 +140,17 @@ something like custom tags) in your fields (not templates), so your content
doesn't have to have repetitive snippets over and over.
For example, my blog has some specific HTML that I add when I want an image with
a border and caption to be displayed. The HTML looks like this:
- <div class="alignright">
- <a href="image-large.jpg">
- <img src="image.jpg" />
- <span class="caption">The caption</span>
+ <div class="alignright">
+ <a href="image-large.jpg">
+ <img src="image.jpg" />
+ <span class="caption">The caption</span>
</a>
</div>
Copy-pasting this every time gets tedious, and I have to search and replace it
in all the content files every time I want to make a change. With the
shortcodes plugin, this can be written as:
-[% image align=right link="image-large.jpg" image=image.jpg caption="The caption" %]
+[% image align=right link="image-large.jpg" image=image.jpg caption="The caption" %]
Much easier, cleaner and less repetitive.
Installation
@@ -165,7 +165,7 @@ full Jinja templates, although (due to some limitations of ini files) they need
to be on one line.
For instance, for the example above, the config file could be:
[global]
-image = '<div class="align{{ align }}">{% if link %}<a href="{{ link }}"{% if not link.startswith("http") %} data-lightbox="gallery"{% endif %}>{% endif %}<img src="{{ image }}">{% if link %}</a>{% endif %}{% if caption %}<span class="caption">{{ caption }}</span>{% endif %}</div>'
+image = '<div class="align{{ align }}">{% if link %}<a href="{{ link }}"{% if not link.startswith("http") %} data-lightbox="gallery"{% endif %}>{% endif %}<img src="{{ image }}">{% if link %}</a>{% endif %}{% if caption %}<span class="caption">{{ caption }}</span>{% endif %}</div>'
This will allow you to use shortcodes with optional arguments, like so:
# An image with no caption or link:
@@ -176,7 +176,7 @@ to be on one line.
[% image align=right link=http://www.example.com image=hello.jpg %]
# Link and caption:
-[% image align=right link=http://www.example.com image=hello.jpg caption="Hello!" %]
+[% image align=right link=http://www.example.com image=hello.jpg caption="Hello!" %]
Shortcodes defined within the section named global
will be processed
automatically inside any of your site’s Markdown content. It is also possible to
@@ -186,7 +186,7 @@ will only be applied when the template passed the content through a Jinja2
filter named shortcode
. For example, if your HTML template references a field
called body
, and your config has a section called [special]
, you may request
expanding shortcodes defined within the special
section like so:
-{{ body|shortcodes(section="special") }}
+{{ body|shortcodes(section="special") }}
This will enable all shortcodes from the specified section, in addition to all
globally defined shortcodes. If no section is specified, the filter defaults to
diff --git a/plugins/lektor-strip-html-tags/index.html b/plugins/lektor-strip-html-tags/index.html
index d2a345ae..eb1de321 100644
--- a/plugins/lektor-strip-html-tags/index.html
+++ b/plugins/lektor-strip-html-tags/index.html
@@ -131,10 +131,10 @@
This is a simple Lektor plugin that creates a template filter to remove HTML tags from a string. The use it was created for was to do processing on HTML outputted from a Markdown content field. The Markdown is rendered into HTML, and this filter can turn that into simple text, which was then passed to the lektor-natural-language filters to get keywords, unsullied by things like <div>
tags.
Example usage:
{{ this.body|striphtmltags }}
-{% set var = '<p><strong>Hello</strong>World!</p>' %}
+{% set var = '<p><strong>Hello</strong>World!</p>' %}
{{ var|striphtmltags }}
-The last example will render as "Hello World!"
+The last example will render as "Hello World!"
diff --git a/plugins/lektor-tags/index.html b/plugins/lektor-tags/index.html
index a058463e..fa444923 100644
--- a/plugins/lektor-tags/index.html
+++ b/plugins/lektor-tags/index.html
@@ -155,7 +155,7 @@ tea
See the Lektor documentation for more instructions on installing plugins.
Overview
-Say you have a "blog-post" model like this:
+Say you have a "blog-post" model like this:
[model]
name = Blog Post
@@ -167,7 +167,7 @@ tea
<ul>
{% for t in this.tags -%}
<li>
- <a href="{{ ('/blog@tag/' ~ t)|url }}">
+ <a href="{{ ('/blog@tag/' ~ t)|url }}">
All posts tagged {{ t }}
</a>
</li>
@@ -176,13 +176,13 @@ tea
{% endif %}
This expression in the template generates a source path for each of the blog post's tags:
-'/blog@tag/' ~ t
+'/blog@tag/' ~ t
-Then if the tag is "my-tag", the expression renders a source path like:
+Then if the tag is "my-tag", the expression renders a source path like:
/blog/tag/my-tag
A Lektor source path becomes an actual URL using the url
filter. So the template generates URLs to tag pages like:
-<a href="{{ ('/blog@tag/' ~ t)|url }}"></a>
+<a href="{{ ('/blog@tag/' ~ t)|url }}"></a>
This uses the source path expression from before, but pipes it through url
to generate an actual link from the blog post to a tag page.
Configuration
@@ -202,7 +202,7 @@ tea
items = this.parent.children.filter(F.tags.contains(tag))
You can sort and filter with any expression:
-items = this.parent.children.filter(F.tags.contains(tag) and F.status == 'published').order_by('-pub_date')
+items = this.parent.children.filter(F.tags.contains(tag) and F.status == 'published').order_by('-pub_date')
If the parent page has a pagination query you may want to use it for tagged pages:
items = this.parent.pagination.items.filter(F.tags.contains(tag))
@@ -223,7 +223,7 @@ tea
<h1>Items:</h1>
<ul>
{% for i in this.items %}
- <li><a href="{{ i|url }}">{{ i._id }}</a></li>
+ <li><a href="{{ i|url }}">{{ i._id }}</a></li>
{% else %}
<li><em>No items.</em></li>
{% endfor %}
@@ -242,27 +242,27 @@ tea
Default false. To set true, add this line to tags.ini
:
ignore_missing = true
-This allows URLs to missing tag pages to be silently replaced with "". The example use case is if your blog-post.html
template includes a statement like:
+This allows URLs to missing tag pages to be silently replaced with "". The example use case is if your blog-post.html
template includes a statement like:
{% for t in this.tags -%}
- <a href="{{ ('/blog@tag/' ~ t)|url }}">{{ t }}</a>
+ <a href="{{ ('/blog@tag/' ~ t)|url }}">{{ t }}</a>
{% endfor %}
-If a blog post draft is not discoverable, and it has any new tags used by no published blog posts, then those tag pages do not yet exist. Turn on ignore_missing
to allow such drafts to be built. The tag-page URL path will be the empty string "", until the draft is published and the tag page is created.
+If a blog post draft is not discoverable, and it has any new tags used by no published blog posts, then those tag pages do not yet exist. Turn on ignore_missing
to allow such drafts to be built. The tag-page URL path will be the empty string "", until the draft is published and the tag page is created.
tags
Advanced configuration. An expression for the set of tags. Note that this expression is also useful in a template to get a list of all tags. The default expression is:
-tags = parent.children.distinct("tags")
+tags = parent.children.distinct("tags")
-If you set tags_field
to a different field name than "tags", the default expression uses your custom field name. For example if you have this line in tags.ini
:
+If you set tags_field
to a different field name than "tags", the default expression uses your custom field name. For example if you have this line in tags.ini
:
tags_field = labels
Then the default value of tags
is:
-tags = parent.children.distinct("labels")
+tags = parent.children.distinct("labels")
-You can use any template expression. For example, if your items have a "published" boolean field, you can select tags of published items:
-tags = parent.children.filter(F.published).distinct("tags")
+You can use any template expression. For example, if your items have a "published" boolean field, you can select tags of published items:
+tags = parent.children.filter(F.published).distinct("tags")
Or even list your tags manually:
-tags = ["tag1", "tag2"]
+tags = ["tag1", "tag2"]
See the Lektor documentation for queries.
Tags are always deduplicated. Tags are sorted in the order listed in the contents.lr / admin, allowing you to control their order manually. Since {{ tags }}
simply returns a list, you can always apply any Jinja2 filter on that list such as sort, slice, or rejectattr.
@@ -280,7 +280,7 @@ tea
This is the basic weight, used as a base for the following tags.
Example: Tags (with tag count) sorted by tag count (most used first)
<ul>
-{% for tag, weight in (tagweights() | dictsort(by='value', reverse=true)) %}
+{% for tag, weight in (tagweights() | dictsort(by='value', reverse=true)) %}
<li>{{ tag }} ({{ weight.count }} articles).</li>
{% endfor %}
</ul>
@@ -297,8 +297,8 @@ tea
Example: Most used tag is twice as big as least used tag
{% for tag, weight in tagweights()|dictsort %}
<a
- href="{{ ('/blog@tag/' ~ tag)|url }}"
- style="font-size: {{ weight.log(100, 200)|round|int }}%;"
+ href="{{ ('/blog@tag/' ~ tag)|url }}"
+ style="font-size: {{ weight.log(100, 200)|round|int }}%;"
>
{{ tag }}
</a>
@@ -314,8 +314,8 @@ tea
Example: Tags are given CSS classes tagcloud-tiny
, tagcloud-small
, etc.
{% for tag, weight in tagweights()|dictsort %}
<a
- href="{{ ('/blog@tag/' ~ tag)|url }}"
- class="tagcloud-{{ weight.loggroup(["tiny", "small", "normal", "big", "large"]) }}"
+ href="{{ ('/blog@tag/' ~ tag)|url }}"
+ class="tagcloud-{{ weight.loggroup(["tiny", "small", "normal", "big", "large"]) }}"
>
{{ tag }}
</a>
diff --git a/plugins/lektor-tailwind/index.html b/plugins/lektor-tailwind/index.html
index 8cada24f..5d03fc39 100644
--- a/plugins/lektor-tailwind/index.html
+++ b/plugins/lektor-tailwind/index.html
@@ -144,7 +144,7 @@ $ lektor plugin
Configure your template paths
In tailwindcss.config.js
:
module.exports = {
- content: ['./templates/**/*.{html,j2}'],
+ content: ['./templates/**/*.{html,j2}'],
theme: {
extend: {},
},
diff --git a/plugins/lektor-thumbnail-generator/index.html b/plugins/lektor-thumbnail-generator/index.html
index 5b2c9c99..1b1062e9 100644
--- a/plugins/lektor-thumbnail-generator/index.html
+++ b/plugins/lektor-thumbnail-generator/index.html
@@ -135,7 +135,7 @@ content, but still want thumbnails to be generated for the link itself. For
example, you may have an image called cat.jpg
, and to link to it in the
content (not the template), but also show a thumbnail.
You can do that like so:
-<a href="cat.jpg"><img src="cat-small.jpg" /></a>
+<a href="cat.jpg"><img src="cat-small.jpg" /></a>
Installation
To install the plugin, just add lektor-thumbnail-generator
to your plugins
diff --git a/plugins/lektor-webpack-html-helper/index.html b/plugins/lektor-webpack-html-helper/index.html
index 6bdf1a29..229627aa 100644
--- a/plugins/lektor-webpack-html-helper/index.html
+++ b/plugins/lektor-webpack-html-helper/index.html
@@ -138,34 +138,34 @@
These files will then be copied over to Lektors templates folder so that they can be used by Lektor.
This plugin depends on the lektor-webpack-support plugin to be really useful.
webpack/webpack.config.js
-const path = require("path");
-const MiniCssExtractPlugin = require("mini-css-extract-plugin");
-const HtmlWebpackPlugin = require("html-webpack-plugin");
-const { CleanWebpackPlugin } = require("clean-webpack-plugin");
+const path = require("path");
+const MiniCssExtractPlugin = require("mini-css-extract-plugin");
+const HtmlWebpackPlugin = require("html-webpack-plugin");
+const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
- mode: "production",
+ mode: "production",
entry: {
- main: "./src/index.js"
+ main: "./src/index.js"
},
output: {
- filename: "[name].bundle.js",
- path: path.dirname(__dirname) + "/assets/generated"
+ filename: "[name].bundle.js",
+ path: path.dirname(__dirname) + "/assets/generated"
},
optimization: {
minimizer: [
new HtmlWebpackPlugin({
inject: false,
- filename: "layout_generated.html",
- template: "./src/layout_template.html"
+ filename: "layout_generated.html",
+ template: "./src/layout_template.html"
})
],
},
plugins: [
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
- filename: "[name].css"
+ filename: "[name].css"
})
],
module: {
@@ -173,8 +173,8 @@ This plugin depends on the
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
- "css-loader",
- "sass-loader"
+ "css-loader",
+ "sass-loader"
]
}]
}
@@ -182,16 +182,16 @@ This plugin depends on the <!DOCTYPE html>
-<html lang="en">
+<html lang="en">
<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{{ this.title }} · {{ config.PROJECT.name }} </title>
<% for (var css in htmlWebpackPlugin.files.css) { %>
- <link href="{{ '/generated/<%= htmlWebpackPlugin.files.css[css] %>' | asseturl }}" rel="stylesheet">
+ <link href="{{ '/generated/<%= htmlWebpackPlugin.files.css[css] %>' | asseturl }}" rel="stylesheet">
<% } %>
</head>
@@ -202,7 +202,7 @@ This plugin depends on the </main>
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
- <script src="{{ '/generated/<%= htmlWebpackPlugin.files.chunks[chunk].entry %>' | asseturl }}"></script>
+ <script src="{{ '/generated/<%= htmlWebpackPlugin.files.chunks[chunk].entry %>' | asseturl }}"></script>
<% } %>
</body>
diff --git a/plugins/lektor-webpack-support/index.html b/plugins/lektor-webpack-support/index.html
index 5af46601..c92c5b85 100644
--- a/plugins/lektor-webpack-support/index.html
+++ b/plugins/lektor-webpack-support/index.html
@@ -163,9 +163,9 @@ inside that folder create package.json
and a webpack.config.j
start is to create an almost empty file (name and version fields are mandatory
but not important for functionality, change them to suit your own needs):
{
- "name": "lektor-webpack",
- "version": "1.0.0",
- "private": true
+ "name": "lektor-webpack",
+ "version": "1.0.0",
+ "private": true
}
Now we can npm install
(or yarn add
) the rest:
@@ -182,42 +182,42 @@ setup that's good enough to cover most things you will encounter. The
idea is to build the files from webpack/scss
and webpack/js
into
assets/static/gen
so that we can use it even if we do not have webpack
installed for as long as someone else ran it before.
-const path = require("path");
-const MiniCssExtractPlugin = require("mini-css-extract-plugin");
+const path = require("path");
+const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = = {
entry: {
- app: "./js/main.js",
- styles: "./scss/main.scss",
+ app: "./js/main.js",
+ styles: "./scss/main.scss",
},
output: {
- path: path.join(path.dirname(__dirname), "assets", "static", "gen"),
- filename: "[name].js",
+ path: path.join(path.dirname(__dirname), "assets", "static", "gen"),
+ filename: "[name].js",
},
- devtool: "source-map",
- mode: "production",
+ devtool: "source-map",
+ mode: "production",
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
- use: ["babel-loader"],
+ use: ["babel-loader"],
},
{
test: /\.scss$/,
- use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
+ use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
},
{
test: /\.css$/,
- use: [MiniCssExtractPlugin.loader, "css-loader"],
+ use: [MiniCssExtractPlugin.loader, "css-loader"],
},
{
test: /\.(woff2?|ttf|eot|svg|png|jpe?g|gif)$/,
- use: ["file"],
+ use: ["file"],
},
],
},
- plugins: [new MiniCssExtractPlugin({ filename: "styles.css" })],
+ plugins: [new MiniCssExtractPlugin({ filename: "styles.css" })],
};
Creating the App
@@ -238,8 +238,8 @@ Lektor website that uses webpack.
lektor build -f webpack
.
Including The Files
Now you need to include the files in your template. This will do it:
-<link rel="stylesheet" href="{{ '/static/gen/styles.css'|asseturl }}">
-<script type=text/javascript src="{{ '/static/gen/app.js'|asseturl }}" charset="utf-8"></script>
+<link rel="stylesheet" href="{{ '/static/gen/styles.css'|asseturl }}">
+<script type=text/javascript src="{{ '/static/gen/app.js'|asseturl }}" charset="utf-8"></script>