Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renyuneyun/pelican-interrefs
https://github.com/renyuneyun/pelican-interrefs
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/renyuneyun/pelican-interrefs
- Owner: renyuneyun
- Created: 2022-07-20T20:50:50.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-13T16:42:06.000Z (about 2 years ago)
- Last Synced: 2024-11-09T16:17:25.008Z (2 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
Pelican Inter References: A Plugin for Pelican
====================================================[![Build Status](https://img.shields.io/github/workflow/status/pelican-plugins/pelican-interrefs/build)](https://github.com/pelican-plugins/pelican-interrefs/actions)
[![PyPI Version](https://img.shields.io/pypi/v/pelican-interrefs)](https://pypi.org/project/pelican-interrefs/)
![License](https://img.shields.io/pypi/l/pelican-interrefs?color=blue)Obtain inter-references (both forward and backward) of each article. The interrefs are links between articles on the same site (rather than arbitrary links on the Web).
Note: Part of the information in this file is auto-generated. They may not work or correctly reflect the current status.
Installation
------------This plugin can be installed via:
python -m pip install pelican-interrefs
Usage
-----This plugin adds a `interrefs` field to the article object, which contains two other fields: `forward` and `backward`.
The `interrefs.forward` field contains all (articles of) the forward links that present in this article (i.e. links to another article from this article). Similarly, the `interrefs.backward` field contains all (articles of) the backward links to this article (i.e. links from another article to this article).
Specifically, `interrefs` will evaluate to `False` if both `forward` and `backward` are empty. This should make the template simpler.
The following settings are recognized:
- `FORWARD_REFS`: The number of forward links to have in the list
- `BACKWARD_REFS`: The number of backward links to have in the listNote: The current implementation is not very efficient. The worst case complexity is `O(n^3)` where `n` is the number of articles.
### Template
You may use this piece of code for your template.
```
{% if article.interrefs %}
{% if article.interrefs.forward %}
{% endif %}
{% if article.interrefs.backward %}
{% endif %}
{% endif %}
```TODO
------------* [ ] Support posts?
* [ ] Support i18n-subsites
* [ ] Optimize performanceContributing
------------Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].
To start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.
[existing issues]: https://github.com/pelican-plugins/pelican-interrefs/issues
[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.htmlLicense
-------This project is licensed under the AGPL-3.0 license.