mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -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 enableColumnLayout: true in config.yaml, then you have
|
||||||
# if false, Local Graph will be default on every page as usual
|
# the possiblity of showing a global graph by clicking on an
|
||||||
enableGlobalGraph: false
|
# 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 ###
|
### Local Graph ###
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,6 @@
|
|||||||
<aside data-sm1-2 data-md1-2 data-lg1-4 data-lg3 data-m3 data-sm3 data-xs2>
|
<aside data-sm1-2 data-md1-2 data-lg1-4 data-lg3 data-m3 data-sm3 data-xs2>
|
||||||
<div class="sticky">
|
<div class="sticky">
|
||||||
<div class="page-end vertical">
|
<div class="page-end vertical">
|
||||||
<button id="myBtn">Open Modal</button>
|
|
||||||
<div id="myModal" class="modal">
|
<div id="myModal" class="modal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<span class="close">×</span>
|
<span class="close">×</span>
|
||||||
|
|||||||
@ -1,17 +1,15 @@
|
|||||||
<script
|
<script src="https://cdn.jsdelivr.net/npm/d3@6.7.0/dist/d3.min.js" integrity="sha256-+7jaYCp29O1JusNWHaYtgUn6EhuP0VaFuswhNV06MyI=" crossorigin="anonymous"></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>
|
<h3>Interactive Graph</h3>
|
||||||
<div class="graph-grid">
|
<div class="graph-grid">
|
||||||
<div>
|
<div>
|
||||||
<button id="global-graph-toggle-button">
|
<button id="global-graph-toggle-button">
|
||||||
<span id="global-graph-svg" class="icon"></span>
|
{{if and ($.Site.Data.config.enableColumnLayout) ($.Site.Data.graphConfig.enableGlobalGraph)}}
|
||||||
</button>
|
<span id="global-graph-svg" class="icon"></span>
|
||||||
</div>
|
{{end}}
|
||||||
<div id="graph-container">
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="graph-container">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@ -100,12 +100,12 @@
|
|||||||
|
|
||||||
{{if $.Site.Data.config.enableFooter}}
|
{{if $.Site.Data.config.enableFooter}}
|
||||||
const container = document.getElementById("graph-container")
|
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)
|
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 = ""
|
container.textContent = ""
|
||||||
|
|
||||||
const drawGlobal = isHome && {{$.Site.Data.graphConfig.enableGlobalGraph}};
|
const drawGlobal = isHome && {{$.Site.Data.graphConfig.enableGlobalGraph}} && !{{$.Site.Data.config.enableColumnLayout}};
|
||||||
drawGraph(
|
drawGraph(
|
||||||
{{strings.TrimRight "/" .Site.BaseURL}},
|
{{strings.TrimRight "/" .Site.BaseURL}},
|
||||||
drawGlobal,
|
drawGlobal,
|
||||||
@ -114,8 +114,8 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{if $.Site.Data.config.enableColumnLayout}}
|
{{if and ($.Site.Data.config.enableColumnLayout) ($.Site.Data.graphConfig.enableGlobalGraph)}}
|
||||||
const containerModal = document.getElementById("graph-container-modal")
|
const containerModal = document.getElementById("graph-container-modal")
|
||||||
// retry if the graph is not ready
|
// retry if the graph is not ready
|
||||||
if (!containerModal) return requestAnimationFrame(render)
|
if (!containerModal) return requestAnimationFrame(render)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user