Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Query the Gitlab API right from your Lektor templates

Project description

# Lektor Gitlab

Query the Gitlab API right from your [Lektor][1] templates.

## Configuration

To 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 file
called `configs/gitlab.ini` where the token is stored under the
`private_token` key.

private_token = <Your access token>

Alternatively the token can also be set using an environment variable.

__Note__: the config file is checked before the environment variable

export GITLAB_PRIVATE_TOKEN=<Your access token>

## Usage

After you have set up the access token, the [Python-Gitlab][3] `Gitlab`
object is available in your templates. This means you can do anything
your heart desires with it.

### Examples

List your public repos

{% for project in gitlab.projects.list(owned=True, visibility='public') %}
<li>{{ }} [{{ project.star_count }}]</li>
{% endfor %}

Display the your name and avatar

<h2>{{ }}</h2>
<img src="{{ gitlab.user.avatar_url }}">


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lektor-gitlab, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size lektor_gitlab-0.1.0-py3-none-any.whl (2.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size lektor-gitlab-0.1.0.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page