Fetches publications from HAL
Project description
Lektor-HAL
A plugin for lektor to easily maintain an up-to-date list of publications on a static website.
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 Publication
s, 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
)
and properties:
link
: URL pointing to the HAL resourcewhere
: returns where the article was published (journalTitle_s
orconferenceTitle_s
if missing)
hal_request
URL used of 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, so you need to either clear the lektor build
cache (lektor clean
) or modify the page where the publications are listed.
I am not certain how to cleanly handle this, any suggestion is welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for lektor_hal-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c82af66097b9e1d90cec2c09173c45f09d6320201ddb2217707fd375158a78a5 |
|
MD5 | f344a2e8bde756470dff45f28f627574 |
|
BLAKE2b-256 | 4f2bffdfeeb18e23e366da550b43173194130a50ff82217321ce8a10620c6604 |