@@ -318,6 +318,31 @@ <h2 id="authors">
318
318
</ ul >
319
319
{% endmacro %}
320
320
321
+ {% macro render_bibtex() %}
322
+ < h2 id ="cite ">
323
+ < a href ="#cite " class ="anchor-link "> BibTeX</ a >
324
+ </ h2 >
325
+ < pre id ="bibtex-citation ">
326
+ @inbook{WebAlmanac.{{ year }}.{{ metadata.get('title').replace(' ', '') }},
327
+ author = "{% for author in metadata.get('authors') -%}
328
+ {%- set authordata = config.contributors.get(author, None) -%}
329
+ {%- if authordata %}
330
+ {%- set full_name = authordata.name.split(' ') -%}
331
+ {{ full_name[-1] }}, {{ full_name[0] }}{% if full_name|length > 2 %} {{ full_name[1:-1]|join(' ') }}{% endif %}{% if not loop.last %} and {% endif %}
332
+ {%- else %}
333
+ {%- set full_name = author.split(' ') -%}
334
+ {{ full_name[-1] }}, {{ full_name[0] }}{% if full_name|length > 2 %} {{ full_name[1:-1]|join(' ') }}{% endif %}{% if not loop.last %} and {% endif %}
335
+ {%- endif %}
336
+ {%- endfor %}",
337
+ title = "{{ metadata.get('title') }}",
338
+ booktitle = "The {{ year }} Web Almanac",
339
+ chapter = {{ chapter_config.chapter_number }},
340
+ publisher = "HTTP Archive",
341
+ year = "{{ year }}",
342
+ url = "https://almanac.httparchive.org/en/{{ year }}/{{ metadata.get('chapter') }}"
343
+ }</ pre >
344
+ {% endmacro %}
345
+
321
346
{% macro render_prevnext() %}
322
347
{% if prev_chapter %}
323
348
{% if chapter_lang_exists(lang, year, prev_chapter['slug']) %}
@@ -423,6 +448,8 @@ <h1 class="title title-lg">
423
448
{% endif %}
424
449
< section class ="authors ">
425
450
{{ render_authors() }}
451
+ </ section > < section class ="citation-box ">
452
+ {{ render_bibtex() }}
426
453
</ section >
427
454
< div id ="cta-container " class ="invisible ">
428
455
{% if metadata.get('discuss') %}
0 commit comments