Skip to content

Commit 97dcbc1

Browse files
JustKuzyaaj-stein-nist
authored andcommitted
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).
1 parent ff951bd commit 97dcbc1

File tree

2 files changed

+62
-13
lines changed

2 files changed

+62
-13
lines changed

docs/assets/scss/schema-docs.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,34 @@
330330
@include u-text('bold');
331331
}
332332
}
333+
}
334+
335+
336+
.reference-element-anchor {
337+
// : :after
338+
font-style: normal;
339+
font-variant: normal;
340+
font-kerning: auto;
341+
font-optical-sizing: auto;
342+
font-feature-settings: normal;
343+
font-variation-settings: normal;
344+
font-weight: normal;
345+
font-stretch: normal;
346+
font-size: 1em;
347+
line-height: inherit;
348+
font-family: anchorjs-icons;
349+
position: absolute;
350+
margin-left: -1em;
351+
padding-right: 0.5em;
352+
}
353+
354+
.reference-element-anchor:hover {
355+
text-decoration: underline;
356+
transform: scale(1.06);
357+
border-image: "";
358+
}
359+
360+
.reference-element-anchor :hover::before {
361+
font-family: anchorjs-icons;
362+
background-image: "";
333363
}

docs/layouts/partials/foot.html

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
11
{{ if not .Site.IsServer }}
22
<script type="text/javascript" src="https://pages.nist.gov/leaveNotice/js/jquery.leaveNotice-nist.min.js"></script>
33
<script>
4-
$(document).ready(function () {
5-
$('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');
6-
$('a.usa-link--external').leaveNotice();
7-
});
4+
$(document).ready(function () {
5+
$('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');
6+
$('a.usa-link--external').leaveNotice();
7+
});
88
</script>
99
{{ end }}
1010

11-
{{ $generateAnchors := true }}
12-
{{- if isset .Page.Params "generateanchors" -}}
13-
{{ $generateAnchors = .Page.Params.generateanchors }}
14-
{{- end -}}
15-
{{ if $generateAnchors -}}
16-
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.3.0/anchor.min.js" integrity="sha512-G2OGlm41XXw+fcgDcRPjVYEn7qCY6qiKWNqDGT37SnKh0qtRXTuKZ5/UQR0kDN0PZRNWcGExd3lAeqEH0I36bQ==" crossorigin="anonymous"></script>
11+
{{ $generateAnchors:= true }}
12+
13+
{{ if ne .Page.Params.generateanchors nil }}
14+
{{ $generateAnchors = .Page.Params.generateanchors }}
15+
{{ end }}
16+
17+
{{ if $generateAnchors }}
18+
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.3.0/anchor.min.js"
19+
integrity="sha512-G2OGlm41XXw+fcgDcRPjVYEn7qCY6qiKWNqDGT37SnKh0qtRXTuKZ5/UQR0kDN0PZRNWcGExd3lAeqEH0I36bQ=="
20+
crossorigin="anonymous">
21+
</script>
1722
<script>
23+
24+
/*
1825
anchors.options = {
19-
placement: 'left'
26+
placement: 'left'
2027
};
21-
anchors.add();
28+
anchors.add();
29+
*/
30+
31+
document.addEventListener('DOMContentLoaded', function (event) {
32+
33+
anchors.options = {
34+
placement: 'left',
35+
icon: "⚓",
36+
};
37+
// anchors.add();
38+
anchors.add('.name:not(.reference-element-anchor)');
39+
// $("a").not(".anchor-xslt").add();
40+
});
2241
</script>
23-
{{- end }}
42+
{{ end }}

0 commit comments

Comments
 (0)