mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
fix config coherence
This commit is contained in:
parent
c7751e4a4e
commit
d0104d7ad1
@ -1,7 +1,15 @@
|
||||
# if true, a Global Graph will be shown on home page with full width, no backlink.
|
||||
# A different set of Local Graphs will be shown on sub pages.
|
||||
# if false, Local Graph will be default on every page as usual
|
||||
enableGlobalGraph: false
|
||||
|
||||
# If enableColumnLayout: true in config.yaml, then you have
|
||||
# the possiblity of showing a global graph by clicking on an
|
||||
# icon at the top right corner of the graph window. To do so,
|
||||
# configure below enableGlobalGraph: true
|
||||
|
||||
# If enableColumnLayout: false, then you have the possiblility
|
||||
# to show a Global Graph on home page with full width, no backlink
|
||||
# by setting below enableGlobalGraph: true. A different set of
|
||||
# Local Graphs will be shown on sub pages.
|
||||
|
||||
enableGlobalGraph: true
|
||||
|
||||
### Local Graph ###
|
||||
|
||||
|
||||
@ -55,7 +55,6 @@
|
||||
<aside data-sm1-2 data-md1-2 data-lg1-4 data-lg3 data-m3 data-sm3 data-xs2>
|
||||
<div class="sticky">
|
||||
<div class="page-end vertical">
|
||||
<button id="myBtn">Open Modal</button>
|
||||
<div id="myModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="close">×</span>
|
||||
|
||||
@ -1,17 +1,15 @@
|
||||
<script
|
||||
src="https://cdn.jsdelivr.net/npm/d3@6.7.0/dist/d3.min.js"
|
||||
integrity="sha256-+7jaYCp29O1JusNWHaYtgUn6EhuP0VaFuswhNV06MyI="
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
<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 class="graph-grid">
|
||||
<div>
|
||||
<button id="global-graph-toggle-button">
|
||||
<span id="global-graph-svg" class="icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div id="graph-container">
|
||||
</div>
|
||||
<div>
|
||||
<button id="global-graph-toggle-button">
|
||||
{{if and ($.Site.Data.config.enableColumnLayout) ($.Site.Data.graphConfig.enableGlobalGraph)}}
|
||||
<span id="global-graph-svg" class="icon"></span>
|
||||
{{end}}
|
||||
</button>
|
||||
</div>
|
||||
<div id="graph-container">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
||||
@ -100,12 +100,12 @@
|
||||
|
||||
{{if $.Site.Data.config.enableFooter}}
|
||||
const container = document.getElementById("graph-container")
|
||||
// retry if the graph is not ready
|
||||
// // retry if the graph is not ready
|
||||
if (!container) return requestAnimationFrame(render)
|
||||
// clear the graph in case there is anything within it
|
||||
// // clear the graph in case there is anything within it
|
||||
container.textContent = ""
|
||||
|
||||
const drawGlobal = isHome && {{$.Site.Data.graphConfig.enableGlobalGraph}};
|
||||
const drawGlobal = isHome && {{$.Site.Data.graphConfig.enableGlobalGraph}} && !{{$.Site.Data.config.enableColumnLayout}};
|
||||
drawGraph(
|
||||
{{strings.TrimRight "/" .Site.BaseURL}},
|
||||
drawGlobal,
|
||||
@ -114,8 +114,8 @@
|
||||
);
|
||||
|
||||
{{end}}
|
||||
|
||||
{{if $.Site.Data.config.enableColumnLayout}}
|
||||
|
||||
{{if and ($.Site.Data.config.enableColumnLayout) ($.Site.Data.graphConfig.enableGlobalGraph)}}
|
||||
const containerModal = document.getElementById("graph-container-modal")
|
||||
// retry if the graph is not ready
|
||||
if (!containerModal) return requestAnimationFrame(render)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user