cmu-web-jekyll-and-plaid 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +65 -0
- data/VERSION +1 -0
- data/_includes/cmu/breadcrumbs.html +8 -0
- data/_includes/cmu/footer.html +27 -0
- data/_includes/cmu/head.html +32 -0
- data/_includes/cmu/header.html +14 -0
- data/_includes/cmu/scripts.html +8 -0
- data/_includes/cmu/settings.html +31 -0
- data/_layouts/default.html +39 -0
- data/_layouts/sections.html +24 -0
- data/assets/js/jekyll-and-plaid.js +53 -0
- metadata +146 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: de1d96b7976f0cdcf767330b65447d9dabc990aba3646c4434a1df5cf4137487
|
|
4
|
+
data.tar.gz: 37125573f340c4034a7d6c8864d69bd481d50ea909bd644400a7d1f28727a7fc
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 3a09384c63220970c7c7432b5fc4f3958cb56682a9846a45e2159aca31f3a39f8143e63d1d3e943b7874afebfcb0dd38f0bc74981d6f94765c61d0d59445020a
|
|
7
|
+
data.tar.gz: eefba41331e1985e8b7af7295bb7b777a1efc6d46c456bcbf980f3efd15785256dd164bc7a7671a809ad60128a06df0b53956375e814ad4f6a8ddbac6d89d4e0
|
data/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Carnegie Mellon University
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Jekyll & Plaid as a Gem
|
|
2
|
+
|
|
3
|
+
Jekyll & Plaid is a Jekyll theme in Carnegie Mellon style: Markdown docs
|
|
4
|
+
pages and full-width home pages in CMU's web template, with the
|
|
5
|
+
[Carnegie Mellon Web Kilt](https://webkilt.andrew.cmu.edu/). This gem is
|
|
6
|
+
for sites you build yourself with Jekyll 4, locally or in GitHub Actions.
|
|
7
|
+
|
|
8
|
+
The gem lives in the theme repository's `packages/jekyll/`. Each release
|
|
9
|
+
of the theme publishes it at the same version.
|
|
10
|
+
|
|
11
|
+
## On GitHub Pages
|
|
12
|
+
|
|
13
|
+
GitHub Pages builds only its own list of theme gems, so a Pages site uses
|
|
14
|
+
the theme straight from GitHub instead; it doesn't take this gem. In
|
|
15
|
+
`_config.yml`:
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
remote_theme: cmu-web/cmu-web-jekyll-and-plaid
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## In Your Own Build
|
|
22
|
+
|
|
23
|
+
Add the gem to your site's `Gemfile`:
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
gem 'jekyll', '~> 4.4'
|
|
27
|
+
gem 'cmu-web-jekyll-and-plaid', '~> 0.1'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Then name the theme in `_config.yml`, with the plugins it counts on. They
|
|
31
|
+
do what GitHub Pages does for every site: a layout for every page, the
|
|
32
|
+
first heading as a page's title, pages without front matter, `README.md` as
|
|
33
|
+
the home page and links between Markdown files.
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
title: Your Office or Project
|
|
37
|
+
description: A line under the name
|
|
38
|
+
theme: cmu-web-jekyll-and-plaid
|
|
39
|
+
plugins:
|
|
40
|
+
- jekyll-default-layout
|
|
41
|
+
- jekyll-optional-front-matter
|
|
42
|
+
- jekyll-readme-index
|
|
43
|
+
- jekyll-relative-links
|
|
44
|
+
- jekyll-titles-from-headings
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The gem installs those plugins for you. For the footer's link to your
|
|
48
|
+
repository, add `jekyll-github-metadata` to your `Gemfile` and plugins too,
|
|
49
|
+
and name the repository in `_config.yml` (`repository: your-org/your-repo`).
|
|
50
|
+
|
|
51
|
+
[Writing Pages](https://jekyllandplaid.andrew.cmu.edu/writing.html) covers
|
|
52
|
+
the pages, the home page's sections and the settings you can change.
|
|
53
|
+
|
|
54
|
+
## Work on the Gem
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
cd packages/jekyll
|
|
58
|
+
bundle install
|
|
59
|
+
bundle exec rake test build
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`rake assets` (run by `test` and `build`) copies the theme's `_layouts/`,
|
|
63
|
+
`_includes/` and `assets/` and the license into the gem, and takes its
|
|
64
|
+
version from the latest release tag. The test builds a small Markdown site
|
|
65
|
+
with the theme. `rake clean` removes the copies and the build.
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.0
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{%- unless home %}
|
|
2
|
+
<div class="breadcrumbs">
|
|
3
|
+
{%- if parent.url %}
|
|
4
|
+
<a href="{{ parent.url }}">{{ parent.title }}</a> ›
|
|
5
|
+
{%- endif -%}
|
|
6
|
+
<a href="{{ '/' | relative_url }}">{{ site.title }}</a> › {{ page.title }}
|
|
7
|
+
</div>
|
|
8
|
+
{%- endunless %}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<footer class="grid column3 invert">
|
|
2
|
+
<div>
|
|
3
|
+
<p>{{ office }}<br>{{ address | join: "<br>" }}{% if footer.phone %}<br>{{ footer.phone }}{% endif %}{% if footer.email %}<br><a href="mailto:{{ footer.email }}">Contact Us</a>{% endif %}</p>
|
|
4
|
+
<ul>{% for l in footer.links %}<li><a href="{{ l.url }}">{{ l.title }}</a></li>{% endfor %}<li><a href="https://www.cmu.edu/legal/">Legal Info</a></li><li><a href="https://www.cmu.edu/">www.cmu.edu</a></li></ul>
|
|
5
|
+
<ul><li>© {{ site.time | date: "%Y" }} Carnegie Mellon University</li></ul>
|
|
6
|
+
</div>
|
|
7
|
+
<div></div>
|
|
8
|
+
<div>
|
|
9
|
+
<nav id="nav">
|
|
10
|
+
<ul>
|
|
11
|
+
{%- for p in navpages %}
|
|
12
|
+
{%- if p.url == page.url %}
|
|
13
|
+
<li class="active"><a href="{{ p.url | relative_url }}" aria-current="page">{{ p.title }}</a></li>
|
|
14
|
+
{%- else %}
|
|
15
|
+
<li><a href="{{ p.url | relative_url }}">{{ p.title }}</a></li>
|
|
16
|
+
{%- endif %}
|
|
17
|
+
{%- endfor %}
|
|
18
|
+
{%- for l in cmu.nav_links %}
|
|
19
|
+
<li class="secondary"><a class="external" href="{{ l.url }}">{{ l.title }}</a></li>
|
|
20
|
+
{%- endfor %}
|
|
21
|
+
{%- if site.github.repository_url %}
|
|
22
|
+
<li class="secondary"><a class="external" href="{{ site.github.repository_url }}">{{ site.title }} on GitHub</a></li>
|
|
23
|
+
{%- endif %}
|
|
24
|
+
</ul>
|
|
25
|
+
</nav>
|
|
26
|
+
</div>
|
|
27
|
+
</footer>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<head>
|
|
2
|
+
<meta charset="utf-8">
|
|
3
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
4
|
+
{%- assign summary = page.description | default: site.description %}
|
|
5
|
+
{%- if summary %}
|
|
6
|
+
<meta name="description" content="{{ summary | strip_html | escape }}">
|
|
7
|
+
{%- endif %}
|
|
8
|
+
<title>{% unless home %}{{ page.title }} - {% endunless %}{{ site.title }} - Carnegie Mellon University</title>
|
|
9
|
+
{%- comment -%} Link previews: the kit's Link Previews standard {%- endcomment %}
|
|
10
|
+
<meta property="og:type" content="{% if page.date and page.author %}article{% else %}website{% endif %}">
|
|
11
|
+
<meta property="og:site_name" content="{{ site.title | escape }}">
|
|
12
|
+
<meta property="og:title" content="{% unless home %}{{ page.title | escape }} - {% endunless %}{{ site.title | escape }}">
|
|
13
|
+
{%- if summary %}
|
|
14
|
+
<meta property="og:description" content="{{ summary | strip_html | escape }}">
|
|
15
|
+
{%- endif %}
|
|
16
|
+
<meta property="og:url" content="{{ page.url | absolute_url }}">
|
|
17
|
+
{%- if preview %}
|
|
18
|
+
<meta property="og:image" content="{{ preview | absolute_url }}">
|
|
19
|
+
<meta property="og:image:width" content="1200">
|
|
20
|
+
<meta property="og:image:height" content="630">
|
|
21
|
+
<meta property="og:image:alt" content="{{ cmu.preview_alt | default: previewalt | escape }}">
|
|
22
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
23
|
+
{%- endif %}
|
|
24
|
+
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,300italic,300,700,700italic" rel="stylesheet">
|
|
25
|
+
<link href="{{ tpl }}/css/main.6.7.min.css" media="screen" rel="stylesheet">
|
|
26
|
+
<link href="{{ tpl }}/css/print.min.css" media="print" rel="stylesheet">
|
|
27
|
+
<link href="{{ kitcdn }}/css/cmu-cms.css" rel="stylesheet">
|
|
28
|
+
<link href="https://www.cmu.edu/favicon.ico" rel="icon">
|
|
29
|
+
<link href="https://www.cmu.edu/favicon-152.png" rel="apple-touch-icon-precomposed">
|
|
30
|
+
<meta content="#9f0000" name="msapplication-TileColor">
|
|
31
|
+
<meta content="https://www.cmu.edu/favicon-144.png" name="msapplication-TileImage">
|
|
32
|
+
</head>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<header>
|
|
2
|
+
<div class="roof {{ roof }}">
|
|
3
|
+
<div>
|
|
4
|
+
<a class="wordmark" href="https://www.cmu.edu/">Carnegie Mellon University</a>
|
|
5
|
+
<button type="button" aria-label="toggle menu" aria-pressed="false" class="menu-btn" href="#nav"><b>—</b><b>—</b><b>—</b></button>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
<div id="sitename">
|
|
9
|
+
<span class="sitetitle"><a href="{{ '/' | relative_url }}">{{ site.title }}</a></span>
|
|
10
|
+
{%- if site.description %}
|
|
11
|
+
<h2>{% if parent.url %}<a href="{{ parent.url }}">{{ site.description }}</a>{% else %}{{ site.description }}{% endif %}</h2>
|
|
12
|
+
{%- endif %}
|
|
13
|
+
</div>
|
|
14
|
+
</header>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script src="{{ tpl }}/js/list.min.js"></script>
|
|
2
|
+
<script src="{{ tpl }}/js/jquery-1.10.1.min.js"></script>
|
|
3
|
+
<script src="{{ tpl }}/js/main.6.7.min.js"></script>
|
|
4
|
+
{%- if page.carousel %}
|
|
5
|
+
<script src="{{ tpl }}/js/flickity.pkgd.min.js"></script>
|
|
6
|
+
{%- endif %}
|
|
7
|
+
<script src="{{ kitcdn }}/js/cmu-app.js"></script>
|
|
8
|
+
<script src="{{ '/assets/js/jekyll-and-plaid.js' | relative_url }}"></script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{%- comment -%}
|
|
2
|
+
Reads the site's settings for the other includes. Every layout includes it first.
|
|
3
|
+
{%- endcomment -%}
|
|
4
|
+
{%- assign cmu = site.cmu -%}
|
|
5
|
+
{%- assign kit = cmu.kit | default: "0.2.6" -%}
|
|
6
|
+
{%- assign kitcdn = "https://cdn.jsdelivr.net/gh/cmu-web/cmu-web-kilt@" | append: kit -%}
|
|
7
|
+
{%- assign tpl = "https://www.cmu.edu/common/standard-v6" -%}
|
|
8
|
+
{%- assign roof = "red invert" -%}
|
|
9
|
+
{%- if cmu.roof == "gray" or cmu.roof == "grey" -%}{%- assign roof = "darkgrey invert" -%}{%- elsif cmu.roof == "white" -%}{%- assign roof = "" -%}{%- endif -%}
|
|
10
|
+
{%- assign home = false -%}{%- if page.url == "/" or page.url == "/index.html" -%}{%- assign home = true -%}{%- endif -%}
|
|
11
|
+
{%- if cmu.nav -%}
|
|
12
|
+
{%- assign navpages = "" | split: "" -%}
|
|
13
|
+
{%- for name in cmu.nav -%}
|
|
14
|
+
{%- assign found = site.html_pages | where: "path", name | first -%}
|
|
15
|
+
{%- if found -%}{%- assign navpages = navpages | push: found -%}{%- endif -%}
|
|
16
|
+
{%- endfor -%}
|
|
17
|
+
{%- else -%}
|
|
18
|
+
{%- assign listed = site.html_pages | where_exp: "p", "p.title" | where_exp: "p", "p.nav_exclude != true" | where_exp: "p", "p.url != '/'" | where_exp: "p", "p.url != '/index.html'" -%}
|
|
19
|
+
{%- comment -%} Pages with a nav_order first, in that order; then the rest, by title {%- endcomment -%}
|
|
20
|
+
{%- assign ordered = listed | where_exp: "p", "p.nav_order" | sort: "nav_order" -%}
|
|
21
|
+
{%- assign rest = listed | where_exp: "p", "p.nav_order == nil" | sort: "title" -%}
|
|
22
|
+
{%- assign navpages = ordered | concat: rest -%}
|
|
23
|
+
{%- endif -%}
|
|
24
|
+
{%- comment -%} The link preview image: cmu.preview, or images/preview.jpg when the site has one {%- endcomment -%}
|
|
25
|
+
{%- assign preview = cmu.preview -%}
|
|
26
|
+
{%- unless preview -%}{%- assign found = site.static_files | where: "path", "/images/preview.jpg" | first -%}{%- if found -%}{%- assign preview = "/images/preview.jpg" -%}{%- endif -%}{%- endunless -%}
|
|
27
|
+
{%- assign previewalt = site.title | append: "'s home page." -%}
|
|
28
|
+
{%- assign parent = cmu.parent -%}
|
|
29
|
+
{%- assign footer = cmu.footer -%}
|
|
30
|
+
{%- assign office = footer.office | default: cmu.office | default: site.title -%}
|
|
31
|
+
{%- if footer.address -%}{%- assign address = footer.address -%}{%- else -%}{%- assign address = "Carnegie Mellon University|5000 Forbes Avenue|Pittsburgh, PA 15213" | split: "|" -%}{%- endif -%}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{%- comment -%}
|
|
2
|
+
Jekyll & Plaid: Markdown on GitHub Pages, in Carnegie Mellon's web template
|
|
3
|
+
with the Carnegie Mellon Web Kilt. Settings, all optional, in _config.yml:
|
|
4
|
+
title the site's name, in the header and footer
|
|
5
|
+
description a line under the name
|
|
6
|
+
cmu.roof red (default), gray or white
|
|
7
|
+
cmu.kit the Web Kilt release to load (default 0.2.6, the one the theme is tested with)
|
|
8
|
+
cmu.parent the office or site this one belongs to (title and url): first in
|
|
9
|
+
the breadcrumbs, and the description links to it
|
|
10
|
+
cmu.nav the pages in the navigation, in order, by file name; without
|
|
11
|
+
it, every page with a title, by nav_order in its front matter
|
|
12
|
+
cmu.footer office (defaults to title), address (a list of lines),
|
|
13
|
+
phone, email (a Contact Us link) and links (title and url)
|
|
14
|
+
cmu.nav_links other sites to list after the pages in the navigation (title and url)
|
|
15
|
+
cmu.preview the link preview image (default images/preview.jpg, when the site has one)
|
|
16
|
+
cmu.preview_alt its alt text (default "<title>'s home page.")
|
|
17
|
+
Markdown's ## headings get the template's rule-top line, as section headings do in the
|
|
18
|
+
Web Kilt. Each page's description, or the site's, becomes its meta description. For a page with
|
|
19
|
+
full-width sections, use the sections layout.
|
|
20
|
+
{%- endcomment -%}
|
|
21
|
+
{%- include cmu/settings.html -%}
|
|
22
|
+
<!DOCTYPE html>
|
|
23
|
+
<html lang="{{ site.lang | default: 'en' }}">
|
|
24
|
+
{% include cmu/head.html -%}
|
|
25
|
+
<body class="no-js">
|
|
26
|
+
<div id="container">
|
|
27
|
+
{% include cmu/header.html %}
|
|
28
|
+
<main id="content">
|
|
29
|
+
{%- include cmu/breadcrumbs.html %}
|
|
30
|
+
<div class="content wide"><div>
|
|
31
|
+
{{ content | replace: "<table>", '<table class="alternate cmu-full">' | replace: "<h2 id=", '<h2 class="rule-top" id=' }}
|
|
32
|
+
</div></div>
|
|
33
|
+
</main>
|
|
34
|
+
|
|
35
|
+
{% include cmu/footer.html -%}
|
|
36
|
+
</div>
|
|
37
|
+
{% include cmu/scripts.html -%}
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{%- comment -%}
|
|
2
|
+
A full-width page: the same header and footer as the default layout, with the page's own
|
|
3
|
+
template sections (heroes, color bands, grids, a content area with a sidebar) placed straight
|
|
4
|
+
into #content instead of one column. Write the page in HTML. Front matter, all optional:
|
|
5
|
+
breadcrumbs false to leave them off; the home page never has them
|
|
6
|
+
carousel true to load the template's carousel script, for a js-flickityCustom section
|
|
7
|
+
{%- endcomment -%}
|
|
8
|
+
{%- include cmu/settings.html -%}
|
|
9
|
+
<!DOCTYPE html>
|
|
10
|
+
<html lang="{{ site.lang | default: 'en' }}">
|
|
11
|
+
{% include cmu/head.html -%}
|
|
12
|
+
<body class="no-js">
|
|
13
|
+
<div id="container">
|
|
14
|
+
{% include cmu/header.html %}
|
|
15
|
+
<main id="content">
|
|
16
|
+
{%- unless page.breadcrumbs == false %}{% include cmu/breadcrumbs.html %}{% endunless %}
|
|
17
|
+
{{ content }}
|
|
18
|
+
</main>
|
|
19
|
+
|
|
20
|
+
{% include cmu/footer.html -%}
|
|
21
|
+
</div>
|
|
22
|
+
{% include cmu/scripts.html -%}
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* Jekyll & Plaid: turn what Markdown writes into the Carnegie Mellon Web Kilt's
|
|
2
|
+
components. Runs after the template's scripts and the kit's cmu-app.js. */
|
|
3
|
+
(function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
// The whole page, so it works in every layout; what a page writes as kit components already
|
|
6
|
+
// is left alone
|
|
7
|
+
var content = document.getElementById("content");
|
|
8
|
+
if (!content) return;
|
|
9
|
+
|
|
10
|
+
// Code blocks: a kit code block with a copy icon in its corner
|
|
11
|
+
content.querySelectorAll("pre:not(.cmu-snippet)").forEach(function (pre, i) {
|
|
12
|
+
var code = pre.querySelector("code") || pre;
|
|
13
|
+
var box = document.createElement("div");
|
|
14
|
+
box.className = "cmu-copyable";
|
|
15
|
+
var block = box.appendChild(document.createElement("pre"));
|
|
16
|
+
block.className = "cmu-snippet";
|
|
17
|
+
block.id = "cmu-code-" + (i + 1);
|
|
18
|
+
block.appendChild(document.createElement("code")).textContent = code.textContent.replace(/\n$/, "");
|
|
19
|
+
var copy = box.appendChild(document.createElement("button"));
|
|
20
|
+
copy.className = "cmu-copy";
|
|
21
|
+
copy.type = "button";
|
|
22
|
+
copy.setAttribute("data-cmu-copy", "#" + block.id);
|
|
23
|
+
copy.setAttribute("aria-label", "Copy Code");
|
|
24
|
+
copy.title = "Copy Code";
|
|
25
|
+
// Markdown wraps highlighted code in two divs; replace the outermost
|
|
26
|
+
(pre.closest(".highlighter-rouge") || pre).replaceWith(box);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// GitHub's callouts (> [!NOTE] and the like) become kit callouts with
|
|
30
|
+
// their label; any other block quote becomes a kit note
|
|
31
|
+
var LABELS = { NOTE: "Note", TIP: "Tip", IMPORTANT: "Important", WARNING: "Warning", CAUTION: "Caution" };
|
|
32
|
+
// The kit's callout colors; Important stays the plain gray callout
|
|
33
|
+
var COLORS = { NOTE: "blue", TIP: "green", WARNING: "gold", CAUTION: "red" };
|
|
34
|
+
content.querySelectorAll("blockquote").forEach(function (quote) {
|
|
35
|
+
var first = quote.querySelector("p");
|
|
36
|
+
var match = first && first.firstChild && first.firstChild.nodeType === 3 && first.firstChild.nodeValue.match(/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/i);
|
|
37
|
+
var box = document.createElement("div");
|
|
38
|
+
if (match) {
|
|
39
|
+
first.firstChild.nodeValue = first.firstChild.nodeValue.slice(match[0].length);
|
|
40
|
+
if (!first.textContent.trim()) first.remove();
|
|
41
|
+
var kind = match[1].toUpperCase();
|
|
42
|
+
box.className = "cmu-callout" + (COLORS[kind] ? " cmu-callout--" + COLORS[kind] : "");
|
|
43
|
+
var label = document.createElement("p");
|
|
44
|
+
label.className = "cmu-label";
|
|
45
|
+
label.textContent = LABELS[kind];
|
|
46
|
+
box.appendChild(label);
|
|
47
|
+
} else {
|
|
48
|
+
box.className = "cmu-note";
|
|
49
|
+
}
|
|
50
|
+
while (quote.firstChild) box.appendChild(quote.firstChild);
|
|
51
|
+
quote.replaceWith(box);
|
|
52
|
+
});
|
|
53
|
+
})();
|
metadata
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: cmu-web-jekyll-and-plaid
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Carnegie Mellon University
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: jekyll
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '4.3'
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '5'
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
requirements:
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: '4.3'
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '5'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: jekyll-default-layout
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - "~>"
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0.1'
|
|
39
|
+
type: :runtime
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - "~>"
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0.1'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: jekyll-optional-front-matter
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - "~>"
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0.3'
|
|
53
|
+
type: :runtime
|
|
54
|
+
prerelease: false
|
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - "~>"
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0.3'
|
|
60
|
+
- !ruby/object:Gem::Dependency
|
|
61
|
+
name: jekyll-readme-index
|
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - "~>"
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: '0.3'
|
|
67
|
+
type: :runtime
|
|
68
|
+
prerelease: false
|
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
70
|
+
requirements:
|
|
71
|
+
- - "~>"
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: '0.3'
|
|
74
|
+
- !ruby/object:Gem::Dependency
|
|
75
|
+
name: jekyll-relative-links
|
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
|
77
|
+
requirements:
|
|
78
|
+
- - "~>"
|
|
79
|
+
- !ruby/object:Gem::Version
|
|
80
|
+
version: '0.7'
|
|
81
|
+
type: :runtime
|
|
82
|
+
prerelease: false
|
|
83
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
84
|
+
requirements:
|
|
85
|
+
- - "~>"
|
|
86
|
+
- !ruby/object:Gem::Version
|
|
87
|
+
version: '0.7'
|
|
88
|
+
- !ruby/object:Gem::Dependency
|
|
89
|
+
name: jekyll-titles-from-headings
|
|
90
|
+
requirement: !ruby/object:Gem::Requirement
|
|
91
|
+
requirements:
|
|
92
|
+
- - "~>"
|
|
93
|
+
- !ruby/object:Gem::Version
|
|
94
|
+
version: '0.5'
|
|
95
|
+
type: :runtime
|
|
96
|
+
prerelease: false
|
|
97
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
98
|
+
requirements:
|
|
99
|
+
- - "~>"
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: '0.5'
|
|
102
|
+
description: 'Jekyll & Plaid builds sites with Carnegie Mellon''s web template and
|
|
103
|
+
the Carnegie Mellon Web Kilt: Markdown docs pages and full-width home pages that
|
|
104
|
+
look like cmu.edu.'
|
|
105
|
+
executables: []
|
|
106
|
+
extensions: []
|
|
107
|
+
extra_rdoc_files: []
|
|
108
|
+
files:
|
|
109
|
+
- LICENSE
|
|
110
|
+
- README.md
|
|
111
|
+
- VERSION
|
|
112
|
+
- _includes/cmu/breadcrumbs.html
|
|
113
|
+
- _includes/cmu/footer.html
|
|
114
|
+
- _includes/cmu/head.html
|
|
115
|
+
- _includes/cmu/header.html
|
|
116
|
+
- _includes/cmu/scripts.html
|
|
117
|
+
- _includes/cmu/settings.html
|
|
118
|
+
- _layouts/default.html
|
|
119
|
+
- _layouts/sections.html
|
|
120
|
+
- assets/js/jekyll-and-plaid.js
|
|
121
|
+
homepage: https://jekyllandplaid.andrew.cmu.edu/
|
|
122
|
+
licenses:
|
|
123
|
+
- BSD-3-Clause
|
|
124
|
+
metadata:
|
|
125
|
+
source_code_uri: https://github.com/cmu-web/cmu-web-jekyll-and-plaid
|
|
126
|
+
documentation_uri: https://github.com/cmu-web/cmu-web-jekyll-and-plaid/tree/main/packages/jekyll#readme
|
|
127
|
+
bug_tracker_uri: https://github.com/cmu-web/cmu-web-jekyll-and-plaid/issues
|
|
128
|
+
rubygems_mfa_required: 'true'
|
|
129
|
+
rdoc_options: []
|
|
130
|
+
require_paths:
|
|
131
|
+
- lib
|
|
132
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
133
|
+
requirements:
|
|
134
|
+
- - ">="
|
|
135
|
+
- !ruby/object:Gem::Version
|
|
136
|
+
version: '3.2'
|
|
137
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
|
+
requirements:
|
|
139
|
+
- - ">="
|
|
140
|
+
- !ruby/object:Gem::Version
|
|
141
|
+
version: '0'
|
|
142
|
+
requirements: []
|
|
143
|
+
rubygems_version: 3.6.9
|
|
144
|
+
specification_version: 4
|
|
145
|
+
summary: A Jekyll theme in Carnegie Mellon style
|
|
146
|
+
test_files: []
|