aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorAlex Shpak <alex-shpak@users.noreply.github.com>2019-05-23 16:30:26 +0200
committerAlex Shpak <alex-shpak@users.noreply.github.com>2019-05-23 16:30:26 +0200
commit5437521798291b54dabb6645de0094e458c9c228 (patch)
tree82442ce353ef00a7f0e066bd4807f8a6d6bb1145 /layouts
parentc80bd79dcd8a4bea3a15061dc6e17a46d374d485 (diff)
#39, Finish columns shortcode, clean scss
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/docs/git-footer.html2
-rw-r--r--layouts/partials/docs/shared.html2
-rw-r--r--layouts/shortcodes/column.html10
-rw-r--r--layouts/shortcodes/columns.html7
-rw-r--r--layouts/shortcodes/expand.html2
-rw-r--r--layouts/shortcodes/mermaid.html9
-rw-r--r--layouts/shortcodes/tab.html2
7 files changed, 20 insertions, 14 deletions
diff --git a/layouts/partials/docs/git-footer.html b/layouts/partials/docs/git-footer.html
index 1f54daa..c61d759 100644
--- a/layouts/partials/docs/git-footer.html
+++ b/layouts/partials/docs/git-footer.html
@@ -1,5 +1,5 @@
{{ if or .GitInfo .Site.Params.BookEditPath }}
-<div class="align-center book-git-footer {{ if not .GitInfo }}justify-end{{ else }}justify-between{{ end }}">
+<div class="book-footer {{ if not .GitInfo }}justify-end{{ else }}justify-between{{ end }}">
{{ with .GitInfo }}
<div>
{{ $date := .AuthorDate.Local.Format (default "January 2, 2006" $.Site.Params.BookDateFormat) }}
diff --git a/layouts/partials/docs/shared.html b/layouts/partials/docs/shared.html
index a5075c8..2545dea 100644
--- a/layouts/partials/docs/shared.html
+++ b/layouts/partials/docs/shared.html
@@ -37,4 +37,4 @@
menu.scrollTop = localStorage.getItem('menu.scrollTop')
})()
</script>
-{{ end }} \ No newline at end of file
+{{ end }}
diff --git a/layouts/shortcodes/column.html b/layouts/shortcodes/column.html
deleted file mode 100644
index 1951150..0000000
--- a/layouts/shortcodes/column.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{{ if .Inner }}
-<div class="flex">
- <div class="flex-even">
- {{ .Inner | markdownify }}
- </div>
-</div>
-{{ else }}
- </div> <!-- close current column -->
- <div class="flex-even"> <!-- open new column -->
-{{ end }}
diff --git a/layouts/shortcodes/columns.html b/layouts/shortcodes/columns.html
new file mode 100644
index 0000000..ec62322
--- /dev/null
+++ b/layouts/shortcodes/columns.html
@@ -0,0 +1,7 @@
+<div class="book-columns flex">
+ {{ range split .Inner "<--->" }}
+ <div class="flex-even">
+ {{ . | markdownify }}
+ </div>
+ {{ end }}
+</div>
diff --git a/layouts/shortcodes/expand.html b/layouts/shortcodes/expand.html
index 049fdd1..547fb3f 100644
--- a/layouts/shortcodes/expand.html
+++ b/layouts/shortcodes/expand.html
@@ -6,7 +6,7 @@
</div>
<input type="checkbox" style="display: none" />
<div class="book-expand-content markdown-inner">
- {{- .Inner | markdownify -}}
+ {{ .Inner | markdownify }}
</div>
</label>
</div>
diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html
new file mode 100644
index 0000000..d156f07
--- /dev/null
+++ b/layouts/shortcodes/mermaid.html
@@ -0,0 +1,9 @@
+{{ if not (.Page.Scratch.Get "mermaid") }}
+<!-- Include mermaid only first time -->
+<script src="{{ "mermaid.min.js" | absURL }}"></script>
+{{ .Page.Scratch.Set "mermaid" true }}
+{{ end }}
+
+<p class="mermaid flex align-center">
+ {{ .Inner }}
+</p>
diff --git a/layouts/shortcodes/tab.html b/layouts/shortcodes/tab.html
index 24520e7..ce78cb8 100644
--- a/layouts/shortcodes/tab.html
+++ b/layouts/shortcodes/tab.html
@@ -8,5 +8,5 @@
{{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }}
{{ else }}
- {{- errorf "%q: tab shortcode must be inside tabs shortcode" .Page.Path -}}
+ {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }}
{{ end}}