Skip to content

Commit 919a6c3

Browse files
authored
Merge pull request #347 from creativecommons/specimen-index
Add specimen index
2 parents f6ce1a7 + 7eae96f commit 919a6c3

File tree

3 files changed

+58
-38
lines changed

3 files changed

+58
-38
lines changed

docs/index.html

+28-22
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en-US">
33
<head>
44
<title>Vocabulary - Docs</title>
5-
5+
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77

88
<link rel="stylesheet" media="all" href="style.css" />
@@ -26,10 +26,10 @@ <h1>Vocabulary</h1>
2626

2727
<nav>
2828
<ul>
29-
<li><a href="#introduction" class="active">Introduction</a></li>
29+
<li><a href="#introduction" class="active">Introduction</a></li>
3030
<li><a href="#installation">Installation</a></li>
3131
<li><a href="#components">Components</a></li>
32-
32+
<li><a href="#specimen">Specimen Index</a></li>
3333
</ul>
3434

3535
</nav>
@@ -82,7 +82,7 @@ <h4>A prototype contains:</h4>
8282

8383
<h3 id="upstream-downstream-change-flow">Upstream/Downstream Change Flow</h3>
8484

85-
This enables two modes of build work.
85+
This enables two modes of build work.
8686

8787
<h4>A: upstream → downstream</h4>
8888
<ol>
@@ -121,25 +121,25 @@ <h3>02. CSS Installation</h3>
121121

122122
<pre>
123123
<code class="lang-html">
124-
124+
125125
<link rel="stylesheet" media="all" href="PATH/TO/style.css" />
126-
126+
127127
</code>
128128
</pre>
129129

130130

131131

132132
<p>Include <span class="distinct">vocabulary.css</span> from within <span class="distinct">style.css</span> via a <a href="#">CSS @layer import</a> at the top of the file.</p>
133133

134-
<aside>
134+
<aside>
135135
<p>CSS Layers provide a reliable, and safely overridable cascade of rulesets.</p>
136136
</aside>
137137

138138
<pre>
139139
<code class="lang-css">
140-
140+
141141
@import 'PATH/TO/vocabulary/css/vocabulary.css' layer(vocabulary);
142-
142+
143143
</code>
144144
</pre>
145145

@@ -149,11 +149,11 @@ <h3>02. CSS Installation</h3>
149149

150150
<pre>
151151
<code class="lang-css">
152-
152+
153153
@import 'PATH/TO/vocabulary/css/vocabulary.css' layer(vocabulary);
154154
@import 'PATH/TO/vocabulary/css/vocabulary-tests.css' layer(vocabulary-tests);
155-
156-
155+
156+
157157
</code>
158158
</pre>
159159

@@ -170,7 +170,7 @@ <h3>03. JS Installation</h3>
170170

171171
<script src="PATH/TO/vocabulary/js/vocabulary.js"></script>
172172

173-
173+
174174
</code>
175175
</pre>
176176

@@ -198,15 +198,15 @@ <h3 id="global-header">Header - Global Area</h3><a class="permalink" href="#glob
198198

199199
<p>The Global Header component contains several sub-elements.</p>
200200
<ul>
201-
201+
202202
<li>
203203
Masthead
204204
<ul>
205205
<li>Entity Logo</li>
206206
<li>Primary Nav Menu</li>
207207
<li>Ancillary Nav Menu</li>
208208
</ul>
209-
</li>
209+
</li>
210210
<li>
211211
Explore Panel (Explore CC)
212212
<ul>
@@ -300,7 +300,7 @@ <h2>Our Work Relies On You!</h2>
300300

301301
</header>
302302

303-
303+
304304
</code>
305305
</pre>
306306

@@ -394,7 +394,7 @@ <h2>Support Our Work</h2>
394394

395395
</footer>
396396

397-
397+
398398
</code>
399399
</pre>
400400

@@ -454,7 +454,7 @@ <h4>Expected Contexts</h4>
454454
<code class="lang-html">
455455

456456
<article class="attention">
457-
457+
458458
content here
459459

