diff --git a/index.html b/index.html index 04a21000..c23512de 100644 --- a/index.html +++ b/index.html @@ -151,7 +151,7 @@ speak multiple languages and allow you to easily create localized websites.
Inspired by the atom-feed-support plugin Armin Ronacher wrote for the Lektor official blog.
Add lektor-atom to your project from command line:
-lektor plugins add lektor-atom +lektor plugins add lektor-atomSee the Lektor documentation for more instructions on installing plugins.
Configuration
Here is a basic configuration:
-[feed] +[feed] name = My Site's Blog source_path = /blog url_path = /feed.xmlFor each feed you want to publish, add a section to
-configs/atom.ini
. For example, a blog with a feed of all recent posts, and a feed of recent posts about coffee:[blog] +[blog] name = My Blog source_path = / url_path = /feed.xml @@ -243,7 +243,7 @@Customizing the plugin for your models
Use the field options to tell lektor-atom how to read your items. For example, if your site's model is:
-[model] +[model] name = Blog [fields.writer] @@ -253,7 +253,7 @@ type = stringThen add to atom.ini:
-[main] +[main] blog_author_field = writer blog_summary_field = short_description@@ -263,7 +263,7 @@Set
items
to any query expression to override the default. Ifitems_model
is also specified, lektor-atom applies it as a filter toitems
.Use In Templates
You can link to a specific feed in your template. If your
-atom.ini
contains a feed like this:[main] +[main] source_path = /blogLink to the feed in a template like this:
diff --git a/plugins/lektor-disqus-comments/index.html b/plugins/lektor-disqus-comments/index.html index 933bdc73..9aff6e96 100644 --- a/plugins/lektor-disqus-comments/index.html +++ b/plugins/lektor-disqus-comments/index.html @@ -139,20 +139,20 @@ enabled arender_disqus_comments
function which can render a disqus box.Enabling the Plugin
To enable the plugin add this to your project file:
-$ lektor plugins add lektor-disqus-comments +$ lektor plugins add lektor-disqus-commentsConfiguring the Plugin
The plugin has a config file that is needed to inform it about your website. Just create a file named
-disqus-comments.ini
into yourconfigs/
folder and configure theshortname
key with the name of your disqus community:shortname = YOUR_SHORTNAME +shortname = YOUR_SHORTNAMEIn 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 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:
models/index.ini
):
-[model] +[model] name = Index Page label = Index: {{ this.title}} diff --git a/plugins/lektor-git-timestamp/index.html b/plugins/lektor-git-timestamp/index.html index c4d1d677..723c2bd9 100644 --- a/plugins/lektor-git-timestamp/index.html +++ b/plugins/lektor-git-timestamp/index.html @@ -190,7 +190,7 @@ this will select the minimum of all the timestamps remaining after any filteringExamples
Here is a simple example excerpt from a datamodel file:
-<...> +<...> [fields.last_mod] label = Time last modified @@ -203,7 +203,7 @@ affected thatcontents.lr
. (Or if that file is dirty, the value oflast_mod
will be taken from the file’s filesystem mtime.)
Here is a more complicated example which demonstrates the use of all the options.
-<...> +<...> [fields.pub_date] label = Time first published diff --git a/plugins/lektor-google-analytics/index.html b/plugins/lektor-google-analytics/index.html index 89c5fbcf..222d5d14 100644 --- a/plugins/lektor-google-analytics/index.html +++ b/plugins/lektor-google-analytics/index.html @@ -135,16 +135,16 @@ is available to be included in target template which automatically include Google-Analytics code in final HTML files rendered by Lektor. -+Basic Usage
-+-Enabling the Plugin
To enable the plugin add this to your project file:
[packages] lektor-google-analytics = 0.1+-Configuring the Plugin
The plugin needs a config file with your Google analytics code in it.
@@ -155,7 +155,7 @@ folder in your Lektor project’s base directory. And, put theGOOGLE_ANALYTICS_ID = UA-XXXXXXXX-Y+-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.
@@ -165,7 +165,7 @@ just calling the generate_google_analytics function inside its < include Google-Analytics code automatically.+Advanced
- You can use GOOGLE_ANALYTICS_PROPERTY property to include your
diff --git a/plugins/lektor-google-search/index.html b/plugins/lektor-google-search/index.html index c91ccf73..2268f680 100644 --- a/plugins/lektor-google-search/index.html +++ b/plugins/lektor-google-search/index.html @@ -140,7 +140,7 @@ include Google-Search code in final HTML fles rendered by Lektor.How to Use the plugin ?
Enable the plugin
To enable the plugin, add the following to your
-.lektorproject
file:[packages] +[packages] lektor-google-search = 0.1Configure the plugin
@@ -149,11 +149,11 @@ include Google-Search code in final HTML fles rendered by Lektor.Create a file named google-serch.ini
into./configs
folder in your lektor project's base directory.Put the -SEARCH_ENGINE_ID
key with the value of your serch engine ID.SEARCH_ENGINE_ID = 83892839209432084 +SEARCH_ENGINE_ID = 83892839209432084Usage in template
Add Google Search code snippet by calling the function
-render_google_search()
in the template of your preference where you want the search box to appear.<div>{{ render_googe_search() }}</div> +<div>{{ render_googe_search() }}</div>Now, try to run
diff --git a/plugins/lektor-gulp/index.html b/plugins/lektor-gulp/index.html index 5d38d2b8..88b13d15 100644 --- a/plugins/lektor-gulp/index.html +++ b/plugins/lektor-gulp/index.html @@ -144,7 +144,7 @@ enabled with the -f gulp flag it runs npm gulp default or watch tasks as they are defined into your own gulpfile.js.lektor server
to see the google search appear.The general documentation about Lektor plugins is here.
-+-lektor build
The command lektor build -f gulp runs the ``default`` gulp task, for example defined as something like:
@@ -154,7 +154,7 @@ gulp.task('default', ['build'], () => { });In the above example the default task points to a build task, which is usually composed by several other gulp tasks, etc.
+-lektor server
The command lektor server -f gulp runs the Lektor embedded server on http://localhost:5000, starting a gulp ``watch`` task in background. @@ -169,7 +169,7 @@ the lib/ folder then assets could be minified, concatenated and copied into the standard assets/static/ lektor folder, or whatever is defined into your own gulpfile.js.
+Credits
This plugin is based on the official Webpack plugin with very little differences.
diff --git a/plugins/lektor-htmlmin/index.html b/plugins/lektor-htmlmin/index.html index e13bb49f..b749887a 100644 --- a/plugins/lektor-htmlmin/index.html +++ b/plugins/lektor-htmlmin/index.html @@ -134,7 +134,7 @@HTML minifier for Lektor that automatically minifies generated .html files.
Uses htmlmin and looks for .html files, minifying them as part of the build process.
-+-Installing
You can install the plugin with Lektor’s installer:
lektor plugins add lektor-htmlmin @@ -144,7 +144,7 @@ minifying them as part of the build process. lektor-htmlmin = 1.0+Usage
To enable minification, pass the htmlmin flag when starting the development server or when running a build:
diff --git a/plugins/lektor-image-resize/index.html b/plugins/lektor-image-resize/index.html index e9aeba27..2f37c5e5 100644 --- a/plugins/lektor-image-resize/index.html +++ b/plugins/lektor-image-resize/index.html @@ -145,7 +145,7 @@ The difference between this plugin and the lektor Pillow.You can use the images like that:
-<!-- Simple example --> +<!-- Simple example --> <a href="waffle.jpg"><img src="waffle-small.jpg" /></a> <!-- example with srcset --> @@ -159,7 +159,7 @@ All images will be converted to webp using # add the plugin to lektor +# add the plugin to lektor lektor plugins add lektor-image-resize
If you have trouble, see the plugin @@ -169,7 +169,7 @@ documentation.
a few sections for images. The section names can be whatever you want, the final images will be called$(imagename)-$(sectionname).jpg
and$(imagename)-$(sectionname).webp
.Here is a example config file:
-[small] +[small] width = 640 height = 360 diff --git a/plugins/lektor-jinja-content/index.html b/plugins/lektor-jinja-content/index.html index f434dd43..99d05500 100644 --- a/plugins/lektor-jinja-content/index.html +++ b/plugins/lektor-jinja-content/index.html @@ -149,7 +149,7 @@Examples
Querying context:
{{ site.get('/').title }}
or{{ this.path }}
Logic:
-{% set meaning_of_life, meaning_of_universe = this.life, this.universe %} +{% set meaning_of_life, meaning_of_universe = this.life, this.universe %} {% if meaning_of_life == meaning_of_universe == 42 %} {% set meaning_of_it_all = meaning_of_life %} {% else %} @@ -158,10 +158,10 @@ {{ meaning_of_it_all }}Jinja in Markdown:
-[link text]({{ this|url }}) +[link text]({{ this|url }})Jinja in reStructuredText:
-`link text <{{ this|url }}>`_ +`link text <{{ this|url }}>`_Try running the test site for more examples.
Possible future of this plugin.
diff --git a/plugins/lektor-limit-dependencies/index.html b/plugins/lektor-limit-dependencies/index.html index 45359733..6b0879e4 100644 --- a/plugins/lektor-limit-dependencies/index.html +++ b/plugins/lektor-limit-dependencies/index.html @@ -140,7 +140,7 @@ control.Suppose that you would like to list the three most recent blog posts 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> +<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> @@ -184,7 +184,7 @@ gets covered, too, since when the resulting query is iterated over in the{% for %}
loop, dependencies will be recorded on the three most-recent posts.)Thus, the example above, if replaced by:
-<h3>Recent Posts</h3> +<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> diff --git a/plugins/lektor-make/index.html b/plugins/lektor-make/index.html index 6657d93b..3cb7cd0d 100644 --- a/plugins/lektor-make/index.html +++ b/plugins/lektor-make/index.html @@ -118,7 +118,7 @@Lektor plugin to run make lektor for custom build systems.
-+Install
python3 -m pip install lektor-makediff --git a/plugins/lektor-markdown-header-anchors/index.html b/plugins/lektor-markdown-header-anchors/index.html index db9a4be4..708766d4 100644 --- a/plugins/lektor-markdown-header-anchors/index.html +++ b/plugins/lektor-markdown-header-anchors/index.html @@ -147,7 +147,7 @@ are given anchors and a table of contents is collected.Enabling the Plugin
To enable the plugin run this command:
-$ lektor plugins add markdown-header-anchors +$ lektor plugins add markdown-header-anchorsIn Templates
Within templates it becomes possible to access the
.toc
property of @@ -158,7 +158,7 @@ markdown data. It's a list where each item has the following attributes:children
: a list of headers below that headerExample rendering:
-<h4>Table Of Contents</h4> +<h4>Table Of Contents</h4> <ul class="toc"> {% for item in this.body.toc recursive %} <li><a href="#{{ item.anchor }}">{{ item.title }}</a>{% diff --git a/plugins/lektor-markdown-highlighter/index.html b/plugins/lektor-markdown-highlighter/index.html index dd0fc8ca..4da4da94 100644 --- a/plugins/lektor-markdown-highlighter/index.html +++ b/plugins/lektor-markdown-highlighter/index.html @@ -141,13 +141,13 @@ Lektor's markdown support.Enabling the Plugin
To enable the plugin run this command:
-lektor plugins add markdown-highlighter +lektor plugins add markdown-highlighterConfiguring the Plugin
The plugin has a config file that is used to configure a few things for Pygments. Just create a file named
-markdown-highlighter.ini
into yourconfigs/
folder. Currently onlypygments.style
is used:[pygments] +[pygments] style = tangoYou can use this to select any of the built-in Pygments styles. Support for @@ -163,11 +163,11 @@ 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-netlify/index.html b/plugins/lektor-netlify/index.html index 9e2ba35e..fbdae1d4 100644 --- a/plugins/lektor-netlify/index.html +++ b/plugins/lektor-netlify/index.html @@ -132,12 +132,12 @@Installation
Install the
netlify
command-line program according to the instructions on netlify.com.Add lektor-netlify to your project from the command line:
-lektor plugins add lektor-netlify +lektor plugins add lektor-netlifySee the Lektor documentation for more instructions on installing plugins.
Configuration
Configure a server in your
-.lektorproject
file:[servers.production] +[servers.production] name = Production target = netlify://my-domain.com@@ -147,16 +147,16 @@Applications You must use this access token each time you publish. If your project file is private you can save the token there. Do not commit this!
-[servers.production] +[servers.production] name = Production target = netlify://my-domain.com key = ACCESS_TOKENNow deploy your site like:
-lektor deploy production +lektor deploy productionOtherwise, pass the token on the command line:
-lektor deploy production --key ACCESS_TOKEN +lektor deploy production --key ACCESS_TOKENdiff --git a/plugins/lektor-npm-support/index.html b/plugins/lektor-npm-support/index.html index 5745fa54..fa7b48bd 100644 --- a/plugins/lektor-npm-support/index.html +++ b/plugins/lektor-npm-support/index.html @@ -158,13 +158,13 @@
lektor-npm-support
makes it easy to use Parcel, webpack, browserify, or any other tool to build assets for Lektor projects.Enabling the Plugin
To enable the plugin, run this command while inside your Lektor project directory:
-lektor plugins add lektor-npm-support +lektor plugins add lektor-npm-supportExample: Creating a Parcel Project
Create a
parcel/
folder and inside that folder create the following files:
configs/npm-support.ini
This file instructs the plugin how to generate the assets:
-[parcel] +[parcel] npm = yarn watch_script = watch build_script = build @@ -178,7 +178,7 @@This plugin supports more than one such entry.
parcel/package.json
This is a standard
-package.json
file. It should contain two entries in thescripts
section. Thebuild
script is used duringlektor build -f npm
, and thewatch
script is used duringlektor server -f npm
.{ +{ "name": "my-parcel-project", "version": "1.0.0", "scripts": { @@ -194,19 +194,19 @@ $ 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"] }
parcel/main.scss
A simple SCSS file.
-body { +body { border: 10px solid red; }
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,7 +220,7 @@ 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 }}"> +<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
diff --git a/plugins/lektor-polymorphic-type/index.html b/plugins/lektor-polymorphic-type/index.html index d34bf51a..9d3224f6 100644 --- a/plugins/lektor-polymorphic-type/index.html +++ b/plugins/lektor-polymorphic-type/index.html @@ -150,7 +150,7 @@ with “_type
” appended.Examples
Simple Example
Here is an example model file for a simple page, with a selectable body format:
-# page.ini +# page.ini [model] name = Page @@ -175,7 +175,7 @@ determine whether thebody
field is interpreted as beingmark
html
ortext
.Contrived Example
Here is a contrived example showing the use of the
-polymorphic_type
option:# page.ini +# page.ini [model] name = Page diff --git a/plugins/lektor-qiniu/index.html b/plugins/lektor-qiniu/index.html index 543122f3..c02a08db 100644 --- a/plugins/lektor-qiniu/index.html +++ b/plugins/lektor-qiniu/index.html @@ -143,28 +143,28 @@This plugin does not do anything to help you create or configure qiniu account or bucket. You will have to make it done by yourself.
Installation
There ways to install plugin in Lektor, the easy ways is run below command in your project.
-lektor plugins add lektor-qiniu +lektor plugins add lektor-qiniu
Press Enter and lektor will automatically download and install this plugin for you.
Usage
After Installation, open your lektorproject file, first it should have a section like this:
-[packages] +[packages] lektor-qiniu= 0.1.3then below this section, you need add your bucket and folder(optional) as a target of a deploy server, like this:
-[servers.qiniu] +[servers.qiniu] name = qiniu enabled = yes target = qiniu://<YOUR-BUCKET>or if you want deploy your site to a folder in a bucket, mostly for backups, you can add server section as below:
-[servers.qiniu] +[servers.qiniu] name = qiniu 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:
-[servers.qiniu] +[servers.qiniu] name = qiniu enabled = yes target = qiniu://abcde/fjhi @@ -177,7 +177,7 @@In configs folder, create a configuration file exactly named qiniu.ini.
Attention: DO NOT name the configuration file with other names, otherwise this plugin will not work properly.
In this configuration file, you will need add few more sections, you can copy a sample configuration ini file from the sample_config folder, it looks like this:
-[auth] +[auth] Access_Key = replace_with_your_own_AK Secret_Key = replace_with_your_won_SK @@ -197,7 +197,7 @@exclusions
Another function this plugin provides is exclude folders or files you want to upload during deployment.
To exclude files or folders, just put the name of the folders or files in the exclusions section of configuration file, separated each one with commas.
-[exclusions] +[exclusions] dirs = .lektor, dir1, dir2 files = file1, file2,file3diff --git a/plugins/lektor-s3/index.html b/plugins/lektor-s3/index.html index bb60a368..9324ba4b 100644 --- a/plugins/lektor-s3/index.html +++ b/plugins/lektor-s3/index.html @@ -147,19 +147,19 @@ create the bucket and set its permissions to allow global read access. Remember to do this first because lektor-s3 won't do it automatically.Installation and Usage
Install with the usual Lektor toolchain. Within your project, run
-lektor plugins add lektor-s3 +lektor plugins add lektor-s3
You should see a message saying lektor-s3 has been added to the project.
Next, add an S3 bucket to your project's servers. In your project file (like
-blog.lektorproject
), add the following:[servers.s3] +[servers.s3] name = S3 enabled = yes target = s3://<YOUR-BUCKET>For example, if you wanted to deploy to a bucket named 'huntedwumpus', you'd make that last line
-target = s3://huntedwumpus +target = s3://huntedwumpusNow, if you call
@@ -167,7 +167,7 @@ website to S3 in the bucket you targeted.lektor deploy s3
, Lektor will upload your built website to S3 in the bucket you targeted.Optionally, you can also provide a CloudFront distribution ID. If you do, Lektor will invalidate all objects in that CloudFront distribution after every deploy.
-cloudfront = <YOUR-DISTRIBUTION-ID> +cloudfront = <YOUR-DISTRIBUTION-ID>Credentials
You need to prove to S3 that you have permission to upload to the @@ -181,7 +181,7 @@ and
AWS_SECRET_ACCESS_KEY
.If you have multiple sets of credentials, you can group them into profiles in your credentials file and choose the right one using the
-AWS_PROFILE
environment variable. Your~/.aws/credenials
file might look like this:[work] +[work] aws_access_key_id = <...> aws_secret_access_key = <...> @@ -190,7 +190,7 @@ environment variable. Your~/.aws/credenials
file might look like t aws_secret_access_key = <...>And then you can invoke
-lektor
with the environment variable:$ AWS_PROFILE=personal lektor deploy` +$ AWS_PROFILE=personal lektor deploy`Configuration
You can specify headers to be attached to particular files when uploading them @@ -208,7 +208,7 @@ their values. A list of valid headers is defined in the boto documentation as
ALLOWED_UPLOAD_ARGS
.Defaults can be defined via the usual INI file way, in a
[DEFAULTS]
section.For example, your configuration file might look like this:
-[DEFAULT] +[DEFAULT] CacheControl = public,max-age=3600 [static files] diff --git a/plugins/lektor-scss/index.html b/plugins/lektor-scss/index.html index 9b2722c5..65f08ae7 100644 --- a/plugins/lektor-scss/index.html +++ b/plugins/lektor-scss/index.html @@ -151,16 +151,16 @@Installation
You can install the plugin with Lektor's installer:
-lektor plugins add lektor-scss +lektor plugins add lektor-scssOr by hand, adding the plugin to the packages section in your lektorproject file:
-[packages] +[packages] lektor-scss = 1.4.1Usage
To enable the plugin, pass the
-scss
flag when starting the development server or when running a build:# build and compile css from scss +# build and compile css from scss lektor build -f scss # edit site with new generated css @@ -169,7 +169,7 @@ lektor server -f scssPython3
It is highly recommended to use this plugin with a python3 version of lektor.
Since lektor can be used as a python module it is possible to enforce this (after lektor is installed eg. with
-pip3 install --user --upgrade lektor
) with the following command:# run a python3 lektor server with new generated css +# run a python3 lektor server with new generated css python3 -m lektor server -f scss
Configuration
diff --git a/plugins/lektor-scsscompile/index.html b/plugins/lektor-scsscompile/index.html index 1d80bcde..132d3759 100644 --- a/plugins/lektor-scsscompile/index.html +++ b/plugins/lektor-scsscompile/index.html @@ -146,19 +146,19 @@ compiling them as part of the build process. It only rebuilds when it's needed (file changed, a file it imports changed or the config changed). When starting the the development server it watchs the files for changes in the background and rebuilds them when needed.Installing
You can install the plugin with Lektor's installer::
-lektor plugins add lektor-scsscompile +lektor plugins add lektor-scsscompileOr by hand, adding the plugin to the packages section in your lektorproject file::
-[packages] +[packages] lektor-scsscompile = 1.3.0Usage
To enable scsscompile, pass the
-scsscompile
flag when starting the development server or when running a build::lektor build -f scsscompile +lektor build -f scsscompile-lektor build -f scsscompile +lektor build -f scsscompileThe Plugin has the following settings you can adjust to your needs:
diff --git a/plugins/lektor-strip-html-tags/index.html b/plugins/lektor-strip-html-tags/index.html index 36980c3b..b9ccfd57 100644 --- a/plugins/lektor-strip-html-tags/index.html +++ b/plugins/lektor-strip-html-tags/index.html @@ -131,7 +131,7 @@
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!"
diff --git a/plugins/lektor-surge/index.html b/plugins/lektor-surge/index.html index 350feb1e..d1b8d0e4 100644 --- a/plugins/lektor-surge/index.html +++ b/plugins/lektor-surge/index.html @@ -136,11 +136,11 @@See the Lektor documentation for more instructions on installing plugins.
Configuration
Configure Surge in your
-.lektorproject
file:[servers.surge] +[servers.surge] target = surge:my-domain.comTo force all traffic to HTTPS, update your
-.lektorproject
file:[servers.surge] +[servers.surge] target = surge+https:my-domain.comFor more information, see the Surge guide to HTTPS.
diff --git a/plugins/lektor-tags/index.html b/plugins/lektor-tags/index.html index cfbb5a04..537ed952 100644 --- a/plugins/lektor-tags/index.html +++ b/plugins/lektor-tags/index.html @@ -151,19 +151,19 @@ teaEach page can list all the posts with that tag.
Installation
Add lektor-tags to your project from command line:
-lektor plugins add lektor-tags +lektor plugins add lektor-tagsSee the Lektor documentation for more instructions on installing plugins.
Overview
Say you have a "blog-post" model like this:
-[model] +[model] name = Blog Post [fields.tags] type = stringsMake a
-blog-post.html
template that includes:{% if this.tags %} +{% if this.tags %} <ul> {% for t in this.tags -%} <li> @@ -176,7 +176,7 @@ 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:
/blog/tag/my-tag @@ -189,37 +189,37 @@ tea
Set these options in
configs/tags.ini
:
parent
Required. The source path of the tag pages' parent page. For example:
-parent = /blog +parent = /blogThen tag pages' source paths are like:
/blog/tag/my-tag
You can specify the root as the parent:
-parent = / +parent = /
items
A query for all items on the page for one tag. You can use the variables
-site
andtag
. The template'sthis
variable has aparent
attribute. The default query is:items = this.parent.children.filter(F.tags.contains(tag)) +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)) +items = this.parent.pagination.items.filter(F.tags.contains(tag))See the Lektor documentation for queries.
tags_field
The name of the field in your model that contains tags. Defaults to
tags
. The field should be of typestrings
. See the Lektor documentation for thestrings
type.For example, if your model is like:
-[fields.labels] +[fields.labels] type = stringsThen add this to
-tags.ini
:tags_field = labels +tags_field = labels
template
The template for the page that lists all posts with a certain tag. The template's
-this
variable has attributestag
anditems
. An example template:<h1>Tag: {{ this.tag }}</h1> +<h1>Tag: {{ this.tag }}</h1> <h1>Items:</h1> <ul> {% for i in this.items %} @@ -230,39 +230,39 @@ tea </ul>Save a file like this to your project's
-templates/tags.html
. If you name the file something different, likelabel.html
, add this line totags.ini
:template = label.html +template = label.htmlThe plugin provides a default template if you don't specify one.
url_path
An expression for the location of each tag page. You can use the variables
-site
andtag
. Thethis
variable is a page with attributesparent
anditems
. The default expression is:url_path = {{ this.parent.url_path }}tag/{{ tag }} +url_path = {{ this.parent.url_path }}tag/{{ tag }}This expression generates URLs like
/blog/tag/coffee
.
ignore_missing
Default false. To set true, add this line to
-tags.ini
:ignore_missing = true +ignore_missing = trueThis 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 -%} +{% for t in this.tags -%} <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.
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 intags.ini
:tags_field = labels +tags_field = labelsThen 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") +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
@@ -279,7 +279,7 @@ tea{{ tags }}
simply returns a list, you can always apply any Jinja2 filter on that list such as sort, slice, or rejectattr.
count
— Number of pages tagged with this tagThis 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> +<ul> {% for tag, weight in (tagweights() | dictsort(by='value', reverse=true)) %} <li>{{ tag }} ({{ weight.count }} articles).</li> {% endfor %} @@ -295,7 +295,7 @@ teaMapping is done using a linear function over the logarithm of tag counts.
The result is a float: you might want to convert them to integers first (see example).
Example: Most used tag is twice as big as least used tag
-{% for tag, weight in tagweights()|dictsort %} +{% for tag, weight in tagweights()|dictsort %} <a href="{{ ('/blog@tag/' ~ tag)|url }}" style="font-size: {{ weight.log(100, 200)|round|int }}%;" @@ -312,7 +312,7 @@ teaThe less used tag is mapped with the first item, the most used tag is mapped with the last item.
Mapping is done using a linear function over the logarithm of tag counts.
Example: Tags are given CSS classes
-tagcloud-tiny
,tagcloud-small
, etc.{% for tag, weight in tagweights()|dictsort %} +{% for tag, weight in tagweights()|dictsort %} <a href="{{ ('/blog@tag/' ~ tag)|url }}" class="tagcloud-{{ weight.loggroup(["tiny", "small", "normal", "big", "large"]) }}" diff --git a/plugins/lektor-tailwind/index.html b/plugins/lektor-tailwind/index.html index 2422925a..87ef19fd 100644 --- a/plugins/lektor-tailwind/index.html +++ b/plugins/lektor-tailwind/index.html @@ -136,14 +136,14 @@
Add plugin to your project
-$ lektor plugin add lektor-tailwind +$ lektor plugin add lektor-tailwind $ lektor plugin listConfigure your template paths
In
-tailwindcss.config.js
:module.exports = { +module.exports = { content: ['./templates/**/*.{html,j2}'], theme: { extend: {}, @@ -155,14 +155,14 @@ $ lektor plugin listAdd the Tailwind directives to your CSS
In
-assets/static/style.css
:@tailwind base; +@tailwind base; @tailwind components; @tailwind utilities;- diff --git a/plugins/lektor-webpack-html-helper/index.html b/plugins/lektor-webpack-html-helper/index.html index 6e9ba3fe..ea4bb4d9 100644 --- a/plugins/lektor-webpack-html-helper/index.html +++ b/plugins/lektor-webpack-html-helper/index.html @@ -138,7 +138,7 @@ 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.
Start lektor build or server:
-$ lektor build +$ lektor build $ lektor serverwebpack/webpack.config.js
-const path = require("path"); +const path = require("path"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const { CleanWebpackPlugin } = require("clean-webpack-plugin"); @@ -181,7 +181,7 @@ This plugin depends on the }webpack/src/layout_template.html
-<!DOCTYPE html> +<!DOCTYPE html> <html lang="en"> <head> diff --git a/plugins/lektor-webpack-support/index.html b/plugins/lektor-webpack-support/index.html index 8bc60b1c..f6dfa390 100644 --- a/plugins/lektor-webpack-support/index.html +++ b/plugins/lektor-webpack-support/index.html @@ -153,7 +153,7 @@ the-f webpack
flag.Enabling the Plugin
To enable the plugin add this to your project file, run this command while sitting in your Lektor project directory:
-lektor plugins add lektor-webpack-support +lektor plugins add lektor-webpack-supportCreating a Webpack Project
Next you need to create a webpack project. Create a
-webpack/
folder and @@ -162,7 +162,7 @@ inside that folder createpackage.json
and awebpack.config.j
This file instructs
-npm
which packages we will need. All we need for a 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 @@ -182,7 +182,7 @@ setup that's good enough to cover most things you will encounter. The idea is to build the files fromwebpack/scss
andwebpack/js
intoassets/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 path = require("path"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); module.exports = = { @@ -238,7 +238,7 @@ 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 }}"> +<link rel="stylesheet" href="{{ '/static/gen/styles.css'|asseturl }}"> <script type=text/javascript src="{{ '/static/gen/app.js'|asseturl }}" charset="utf-8"></script>diff --git a/plugins/lektor-yandex-metrica/index.html b/plugins/lektor-yandex-metrica/index.html index 40e2f8e1..7590c096 100644 --- a/plugins/lektor-yandex-metrica/index.html +++ b/plugins/lektor-yandex-metrica/index.html @@ -132,18 +132,18 @@This plugin adds support for Yandex Metrica to Lektor CMS
-+-Enabling the Plugin
lektor plugins add lektor-yandex-metrica+-Configuring the Plugin
Just create a file named
yandex-metrica.ini
in yourconfigs/
folder and configureid
key with the provided counter id:id = YOUR_COUNTER_ID+In Templates
Now you can add a Yandex Metrica counter to any of your templates by just using the
generate_yandex_metrica
function in its tag as below.{{ generate_yandex_metrica() }}