Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions themes/docsmith/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,21 @@
<body class="no-subnav">
{{ partial "search_modal" . }}
{{ if eq (getenv "HUGO_ENV") "prod" }}
<script>
dataLayer = window.dataLayer || [];
</script>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M3XXZX" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{{ end }}
<header>
{{ partial "nav" . }}
{{ if .IsHome }}
<div class="container">
<div class="container">
{{ partial "subnav" . }}
</div>
{{ else }}
<div class="container sub-menu-wrap">
<div class="container sub-menu-wrap">
{{ partial "subnav" . }}
</div>
{{ end }}
Expand Down
4 changes: 2 additions & 2 deletions themes/docsmith/layouts/index.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $.Scratch.Add "index" slice -}}
{{- range where .Site.Pages "Type" "not in" (slice "page" "json") -}}
{{- $.Scratch.Add "index" (dict "objectID" .UniqueID "title" .Title "ref" .RelPermalink "keywords" .Params.keywords "deprecated" .Params.deprecated "hiddenguide" .Params.hiddenguide "h1" .Params.h1_title "toc" (.TableOfContents | plainify )) -}}
{{- $.Scratch.Add "index" (dict "objectID" .UniqueID "title" .Title "ref" .RelPermalink "modified" .Lastmod.Unix "published" (time .Params.published).Unix "keywords" .Params.keywords "deprecated" .Params.deprecated "hiddenguide" .Params.hiddenguide "h1" .Params.h1_title "toc" (.TableOfContents | plainify )) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}
{{- $.Scratch.Get "index" | jsonify -}}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
<script src="{{ relURL "assets/js/main.js" }}" type="text/javascript"></script>
<script src="{{ relURL "assets/js/search.js" }}" type="text/javascript"></script>-->
<script src="{{ relURL "build/js/libs-900db6b09b.min.js" }}" type="text/javascript"></script>
<script src="{{ relURL "build/js/main-28d15849c0.min.js" }}" type="text/javascript"></script>
<script src="{{ relURL "build/js/main-19d66d306e.min.js" }}" type="text/javascript"></script>
2 changes: 1 addition & 1 deletion themes/docsmith/layouts/partials/includes_head_prod.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<link href="{{ relURL "build/stylesheets/home-6541873c1f.min.css" }}" rel='stylesheet' type='text/css'>
<link href="{{ relURL "build/stylesheets/home-1f7e3136aa.min.css" }}" rel='stylesheet' type='text/css'>
6 changes: 3 additions & 3 deletions themes/docsmith/layouts/shortcodes/disclosure-note.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<blockquote class="disclosure-note">
<blockquote class="hidden-content">
<span>
<!-- arrow-down-circle.svg - Feather icon set | MIT License | https://feathericons.com -->
<img class="disclosure-icon" src="{{ relURL "media/images/arrow-down-circle.svg" }}" />
<img class="toggle-hidden-content-icon" src="{{ relURL "media/images/arrow-down-circle.svg" }}" />
<strong class="callout-title">
{{ default "Disclosure Note" (.Get 0) }}
</strong>
</span>
<div class="disclosure-note-content"><div class="height-preservation-wrapper">{{ .Inner | markdownify }}</div></div>
<div class="hidden-content-body"><div class="height-preservation-wrapper">{{ .Inner | markdownify }}</div></div>
</blockquote>
18 changes: 18 additions & 0 deletions themes/docsmith/layouts/shortcodes/quick-start-note.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<blockquote class="hidden-content quick-start">
<span onclick="dataLayer.push({'event': 'quick-start-toggle'});">
<!-- arrow-down-circle.svg - Feather icon set | MIT License | https://feathericons.com -->
<img class="toggle-hidden-content-icon" src="{{ relURL "media/images/arrow-down-circle.svg" }}" />
<h2 class="quick-start-h2" id="{{ anchorize ($.Page.Title) }}">{{ $.Page.Title }} - Quick Start</h2>
</span>
<div class="hidden-content-body">
<div class="height-preservation-wrapper">
<p>Follow the steps in this section to jump right in. If you want a deeper dive, continue on to the rest of the guide.
</p>
{{ .Inner | markdownify }}
<hr>
<p class="feedback--prompt">Was this Quick Start helpful?</p>
<button class="btn feedback yes" onclick="dataLayer.push({'event': 'quickstart-helpful-yes'});">Yes</button>
<button class="btn feedback no" onclick="dataLayer.push({'event': 'quickstart-helpful-no'});">No</button>
</div>
</div>
</blockquote>
1 change: 1 addition & 0 deletions themes/docsmith/static/build/js/main-19d66d306e.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion themes/docsmith/static/build/js/main-28d15849c0.min.js

This file was deleted.

86 changes: 45 additions & 41 deletions themes/docsmith/static/build/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,49 +90,53 @@ if (query) {

})(jQuery);

$(function() {
$('.disclosure-note').each(function() {
$(this).css("cursor", "pointer")
.click(function() { toggleNoteDisclosure($(this)) });
$(this).children('div').first()
.css("height", '2.8em')
.css("opacity", .5);
});
//shortcodes disclosure-note and quick-start-note rely on this JS
$(function () {
$('.hidden-content').each(function () {
$(this).css("cursor", "pointer")
.click(function () { toggleHiddenContent($(this)) });
$(this).children('div').first()
.css("height", '2.8em')
.css("opacity", .5);
});
$('.btn').click(function () {
$('.btn.feedback').attr("disabled", "true");
});
});

function toggleNoteDisclosure(disclosureNote) {
disclosureNoteTitle = disclosureNote.children('span').first();
arrowIcon = disclosureNoteTitle.children('img.disclosure-icon').first();
disclosableDiv = disclosureNoteTitle.next('div')
if (disclosureNote.hasClass('disclosed')) {
disclosableDiv.animate(
{
height: '2.8em',
opacity: .5
},
200,
function() {
disclosureNoteTitle.css("cursor", "pointer")
.unbind('click');
disclosureNote.css("cursor", "pointer")
.unbind('click').click(function() { toggleNoteDisclosure($(this)); });
});
}
else {
disclosableDiv.animate(
{
height: disclosableDiv.children('.height-preservation-wrapper').first().height(),
opacity: 1
},
200,
function() {
disclosureNote.css("cursor", "default")
.unbind('click');
disclosureNoteTitle.css("cursor", "pointer")
.unbind('click').click(function() { toggleNoteDisclosure($(this).parent()); });
});
}
disclosureNote.toggleClass('disclosed');
function toggleHiddenContent(hiddenContent) {
hiddenContentTitle = hiddenContent.children('span').first();
arrowIcon = hiddenContentTitle.children('img.toggle-hidden-content-icon').first();
hideableDiv = hiddenContentTitle.next('div')
if (hiddenContent.hasClass('unhidden')) {
hideableDiv.animate(
{
height: '2.8em',
opacity: .5
},
200,
function () {
hiddenContentTitle.css("cursor", "pointer")
.unbind('click');
hiddenContent.css("cursor", "pointer")
.unbind('click').click(function () { toggleHiddenContent($(this)); });
});
}
else {
hideableDiv.animate(
{
height: hideableDiv.children('.height-preservation-wrapper').first().height(),
opacity: 1
},
200,
function () {
hiddenContent.css("cursor", "default")
.unbind('click');
hiddenContentTitle.css("cursor", "pointer")
.unbind('click').click(function () { toggleHiddenContent($(this).parent()); });
});
}
hiddenContent.toggleClass('unhidden');
}
(function($) {

Expand Down
Loading