Saravanan666/pypi-org huggingface dataset:
Package: lektor-envvars
Why this project?TL;DRYou can use environment variables in your Lektor templates.I’ve been working withLektoras as
static site generator in quite a few projects and really enjoy it. Most recently
I work on a project that used an environment variable to create slightly
different version of the site fordevelopment,stagingandproduction.Lektor doesn’t have a way to addenvironment variablesinto the templates, so
I started building my own little plugin.How to install it in LektorYou can easily install this plugin following theLektor docs. All you need to do is run:$ lektor plugin add lektor-envvarsThis will automatically install the plugin and add it to your project
configuration.Using environment variablesYou are able to access environment variables using theenvvarsfunction
inside your Jinja2 template. This function is added whenever lektor is running
a new build.All environment variables are prefixed withLEKTOR_by default. Let’s look
at a simple example with an environment varialbeLEKTOR_DEBUG=true:$ export LEKTOR_DEBUG=trueYou can access this variable inside any Jinja2 template:{{ envvars('DEBUG') }}which will displaytrueinstead.Converting valuesThat’s a great start but what if you want this to be a boolean value instead of
the stringtrue? You simply convert the value:{{ envvars('DEBUG', bool) }}or you can now even do:{% if envvars('DEBUG', bool) %}
    ...
{% endif %}Custom prefixes (or no prefix)If you don’t like theLEKTOR_prefix, you can either use your own prefix by
setting the prefix in theconfigs/lektor-envvars.inifile:[envvars]
prefix = MY_OWN_You can now useMY_OWN_DEBUGinstead ofLEKTOR_DEBUG. This means that
all environment variables need to be prefixed withMY_OWN_now instead.You can also ignore the prefix all together:{{ envvars('DEBUG', no_prefix=True) }}which will give you access to the environment variableDEBUG.LicenseThis code is licensed under theMIT License.
Package: lektor-expression-type
Lektor Expression Type PluginAdd jinja-evaluated types,expressionandformat_expression, toLektor.These allow one to define data model fields whose values are Jinja2
expressions.The TypesBoth theexpressionandformat_expressiontypes are evaluated by
the jinja template engine.expressionTheexpressiontype is evaluated as a Jinja2 expression.An example value for this type might be:this.children.order_by('-pub_date').limit(4)This would evaluate to a LektorQueryinstance.format_expressionTheformat_expressiontype is evaluated as a Jinja2 template.  It
will always evaluate to a string.An example value for this type might be:The blog contains {{ site.get('/blog').count() }} pages.InstallationAdd lektor-expression-type to your project from command line:lektor plugins add lektor-expression-typeSeethe Lektor plugin documentationfor more information.Motivating ExampleSuppose you want to create anIndexdata model, for pages which will
be used display lists of other pages on your site.
You could create a model definition like this (called, perhaps,models/index.ini):[model]name=Index Pagelabel=Index: {{ this.title}}[fields.title]label=Titletype=string[fields.items]label=Itemstype=expressiondescription=Pages to list on this pageIn a particular index page which uses this model, you might set theitemsfield tosite.get('/projects').filter(F.tag == 'interesting'),
then in the page template (e.g. intemplates/index.html) one could
reference theitemsfield (e.g.{% for page in this.items %})
to determine which pages to display on the page.AuthorJeff Dairikidairiki@dairiki.orgChangelog0.1 — 2021-02-05No code changes.Update development status classifier to "stable".FixesInclude the correct LICENSE file.0.1b1 — 2020-05-05Initial release.
Package: lektor-fixedlang
lektor-fixedlang is a plugin for theLektorstatic site generator that marks some patterns in output files
withlangattributes.Why?Say you have a multilingual site where one of the languages you support
is Turkish. In Turkish, the uppercase form foriisİ,
and the lowercase form forIisı. If you use an English word
containing these letters in Turkish text, atext-transformCSS rule
will cause the word to be shown incorrectly. For example, the word
“Wikipedia” transformed to uppercase will become “WİKİPEDİA”.To prevent this, you have to mark such pieces of text using alangattribute, as in<spanlang="en">Wikipedia</span>. This can of course
be done manually when writing the content, but that’s going to be inconvenient
for content writers and it can also be easily overlooked.Although this “dotless-i / dotted-I” problem was the initial motivation
behind this plugin, it can be useful in other cases as well.InstallationTo use the plugin, add it to your project:lektor plugin add lektor-fixedlangThe plugin can be configured using theconfigs/fixedlang.inifile.
Every section is the name of the tag that will wrap the pattern.
Every key in the section is a regular expression pattern
and the value is the language for the pattern.Example:[span]
\bWikipedia\b = enNote: At the moment, regular expression matches are case insensitive.
Package: lektor-gemini-capsule
Lektor Gemini capsuleThis plugin for Lektor adds support for dual-generation of web andGeminicontent.Using thisStepsInstalllektor-gemini-capsuleCreate your templates undertemplates/MODEL.gmilektor buildand profit!Note that if your web server is the same as your Gemini server, you may be able
to copy the whole site once and serve both protocols from the same resulting
directory.
Check your server's documentation.DetailsIn order to install the plugin you can add following to your.lektorprojectfile:[packages]
lektor-gemini-capsule = 0.2Or follow theofficial plugin instructions.How it worksThis plugin generates a correspondingindex.gmiwhenever Lektor generates anindex.htmlfile.It does so by reusing the one model <--> one template concept, so you will have
to create a template for each model.Disabling Gemini for specific modelsIf you would like to skip Gemini generation for a specific model, you can use
following in your model's.ini:[fields._skip_gemini]
type = boolean
default = TrueThemd2geminiJinja filterThis plugin defines anmd2geminiJinja filter, but by default it just passes
the text as it is defined.This limitation is due to an incompatibility between md2gemini and Lektor when
it comes to a common dependency called mistune (the Markdown parser).This filter is defined and its use is encouraged in the hope that this
incompatibility is solved soon and the resulting Gemini capsules are more
Gemini-friendly without any added effort.
Package: lektor-gitlab
# Lektor GitlabQuery the Gitlab API right from your [Lektor][1] templates.## ConfigurationTo use the plugin you must first acquire an [private access token][2].The token must at least have the `api` scope.Depending on your preference you can either create a Lektor config filecalled `configs/gitlab.ini` where the token is stored under the`private_token` key.Eg:```iniprivate_token = <Your access token>```Alternatively the token can also be set using an environment variable.__Note__: the config file is checked before the environment variableEg:```bashexport GITLAB_PRIVATE_TOKEN=<Your access token>```## UsageAfter you have set up the access token, the [Python-Gitlab][3] `Gitlab`object is available in your templates. This means you can do anythingyour heart desires with it.### ExamplesList your public repos```jinja2<ul>{% for project in gitlab.projects.list(owned=True, visibility='public') %}<li>{{ project.name }} [{{ project.star_count }}]</li>{% endfor %}</ul>```Display the your name and avatar```jinja2<h2>{{ gitlab.user.name }}</h2><img src="{{ gitlab.user.avatar_url }}">```[1]: https://www.getlektor.com[2]: https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html[3]: http://python-gitlab.readthedocs.io/en/stable/index.html
Package: lektor-google-analytics
This plugin adds support forGoogle analyticstoLektor CMS.Once the plugin is enabled, agenerate_google_analytics()function
is available to be included in targettemplatewhich automatically
include Google-Analytics code in final HTML files rendered byLektor.Basic UsageEnabling the PluginTo enable the plugin add this to your project file:[packages]lektor-google-analytics=0.1Configuring the PluginThe plugin needs a config file with yourGoogle analyticscode in
it.Just create a file namedgoogle-analytics.iniinto./configsfolder in your Lektor project’s base directory. And, put theGOOGLE_ANALYTICS_IDkey with target property ID of formUA-XXXXXXXX-Ywhich you obtained from:GOOGLE_ANALYTICS_ID=UA-XXXXXXXX-YUsing in TemplatesNow you can add a Google analytics code-snippet in your templates by
just calling thegenerate_google_analyticsfunction inside its<body> </body>tags.<divclass="ga-script">{{ generate_google_analytics() }}</div>That’s it. All theHTMLfiles that rendered from that template will
include Google-Analytics code automatically.AdvancedYou can useGOOGLE_ANALYTICS_PROPERTYproperty to include yourcustom-built Google Analytics tracking code. In that case, your./configs/google-analytics.iniwill look like this:GOOGLE_ANALYTICS_ID=UA-XXXXXXXX-YGOOGLE_ANALYTICS_PROPERTY='my custom code'Don’t use this property unless you know what are you doing. By default,
it is set toauto.To go deeper than this, please refer toGoogle-Analytics
documentation.Copyright(c) 2015, Khaled MonsoorAll rights reserved.Licensed underBSDlicense.
Package: lektor-google-search
Lektor-Google-SearchThis plugin add support forGoogle SearchtoLektor CMSOnce the plugin is enabled, arender_google_search()function is available to be included in a tagettemplatewhich autoatically
include Google-Search code in final HTML fles rendered by Lektor.How to Use the plugin ?Enable the pluginTo enable the plugin, add the following to your.lektorprojectfile:[packages]lektor-google-search=0.1Configure the pluginThe plugin needs a config file with yoursearch Engine IDcode in itCreate a file namedgoogle-serch.iniinto./configsfolder in your lektor project's base directory.Put theSEARCH_ENGINE_IDkey with the value of your serch engine ID.SEARCH_ENGINE_ID=83892839209432084Usage in templateAdd Google Search code snippet by calling the functionrender_google_search()in the template of your preference where you want the search box to appear.<div>{{ render_googe_search() }}</div>Now, try to runlektor serverto see the google search appear.
Package: lektor-google-tag-manager
This plugin adds support forGoogle Tag
Manager <http://www.google.com/analytics/tag-manager//>toLektor
CMS <https://github.com/lektor/lektor>.Once the plugin is enabled, agenerate_google_tag_manager()function
is available to be included in targettemplatewhich automatically
include Google Tag Manager code in final HTML files rendered byLektor.Basic UsageEnabling the PluginTo enable the plugin add this to your project file:[packages]lektor-google-tag-manager=0.1Configuring the PluginThe plugin needs a config file with yourGoogle Tag Managercode in
it.Just create a file namedgoogle-tag-manager.iniinto./configsfolder in your Lektor project’s base directory. And, put theGOOGLE_TAG_MANAGER_IDkey with target property ID of formGTM-XXXXXXwhich you obtained from:GOOGLE_TAG_MANAGER_ID=GTM-XXXXXXUsing in TemplatesNow you can add a Google Tag Manager code-snippet in your templates by
just calling thegenerate_google_tag_managerfunction in its <body></body> tag as below.<divclass="gtm-script">{{ generate_google_tag_manager() }}</div>That’s it. All theHTMLfiles that rendered from that template will
include Google Tag Manager code automatically.LicenseThis plugin is released under the BSD license. For more information read
theLicense.AcknowledgementsThis plugin is inspired bylektor-google-analytics
Package: lektor-gravatar
ALektorplugin providing a template filter that generatesGravatarURLs for
an email address.The implementation is drawn from thedocumentation on writing Lektor plugins;
this package is provided for the convenience of others.UsageTo add Gravatar support to your Lektor project, run:$ lektor plugins add lektor-gravatarThen, in a template, you can reference:<img src="{{ object.email|gravatar }}" alt="gravatar">whereobject.emailis a variable in your context containing an email address.Communitylektor-gravatar is part of theBeeWare suite. You can talk to the community through:@pybeeware on TwitterThepybee/generalchannel on Gitter.ContributingIf you experience problems with this backend,log them on GitHub. If you
want to contribute code, pleasefork the codeandsubmit a pull request.
Package: lektor-groupby
Lektor Plugin: groupbyA generic grouping / clustering plugin.
Can be used for tagging or similar tasks.
The grouping algorithm is performed once.
Contrary to, at least, cubic runtime if doing the same with Pad queries.Install this plugin or modify your Lektor project file:lektorpluginaddgroupbyOptionally, enable a basic config:[tags]root=/slug=tag/{key}.htmltemplate=tag.htmlsplit=' 'Or dive into plugin development...For usage examples, refer to theexamplesreadme.
Package: lektor-gulp
This plugin forLektor CMSaddsgulpsupport to projects. When
enabled with the-fgulpflag it runsnpm installand then the
gulpdefaultorwatchtasks as they are defined into your owngulpfile.js.The general documentation about Lektor plugins ishere.lektor buildThe commandlektor build-fgulpruns the``default``gulp task,
for example defined as something like:gulp.task('build', ['clean', 'copy', 'js', 'css', 'imagemin'], () => { });
gulp.task('default', ['build'], () => { });In the above example thedefaulttask points to abuildtask,
which is usually composed by several other gulp tasks, etc.lektor serverThe commandlektor server-fgulpruns the Lektor embedded server onhttp://localhost:5000, starting a gulp``watch``task in background.
For example, you can define something such as:gulp.task('watch', () => {
    gulp.watch('lib/js/**/*.js', ['js']);
    gulp.watch('lib/css/**/*.css', ['css']);
});In the above example, each time one touches Javascript or CSS files in
thelib/folder then assets could be minified, concatenated and
copied into the standardassets/static/lektor folder, or whatever
is defined into your owngulpfile.js.CreditsThis plugin is based on the officialWebpack pluginwith very little
differences.
Package: lektor-hal
Lektor-HALA plugin forLektorthat uses the HAL API
to easily maintain an up-to-date list of publications on a static website.HALis an open archive where authors
can deposit scholarly documents from all academic fields.ConfigurationAddlektor-halto the[packages]section of your.lektorprojectfile.In./configs/hal.ini, the query field must be specified, following to theHAL docsExample:query = ((authIdHal_s:my-id-hal) OR (authFullName_s:"My Name"))UsageExample<ulclass="publications"id="publications">{% for publi in hal_publications %}<li><ahref={{publi.link}}>{{ publi.title }}</a>@
    {{ publi.where }} -
    {{ publi.authors|join(', ') }}
    ({{ publi.date }})</li>{% endfor %}</ul>Two global variables are available in your jinja template,hal_publicationsandhal_request.hal_publicationsA list ofPublications, a dataclass with the following attributes:raw: A dict containing everything about this publication returned by the
