-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Style for Generating Reference Model Anchors at Build Time (#1789
) * isset Did not seem to work - changed it to ne (!= or <>) * Second part of the Anchor-JS unhooking and static Anchor Generated * hooled up the renamed class name .reference-element-anchor * Adding metaschema submodule changes (fixed with merge conflict).
- Loading branch information
1 parent
ff951bd
commit 97dcbc1
Showing
2 changed files
with
62 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,42 @@ | ||
{{ if not .Site.IsServer }} | ||
<script type="text/javascript" src="https://pages.nist.gov/leaveNotice/js/jquery.leaveNotice-nist.min.js"></script> | ||
<script> | ||
$(document).ready(function () { | ||
$('a[href*="//"]{{ if .Site.IsServer }}:not([href*="http://localhost:1313/"]){{ end }}:not([href*="pages.nist.gov"]):not([href*="www.nist.gov"]):not([href^="#"]):not([href^="/"])').addClass('usa-link usa-link--external'); | ||
$('a.usa-link--external').leaveNotice(); | ||
}); | ||
$(document).ready(function () { | ||
$('a[href*="//"]{{ if .Site.IsServer }}:not([href*="http://localhost:1313/"]){{ end }}:not([href*="pages.nist.gov"]):not([href*="www.nist.gov"]):not([href^="#"]):not([href^="/"])').addClass('usa-link usa-link--external'); | ||
$('a.usa-link--external').leaveNotice(); | ||
}); | ||
</script> | ||
{{ end }} | ||
|
||
{{ $generateAnchors := true }} | ||
{{- if isset .Page.Params "generateanchors" -}} | ||
{{ $generateAnchors = .Page.Params.generateanchors }} | ||
{{- end -}} | ||
{{ if $generateAnchors -}} | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.3.0/anchor.min.js" integrity="sha512-G2OGlm41XXw+fcgDcRPjVYEn7qCY6qiKWNqDGT37SnKh0qtRXTuKZ5/UQR0kDN0PZRNWcGExd3lAeqEH0I36bQ==" crossorigin="anonymous"></script> | ||
{{ $generateAnchors:= true }} | ||
|
||
{{ if ne .Page.Params.generateanchors nil }} | ||
{{ $generateAnchors = .Page.Params.generateanchors }} | ||
{{ end }} | ||
|
||
{{ if $generateAnchors }} | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.3.0/anchor.min.js" | ||
integrity="sha512-G2OGlm41XXw+fcgDcRPjVYEn7qCY6qiKWNqDGT37SnKh0qtRXTuKZ5/UQR0kDN0PZRNWcGExd3lAeqEH0I36bQ==" | ||
crossorigin="anonymous"> | ||
</script> | ||
<script> | ||
|
||
/* | ||
anchors.options = { | ||
placement: 'left' | ||
placement: 'left' | ||
}; | ||
anchors.add(); | ||
anchors.add(); | ||
*/ | ||
|
||
document.addEventListener('DOMContentLoaded', function (event) { | ||
|
||
anchors.options = { | ||
placement: 'left', | ||
icon: "⚓", | ||
}; | ||
// anchors.add(); | ||
anchors.add('.name:not(.reference-element-anchor)'); | ||
// $("a").not(".anchor-xslt").add(); | ||
}); | ||
</script> | ||
{{- end }} | ||
{{ end }} |