-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoc.html
74 lines (70 loc) · 2.93 KB
/
toc.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
layout: default
---
{%- comment -%}
================ WARNING ================
See bylaws_new.md for context
This is a gross hack to pass the last modified date up to the layout. We
want it to be possible to automatically calculate the last modified date
of all the bylaws by calculating the last modified dates of all the sections.
To do that we need to calculate it here and pass it up to the layout. Sadly,
it is impossible to pass variables up in scope in liquid (the jekyll markup
language). So, we resort to the awful hack. It... shouldn't break. But if it
does, please just delete the code below and use `date_modified` in the
frontmatter of this page. I'm sorry you had to read this.
================ WARNING ================
{%- endcomment -%}
{%- assign splitted = content | split: "VPASSUP_LAST_MODIFIED_" -%}
{%- assign raw_mtime = splitted | last -%}
{%- assign raw_content = splitted | first -%}
<header class="post-header toc">
<h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}</h1>
<p class="post-meta">
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
{%- if page.date -%}
<time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
Published {{ page.date | date: date_format }}
</time>
{%- endif -%}
{%- if page.modified_date or splitted.size > 1 -%}
{%- if page.date -%}
/
{%- endif -%}
Last Updated
{%- if splitted.size > 1 -%}
{%- assign mdate = raw_mtime | plus: 0 | date: "%F" | date_to_xmlschema -%}
{%- else -%}
{%- assign mdate = page.modified_date | date_to_xmlschema -%}
{%- endif -%}
<time class="dt-modified" datetime="{{ mdate }}" itemprop="dateModified">
{{ mdate | date: date_format }}
</time>
{%- endif -%}
{%- if page.author -%}
• {% for author in page.author %}
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span class="p-author h-card" itemprop="name">{{ author }}</span></span>
{%- if forloop.last == false %}, {% endif -%}
{% endfor %}
{%- endif -%}</p>
</header>
<main class="toc page-content" aria-label="Content">
<div class="content">
{%- if raw_content -%}
{{ raw_content }}
{%- else -%}
{{ content }}
{%- endif -%}
</div>
<!-- <div>
<aside class="toc-right-sidebar">
<nav class="toc">
<header><h4 class="nav__title"><i class="fas fa-{{ page.toc_icon | default: 'file-alt' }}"></i> {{ page.toc_label | default: site.data.ui-text[site.locale].toc_label | default: "On this page" }}</h4></header>
{% include toc.html sanitize=true html=content h_min=1 h_max=3 class="toc__menu" %}
</nav>
</aside>
</div> -->
<div>
<nav class="toc-right-sidebar" id="toc" class="toc page-content"></nav>
</div>
</main>