Skip to main content

Lektor-HAL

A plugin for Lektor that uses the HAL API to easily maintain an up-to-date list of publications on a static website.

HAL is an open archive where authors can deposit scholarly documents from all academic fields.

Configuration

Add lektor-hal to the [packages] section of your .lektorproject file.

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"))

Usage

Example

<ul class="publications" id="publications">
  {% for publi in hal_publications %}
  <li>
    <a href={{ 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_publications and hal_request.

hal_publications

A list of Publications, a dataclass with the following attributes:

  • raw: A dict containing everything about this publication returned by the HAL API.
  • title: The title of the publication
  • 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/

and properties:

  • link: URL pointing to the HAL resource
  • where: returns where the article was published (journalTitle_s or conferenceTitle_s if missing)

hal_request

URL used for the HAL API request.

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 everytime. Add this to the template that uses the publications list:

{{ volatile() }}

Metadata

Release files for lektor-hal 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lektor-hal 0.1.2
File Size Uploaded
lektor-hal-0.1.2.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lektor-hal 0.1.2
File Interpreter ABI Platform
lektor_hal-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / lektor-hal-0.1.2.tar.gz

Download URL lektor-hal-0.1.2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
43d8cad235d2074235207ecfec5120f08706c26aeb50f41be17d91febf8391c4
BLAKE2b-256 checksum
How to use checksums
b45e9388b27a564bda58fc47ea4b54ff70e82ca6b8bd32c775f90ec51df5eaeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Release files / lektor_hal-0.1.2-py3-none-any.whl

Download URL lektor_hal-0.1.2-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95d110ff171b83941fd4f804c78e1cdb067bb6bf7e88a5763e50e9fc02697a28
BLAKE2b-256 checksum
How to use checksums
e70f7b3b305440f907772448df9abfb3e79fc519b024430d9ec02964ebfde756
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page