-
Notifications
You must be signed in to change notification settings - Fork 3
/
references_list.html
50 lines (50 loc) · 2.04 KB
/
references_list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{% comment %}
Pouziti: `include references_list.html references={object[]}`
- `references`: Pole referencí združených do sekcí:
```
- `section`: string|object[] – odkaz na soubor ve složce 'reference' (v datech), nebo pojmenovani nasledujiciho pole referenci (nema interni ucel)
[`reference`: object
`caption`: Text or link text
[`href`]: URL if link
[`title`]: Title for link
[`description`]: Append (separated by " – ")
]
```
- ukázka:
```
- sekce1
- sekce2:
- reference1:
caption: Popis
- reference2:
caption: Popis
href: link
title: pro linky
description: za referencí
```
{% endcomment
%}{% assign references_src= include.references
%}{% if references_src %}
<ol>{% for ref_src in references_src
%}{% if ref_src.first.first
%}{% assign references= ref_src.first.last
%}{% else
%}{% assign references= site.data.reference[ref_src]
%}{% endif
%}{% for reference in references
%}{% assign name= reference.first
%}{% assign params= reference.last
%}<li id="ref_{{ name | url_encode }}" ><b>[{{ name }}]</b> {%
if params.href
%}<a href="{{params.href}}" title="{{params.title}}">{{params.caption}}</a>{%
else
%}{{ params.caption
}}{% endif
%}{% if params.description
%}{{ params.description | markdownify | remove_first: "<p>" | split: "" | reverse | join: "" | remove_first: ">p/<" | split: "" | reverse | join: "" | prepend: " – "
}}{% endif
%}</li>{%
endfor
%}{% endfor %}
</ol>{%
endif %}