8779e72c77
Adding the integrity attribute protects the website (by refusing to load the script) against malicious modifications of the script in the case of jsdelivr gets hacked
26 lines
906 B
HTML
26 lines
906 B
HTML
<script src="https://cdn.jsdelivr.net/npm/d3@6.7.0/dist/d3.min.js" integrity="sha256-+7jaYCp29O1JusNWHaYtgUn6EhuP0VaFuswhNV06MyI=" crossorigin="anonymous"></script>
|
|
<h3>Interactive Graph</h3>
|
|
<div id="graph-container"></div>
|
|
<style>
|
|
:root {
|
|
--g-node: var(--secondary);
|
|
--g-node-active: var(--primary);
|
|
--g-node-inactive: var(--visited);
|
|
--g-link: var(--outlinegray);
|
|
--g-link-active: #5a7282;
|
|
}
|
|
</style>
|
|
{{ $js := resources.Get "js/graph.js" | resources.Fingerprint "md5" }}
|
|
<script src="{{ $js.Permalink }}"></script>
|
|
<script>
|
|
drawGraph(
|
|
{{strings.TrimRight "/" .Page.Permalink}},
|
|
{{strings.TrimRight "/" .Site.BaseURL}},
|
|
{{$.Site.Data.graphConfig.paths}},
|
|
{{$.Site.Data.graphConfig.depth}},
|
|
{{$.Site.Data.graphConfig.enableDrag}},
|
|
{{$.Site.Data.graphConfig.enableLegend}},
|
|
{{$.Site.Data.graphConfig.enableZoom}}
|
|
)
|
|
</script>
|