-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjekyll.html
118 lines (88 loc) · 2.9 KB
/
jekyll.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
layout: default
title: Jekyll Documentation
---
{% assign book = site.data.jekyll.book %}
<!-- todo: check - can we use book.contents - why? why not? -->
{% assign book_contents = site.data.jekyll.contents %}
<p>
<a href="index.html">Hyde Press</a>
</p>
<!-- cover -->
Simple • Static • Blog-aware
<h1>{{ book.title }}</h1>
<h3>by {{ book.author.name }}</h3>
<!-- fix: use book.subtitle -->
<p>Transform your plain text into static sites and blogs</p>
<!-- table of contents -->
<div class='toc'>
Contents
<ul>
{% for part in book_contents %}
<li>{{ part.title }}
<ul>
{% for chapter in part.sections %}
<li>{{ chapter.title }}</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
<h2>Preface</h1>
<p>
<b>Note:</b> The book edition is still an early release and a work-in-progess.
</p>
<p>
This is the <a href="https://github.com/jekyll/jekyll/tree/master/site/_docs">(official) documentation</a> for the Jekyll static site builder / generator
reformatted in a single-page book edition.
</p>
<p>See the <a href="https://github.com/hydepress/jekyll">source repo</a> for how
the book gets auto-built with "plain" Jekyll - of course - and hosted on GitHub Pages.
</p>
<p>
Questions? Comments? Send them to the Jekyll Talk forum post
titled <a href="https://talk.jekyllrb.com/t/jekyll-docu-reformatted-as-a-single-page-in-black-n-white-book-version-why-why-not/1908">Jekyll Docu Reformatted as a Single-Page in Black 'n' White (Book Version) - Why? Why Not?</a>.
</p>
<p>
Onwards.
</p>
<h2>Acknowledgments</h2>
<p>
Thanks to all Jekyll contributors for making it all possible.
</p>
<!-- chapters -->
{% for part in book_contents %}
<h1 class="part">Part {{ forloop.index }} - {{ part.title }}</h1>
{% assign part_index = forloop.index %}
{% for chapter in part.sections %}
<div class="chapter">
<h1>Chapter {{ part_index }}.{{ forloop.index }} - {{ chapter.title }}</h1>
<!-- add mini table of contents for chapter if available -->
{% if chapter.sections %}
Contents
<ul>
{% for sec in chapter.sections %}
<li>{{ sec.title }}
{% if sec.sections %}
<ul>
{% for subsec in sec.sections %}
<li>{{ subsec.title }}</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
<!-- try adding content using include_relative -->
{% capture txt %}{% include_relative _jekyll/{{chapter.path}} %}{% endcapture %}
<!-- hack: cut off yaml front matter header
possible alternative??:
try to use collection and use a content lookup with title or path - why? whynot??
-->
{% assign txt2 = txt | replace_first: '---', '' | replace_first: '---', '@@END@@' | split: '@@END@@' %}
{{ txt2[1] | markdownify }}
</div>
{% endfor %}
{% endfor %}