Include theme remotely

This commit is contained in:
Peter Desmet 2018-10-29 19:40:10 +01:00
parent 2379480f87
commit cfe82a2e00
6 changed files with 4 additions and 187 deletions

View File

@ -1 +1,4 @@
theme: jekyll-theme-cayman
# Build settings
markdown: kramdown
theme: tdwg-theme-jekyll
remote_theme: tdwg/tdwg-theme-jekyll

View File

@ -1,21 +0,0 @@
<footer>
<div class="container">
<a href="https://www.tdwg.org/"><img src="https://www.tdwg.org/theme/images/footer_logo.png"></a>
<div class="theme-license">
Content on this site, made open by <a href="https://www.tdwg.org/">Biodiversity Information Standards (TDWG)</a> is licensed under a <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
</div>
</div>
</footer>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://www.tdwg.org/theme/js/jquery.min.js"></script>
<script src="https://www.tdwg.org/theme/js/popper.min.js"></script>
<script src="https://www.tdwg.org/theme/js/bootstrap.min.js"></script>
<script src="https://www.tdwg.org/theme/js/theme.js"></script>
<script>
$(document).ready(function() {
// In quick reference guide: add divider in sidebar after UseWithIRI
$("a[href='#usewithiri']", "#theme-sidebar-nav").parent().addClass("theme-divider-below");
});
</script>

View File

@ -1,20 +0,0 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Darwin Core</title>
<!-- Favicons -->
<link rel="apple-touch-icon" sizes="180x180" href="https://www.tdwg.org/theme/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://www.tdwg.org/theme/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://www.tdwg.org/theme/icons/favicon-16x16.png">
<link rel="manifest" href="https://www.tdwg.org/theme/icons/site.webmanifest">
<link rel="mask-icon" href="https://www.tdwg.org/theme/icons/safari-pinned-tab.svg" color="#617694">
<link rel="shortcut icon" href="https://www.tdwg.org/theme/icons/favicon.ico">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-config" content="https://www.tdwg.org/theme/icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<!-- CSS -->
<link rel="stylesheet" href="https://www.tdwg.org/theme/css/main.css">
</head>

View File

@ -1,32 +0,0 @@
<nav class="navbar navbar-expand navbar-dark bg-secondary">
<div class="container-fluid">
<a class="navbar-brand mr-md-3" href="http://www.tdwg.org">TDWG</a>
<div class="collapse navbar-collapse">
<ul class="navbar-nav mr-md-auto">
<li class="nav-item">
<a class="nav-link" href="{{ "/" | absolute_url }}">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ "terms/" | absolute_url }}">Terms</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown">Guides</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="{{ "simple/" | absolute_url }}">Simple Darwin Core</a>
<a class="dropdown-item" href="{{ "text/" | absolute_url }}">Text</a>
<a class="dropdown-item" href="{{ "xml/" | absolute_url }}">XML</a>
<a class="dropdown-item" href="{{ "rdf/" | absolute_url }}">RDF</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ "namespace/" | absolute_url }}">Namespace policy</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="https://github.com/tdwg/dwc">GitHub</a>
</li>
</ul>
</nav>
</div>
</nav>

View File

@ -1,85 +0,0 @@
{% capture tocWorkspace %}
{% comment %}
Version 1.0.5
https://github.com/allejo/jekyll-toc
"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
Usage:
{% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %}
Parameters:
* html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
Optional Parameters:
* sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
* class (string) : '' - a CSS class assigned to the TOC
* id (string) : '' - an ID to assigned to the TOC
* h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
* h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
* ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
* item_class (string) : '' - add custom class for each list item; has support for '%level%' placeholder, which is the current heading level
* baseurl (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
Output:
An ordered or unordered list representing the table of contents of a markdown block. This snippet will only generate the table of contents and will NOT output the markdown given to it
{% endcomment %}
{% capture my_toc %}{% endcapture %}
{% assign orderedList = include.ordered | default: false %}
{% assign minHeader = include.h_min | default: 1 %}
{% assign maxHeader = include.h_max | default: 6 %}
{% assign nodes = include.html | split: '<h' %}
{% assign firstHeader = true %}
{% capture listModifier %}{% if orderedList %}1.{% else %}-{% endif %}{% endcapture %}
{% for node in nodes %}
{% if node == "" %}
{% continue %}
{% endif %}
{% assign headerLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
{% if headerLevel < minHeader or headerLevel > maxHeader %}
{% continue %}
{% endif %}
{% if firstHeader %}
{% assign firstHeader = false %}
{% assign minHeader = headerLevel %}
{% endif %}
{% assign indentAmount = headerLevel | minus: minHeader | add: 1 %}
{% assign _workspace = node | split: '</h' %}
{% assign _idWorkspace = _workspace[0] | split: 'id="' %}
{% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
{% assign html_id = _idWorkspace[0] %}
{% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
{% assign space = '' %}
{% for i in (1..indentAmount) %}
{% assign space = space | prepend: ' ' %}
{% endfor %}
{% unless include.item_class == blank %}
{% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %}
{% endunless %}
{% capture my_toc %}{{ my_toc }}
{{ space }}{{ listModifier }} {{ listItemClass }} [{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% endcapture %}
{% endfor %}
{% if include.class %}
{% capture my_toc %}{:.{{ include.class }}}
{{ my_toc | lstrip }}{% endcapture %}
{% endif %}
{% if include.id %}
{% capture my_toc %}{: #{{ include.id }}}
{{ my_toc | lstrip }}{% endcapture %}
{% endif %}
{% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}

View File

@ -1,28 +0,0 @@
<!DOCTYPE html>
<html lang="en">
{% include head.html %}
<body data-spy="scroll" data-target="#theme-sidebar-nav">
{% include navbar.html %}
<main class="{% if page.container == 'fixed' %}container{% else %}container-fluid{% endif %}">
<div class="row">
<div class="col-12 col-md-3 order-md-2 theme-sidebar-primary">
<button class="btn d-md-none w-100" type="button" data-toggle="collapse" data-target="#theme-sidebar-nav">
<i class="fa fa-bars fa-lg"></i>
</button>
<nav class="collapse" id="theme-sidebar-nav">
{% include toc.html html=content sanitize=true h_min=2 class="nav.flex-column" item_class="nav-item" %}
</nav>
</div>
<div class="col-12 col-md-9 order-md-1">
{{ content }}
</div>
</div>
</main>
{% include footer.html %}
</body>
</html>