HAL API.title: The title of the publicationhal_id: The HAL ID of the publicationauthors: A list of strings (author names)date: A string (producedDate_s)type: The publication type, eg "ART", "COMM", "POSTER", etc/and properties:link: URL pointing to the HAL resourcewhere: returns where the article was published (journalTitle_sorconferenceTitle_sif missing)hal_requestURL used for the HAL API request.Known caveatLektor 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
everytime. Add this to the template that uses the publications list:{{ volatile() }}
Package: lektor-htmlmin
HTML minifier for Lektor that automatically minifies generated .html files.Useshtmlminand looks for .html files,
minifying them as part of the build process.InstallingYou can install the plugin with Lektor’s installer:lektor plugins add lektor-htmlminOr by hand, adding the plugin to the packages section in your lektorproject file:[packages]
lektor-htmlmin = 1.0UsageTo enable minification, pass thehtmlminflag when starting the development
server or when running a build:lektor build -O my_build_folder -f htmlminWhen the flag is present, htmlmin will overwrite all HTML files in the output
directory with their minified counterparts.Note:The htmlmin plugin currently minifies every file in the project after a build.
Not just files that have been changed. This should have no ill effects, but
might increase build times if there are many files to minify.
Package: lektor-html-pretify
html-pretifyLektorplugin to pretify the HTML DOM using Beautiful Soup.How does it actually work?It usesBeautiful Soup.It looks for rendered.htmlfiles and pipe it through Beautiful Soup, after opening the files viacodecs.InstallationYou can install the plugin with Lektor's installer:lektorpluginsaddlektor-html-pretifyOr by hand, adding the plugin to the packages section in your lektorproject file:[packages]lektor-html-pretify=2.0.0Python3It 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. withpip3 install --user --upgrade lektor)with the following command:# run a python3 lektor serverpython3-mlektorserverDevelopmentTo test and/or develop on this plugin in your running lektor installation, simply place it in thepackages/Folder and have a look at theLektor Docs
Package: lektor-image-filter
image-filterALektorfilter to print the input image in different predefined image sizes.This plugin is designed to work together with thelektor-image-resizePlugin.Current Filters:imagessrcsetwebpwill print the configured sizes aswebpto put in asrcsetelement.imagessrcwebpwill print the first configuredwebpimage name to put in asrcelement.imagessrcsetjpgwill print the configured sizes asjpgto put in asrcsetelement.imagessrcjpgwill print the first configuredjpgimage name to put in asrcelement.firstwidthwill print the first configured  image width to put in awidthelement. If you use theAdvanced Lektor Examplewe try to compute the width if no is provided,firstheightwill print the first configured  image height to put in aheightelement. If you use theAdvanced Lektor Examplewe try to compute the height if no is provided,ConfigurationYou can configure the image width in the config file calledconfigs/image-resize.iniand add
a few sections for images. The section names can be whatever you want, the
final images will be called$(imagename)-$(sectionname).jpgand$(imagename)-$(sectionname).webp.If thewidthenty does not exist the entry will be ignored.Here is a example config file:[small]width=640height=360[medium]height=720[woowee]width=1920Simple Lektor ExampleLektor Jinja2 Input<imgsrc="{{ 'waffle.jpg'|imagessrcjpg }}"width="{{ 'random_string'|firstwidth }}"height="{{ ''|firstheight }}"srcset="{{ 'waffle.jpg'|imagessrcsetjpg }}"/>Lektor HTML Output:<imgsrc="waffle-small.webp"width="640"height="360"srcset="waffle-small.webp  640w,waffle-woowee.webp 1280w,waffle-woowee.webp 1920w"/>-> If thewidthis not defined the option will be skipped in srcset!Advanced Lektor ExampleLektor Models Definition[fields.my_image]label=Example Imagedescription=Select a Image from the Attatchments of this site. Upload one, if no one is availabletype=selectsource=record.attachments.imagesLektor Jinja2 Input{% set image = record.attachments.images.get(this.my_image) %}<imgsrc="{{ image | imagessrcwebp }}"width="{{ image | firstwidth }}"height="{{ image | firstheight }}"srcset="{{ image | imagessrcsetwebp }}"/>Explaination Input:First we created the Jinaja2-variableimagethat will contain our image (this.box_image) to make this example better readable.(We assume you know how to create variables in lektor)Next line we created a html image tag withsrcandwidthLast we created thesrcsetelement with all configured sizes.Lektor HTML Output<imgsrc="waffle-small.webp"width="640"height="360"srcset="waffle-small.webp  640w,waffle-medium.webp 1280w,waffle-woowee.webp 1920w"/>-> If thewidthis not defined we try to compute the option based on theheightentry and the source image aspect ratio.(Please note that we added some new lines to make the example better readable and we assume thatmy_image: waffle.jpgcomes from your .lr file, created via lektor admin menu)and is a image in16:9aspect ratio.Installationlektorpluginaddlektor-image-filter
Package: lektor-image-resize
lektor image resize pluginThis plugin generates JPG and WEBP Images and Thumbnails in predefined sizes for any images in yourLektorcontent.
The difference between this plugin and the lektorthumbnailfilter is that this plugin is converting all images and you don't need to have any references to the images in your templates.TL;DR: What does this plugin do?It will generateJPEGimages in the sizes you configured of all images in your Lektor content usingimagemagic.It will generateWEBPimages in the same sizes usingimagemagic.UsageUse this plugin if you want to be able to link to full-size images in your content, but still want thumbnails to be generated for the link itself.
For example, you may have an image calledwaffle.jpg, and to link to it in the content (not the template), but also show a thumbnail.
All images will be converted to webp usingPillow.You can use the images like that:<!-- Simple example --><ahref="waffle.jpg"><imgsrc="waffle-small.jpg"/></a><!-- example with srcset --><ahref="waffle-small.webp"><imgsrc="waffle-small.webp"srcset="waffle-small.webp  640w,   // Viewport bis zu 640waffle-medium.webp 1280w,  // Viewport größer als 1280waffle-woowee.webp 1920w"//Viewportgrößerals1920/></a>InstallationTo install the plugin, addlektor-image-resizeto your plugins from the command line and create a config file:# add the plugin to lektorlektorpluginsaddlektor-image-resizeIf you have trouble, see theplugin
installationsection of the Lektor
documentation.Create a config file calledconfigs/image-resize.iniand add
a few sections for images. The section names can be whatever you want, the
final images will be called$(imagename)-$(sectionname).jpgand$(imagename)-$(sectionname).webp.Here is a example config file:[small]width=640height=360[medium]height=720[woowee]width=1920Will take a file calledwaffle.jpgand create the fileswaffle-small.jpg,waffle-medium.jpgandwaffle-woowee.jpgas well aswaffle-small.webp,waffle-medium.webpandwaffle-woowee.webpAll the files will be created,
regardless of whether the original file is smaller, so you can link without worrying
whether a file will exist or not. If the original file is smaller than the width
you have specified, the file will only be copied, and will not be resized.Themax_width/max_heightparameters work like for theLektor
thumbnailcommand.Good to knowThere is a filter plugin avaliable atlektor-image-filteravailable, that can help you to use the image in all configured sizes,
Package: lektor-imgutils
lektor-imgutils is a plugin for theLektorstatic site generator
that manipulates image files and image-related markup
after the build is completed.To use the plugin, add it to your project:lektor plugin add lektor-imgutilsThe plugin can be configured using theconfigs/imgutils.inifile.
Each section specifies a rule that will be applied to selected images.
Each section must have a “selector” key which is a CSS selector
to select the image elements.
The section names are insignificant.ExamplesSet missing width and height attributes to all images:[default]
selector = img
size = yesSet lazy loading and async decoding on all images in the “.content” part:[content]
selector = .content img
loading = lazy
decoding = async