Package: pelican-bibliography
Bibliography: A Plugin for PelicanGenerated bibliography in Pelican that can be rendered in references and citationsThis plugin provides a new generator,BibliographyGenerator. This generator addsbibliographyto the Pelican context and can write an output file for each reference using acitation.htmltemplate. Additionally, the entire bibliography can be written using abibliography.htmltemplate or otherwise.InstallationThis plugin can be installed via:pipinstallpelican-bibliographyNow, add it to yourpelicanconf.py:PLUGINS=['pelican.plugins.bibliography']That's it, thanks to thenamespace pluginsin Pelican 4.5+.UsageWhen this generator is run, it first reads bibliography files from theBIBLIOGRAPHY_PATHSsetting. For now, only BibTeX (.bib) files are supported, but more may be added in the future. Each reference contained in the bibliography is instantiated as aReferenceobject. The content of the reference is its citation in bibtex, while most of the useful information is in the metadata, such as the citation key, the title, the authors, the publication venue. Extra metadata key-value pairs can be read from YAML files in the same bibliography path. Now, you can usebibliographyin your templates.Next, the citations can be written to separate files. If desired, for each reference, the citation will be rendered according to thecitation.htmltemplate and written to a configured path. Ideally, your bibliography will link to the citation page so that interested readers can easily cite your work.ConfigurationThe following variables can be configured in yourpelicanconf.py:# A directory that contains the bibliography-related templates# type: Union[str, os.PathLike]BIBLIOGRAPHY_TEMPLATES='.../pelican/plugins/bibliography/data/templates'# A list of directories and files to look at for bibliographies, relative# to PATH.# type: List[str]BIBLIOGRAPHY_PATHS=["bibliography"]# A list of directories to exclude when looking for references# type: List[str]BIBLIOGRAPHY_EXCLUDES=[]# list of file extensions (without leading period) that are bibliography# files# type: List[str]BIBLIOGRAPHY_EXTENSIONS=["bib"]# list of file extensions (without leading period) that are metadata files# type: List[str]BIBLIOGRAPHY_METADATA_EXTENSIONS=["yml","yaml"]# attribute of the Reference object to order the bibliography by (in# reverse order)# type: strBIBLIOGRAPHY_ORDER_BY="sortkey"# whether to write citations to files# type: boolBIBLIOGRAPHY_WRITE_CITATIONS=True# template to use for citations# type: strBIBLIOGRAPHY_CITATION_TEMPLATE_NAME="citation.html"# format string to link to citation# type: strBIBLIOGRAPHY_CITATION_URL="files/citation/{key}"# format string to save citations as in generated site# type: strBIBLIOGRAPHY_CITATION_SAVE_AS="files/citation/{key}/index.html"Bibliography pageA main application of this is to create a research page that displays some collection of published research. For example, you could create a new template in your theme,bibliography.htmlthat renders your research:Here are the titles of my papers:<ul>{% for ref in bibliography %}<li>{{ ref.title }}</li>{% endfor %}</ul>You can't just create your bibliography in your site'scontent/, because the context that includes the articles, pages, bibliography, etc. is not available when your content is read. What you can do is create a new template that extendspage.htmlorarticle.html, and use that template to render some text in your content tree.A basic bibliography template is included with the plugin that tries to extend your theme's page template. Thus you could render your bibliography by adding this page to your content:Title: My Bibliography
Template: bibliography

Here is my bibliographyView anexample bibliographyusing the provided
template.Extra metadataYou can also provide additional metadata in a YAML file with the following structure:-key:someCitationKey2020metadata:key1:value1key2:value2Now the keys and values in the metadata hash associated with the citation key will be available in the correspondingref.metadatadictionary in thebibliography.Bibliography templateThebibliography.htmldefault template that is included with the package has its own styling for jump links and highlighting. You can customize additional elements. For example, to style specific authors:.ref-author[data-given="Micah J."][data-family="Smith"]{text-weight:bold;}You can use multiple selectors to apply styles to theref-authorspan with data attributes matching a certain name.The template also has support for renderinglinksfor each item. Add to your metadata file a keylinksthat is a list of hashes with keyshrefandicon, i.e.-key:someCitationKey2020metadata:links:-href:https://www.example.comicon:linkNow an icon will be included that links to the given site. The exact icon is determined byfa-{link.icon}, sofa-linkis a link,icon: file-pdfwould lead tofa-file-pdf, etc.ContributingContributions 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 onexisting issues.To start contributing to this plugin, review theContributing to Pelicandocumentation, beginning with theContributing Codesection.LicenseThis project is licensed under the MIT license.