460460
</article>
@@ -576,7 +576,7 @@ <h4>Expected Contexts</h4>
576576
<article class="posts">
577577

578578
<h2>Title Here</h2>
579-
579+
580580
<article class="story">
581581
<header>
582582
<h3><a href="#">Title Here</a></h3>
@@ -797,7 +797,7 @@ <h2>Title</h2>
797797
<h3 class="stat">55+ million articles</h3>
798798
<p>Descriptive text here</p>
799799
</article>
800-
800+
801801

802802
</code>
803803
</pre>
@@ -961,7 +961,7 @@ <h1>Title Here</h1>
961961
<span class="categories"> <!-- optional -->
962962
<a href="#">Open Culture</a>
963963
</span>
964-
964+
965965
</header>
966966

967967
</code>
@@ -991,13 +991,19 @@ <h1>Name</h1>
991991
<div class="bio">
992992
<p>Bio here</p>
993993
</div>
994-
994+
995995
</header>
996996

997997
</code>
998998
</pre>
999999

10001000

1001+
<h2 id="specimen">Specimen Index</h2><a class="permalink" href="#specimen">permalink</a>
1002+
1003+
<ul>
1004+
<li><a href="specimen/index.html">Vocabulary Specimens</a></li>
1005+
</ul>
1006+
10011007
</main>
10021008

10031009

netlify-deploy.sh

+18-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,29 @@ E107="$(printf "\033[107m")" # bright white background
1010

1111
#### FUNCTIONS ################################################################
1212

13+
build_specimen_index() {
14+
print_header 'Build Vocabulary Specimens index'
15+
build_specimen_index_file > docs/specimen/index.html
16+
echo 'done.'
17+
echo
18+
}
19+
20+
build_specimen_index_file() {
21+
local _file _relative
22+
head -n14 specimen/index.html
23+
for _file in docs/specimen/contexts/*.html
24+
do
25+
_relative="${_file#docs/specimen/}"
26+
echo " <li><a href='${_relative}'>${_relative}</a></li>"
27+
done
28+
echo " </ul>\n </main>\n</body>\n</html>"
29+
}
1330

1431
print_header() {
1532
# Print 80 character wide black on white heading with time
1633
printf "${E30}${E107}# %-69s$(date '+%T') ${E0}\n" "${@}"
1734
}
1835

19-
2036
remove_previous_from_docs() {
2137
# shellcheck disable=SC2016
2238
print_header 'Remove previous publish from the `docs/` directory'
@@ -26,7 +42,6 @@ remove_previous_from_docs() {
2642
echo
2743
}
2844

29-
3045
publish_to_docs() {
3146
# shellcheck disable=SC2016
3247
print_header 'Publish to the `docs/` directory'
@@ -37,8 +52,8 @@ publish_to_docs() {
3752
echo
3853
}
3954

40-
4155
#### MAIN #####################################################################
4256

4357
remove_previous_from_docs
4458
publish_to_docs
59+
build_specimen_index

specimen/index.html

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
<!DOCTYPE html>
2+
<!-- Changes to this file may require changes to netlify-deploy.sh
3+
That script assumes the <ul>, below, appears on a specific line -->
24
<html lang="en-US">
35
<head>
4-
<title>Vocabulary - Specimens</title>
5-
<meta charset="UTF-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
8-
<!-- <link rel="stylesheet" media="all" href="style.css"> -->
9-
6+
<title>Vocabulary - Specimens</title>
7+
<meta charset="UTF-8">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<link rel="stylesheet" media="all" href="/style.css">
1010
</head>
1111
<body>
12-
13-
<h1>Vocabulary Specimens</h1>
14-
15-
<ul>
16-
<li><a href="#">item</a></li>
17-
</ul>
18-
12+
<main>
13+
<h1>Vocabulary Specimens</h1>
14+
<ul>
15+
<li><a href="#">item</a></li>
16+
</ul>
17+
</main>
1918
</body>
2019
</html>

0 commit comments

Comments
 (0)