Skip to content

Commit

Permalink
Merge branch 'uroybd-lucide-migration'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Eskild Steensen committed Mar 6, 2023
2 parents 82541e6 + 25c5ed9 commit a784fd2
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 20 deletions.
1 change: 1 addition & 0 deletions plugin-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"src/site/_includes/components/searchContainer.njk",
"src/site/_includes/components/searchScript.njk",
"src/site/_includes/components/calloutScript.njk",
"src/site/_includes/components/lucideIcons.njk",
"src/site/lunr-index.js",
"src/site/lunr.njk",
"src/site/_data/versionednotes.js",
Expand Down
6 changes: 0 additions & 6 deletions src/site/_includes/components/calloutScript.njk
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
}
});
lucide.createIcons({
attrs: {
class: ["svg-icon"]
}
});
// Collapse callouts
Array.from(document.querySelectorAll(".callout.is-collapsible")).forEach((elem) => {
elem.querySelector('.callout-title').addEventListener("click", (event) => {
Expand Down
8 changes: 4 additions & 4 deletions src/site/_includes/components/filetree.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<div x-show="isOpen" style="display:none" class="{{'filelist' if step>0}}">
{%if fileOrFolder.isNote %}
<div @click.stop class="notelink {{ 'active-note' if fileOrFolder.permalink === permalink}}">
{%- if not meta.noteIconsSettings.filetree -%}<i class="fa fa-sticky-note" aria-hidden="true"></i>{%- endif -%}
{%- if not meta.noteIconsSettings.filetree -%}<i icon-name="sticky-note" aria-hidden="true"></i>{%- endif -%}
<a data-note-icon="{{fileOrFolder.noteIcon}}" style="text-decoration: none;" class="filename" href="{{fileOrFolder.permalink}}">{{fileOrFolder.name}} </a>
</div>
{% elif fileOrFolder.isFolder%}
<div class="folder inner-folder" x-data="{isOpen: $persist(false).as('{{currentPath}}')}" @click.stop="isOpen=!isOpen">
<div class="foldername-wrapper">
<i x-show="isOpen" style="display: none;" class="fa fa-caret-down"></i>
<i x-show="!isOpen" class="fa fa-caret-right"></i>
<i x-show="isOpen" style="display: none;" icon-name="chevron-down"></i>
<i x-show="!isOpen" icon-name="chevron-right"></i>
<span class="foldername">{{fileOrFolderName}}</span>
</div>
{% for fileOrFolderName, child in fileOrFolder %}
Expand Down Expand Up @@ -53,4 +53,4 @@
{%- endfor -%}
</div>
</nav>
</div>
</div>
2 changes: 1 addition & 1 deletion src/site/_includes/components/filetreeNavbar.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nav class="navbar">
<div class="navbar-inner">
<i style="font-size: 1.5rem; margin-right: 10px;" @click="showFilesMobile=!showFilesMobile" class="fa fa-bars"></i>
<span style="font-size: 1.5rem; margin-right: 10px;" @click="showFilesMobile=!showFilesMobile"><i icon-name="menu"></i></span>
{% for imp in dynamics.filetree.beforeTitle %}
{% include imp %}
{% endfor %}
Expand Down
7 changes: 6 additions & 1 deletion src/site/_includes/components/graphScript.njk
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@
g.id = 'full-graph';
g.classList.add('show');
document.body.appendChild(g);
g.innerHTML = '<i class="fa fa-times" id="full-graph-close" aria-hidden="true"></i><div id="full-graph-container"></div>';
g.innerHTML = '<span id="full-graph-close"><i icon-name="x" aria-hidden="true"></i></span><div id="full-graph-container"></div>';
lucide.createIcons({
attrs: {
class: ["svg-icon"]
}
});
window.fullGraph = renderGraph(graphData, "full-graph-container", 200);
document.getElementById('full-graph-close').addEventListener('click', (evt) => {
g.classList.remove('show');
Expand Down
7 changes: 7 additions & 0 deletions src/site/_includes/components/lucideIcons.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script>
lucide.createIcons({
attrs: {
class: ["svg-icon"]
}
});
</script>
1 change: 0 additions & 1 deletion src/site/_includes/components/pageheader.njk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js" defer></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism-okaidia.min.css" integrity="sha512-mIs9kKbaw6JZFfSuo+MovjU+Ntggfoj8RwAmJbVXQ5mkAX5LlgETQEweFPI18humSPHymTb5iikEOKWF7I8ncQ==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/fetch.umd.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
Expand Down
2 changes: 1 addition & 1 deletion src/site/_includes/components/searchButton.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="search-button" onclick="toggleSearch()">
<span class="search-icon">
<i class="fa fa-search"></i>
<i icon-name="search" ></i>
</span>
<span class="search-text">
<span>Search</span>
Expand Down
4 changes: 2 additions & 2 deletions src/site/_includes/components/searchContainer.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</div>

<div class="navigation-hint">
<i class="fa fa-arrow-up" aria-hidden="true"></i>
<i class="fa fa-arrow-down" aria-hidden="true"></i>
<i icon-name="arrow-up" aria-hidden="true"></i>
<i icon-name="arrow-down" aria-hidden="true"></i>
<span>to navigate</span>
</div>

Expand Down
8 changes: 4 additions & 4 deletions src/site/_includes/components/sidebar.njk
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<span id="depth-display"></span>
</div>
<div class="ctrl-right">
<i class="fa fa-globe" id="global-graph-btn" aria-hidden="true"></i>
<i class="fa fa-arrows-alt" id="graph-fs-btn" aria-hidden="true"></i>
<span id="global-graph-btn"><i icon-name="globe" aria-hidden="true"></i></span>
<span id="graph-fs-btn"><i icon-name="expand" aria-hidden="true"></i></span>
</div>
</div>
</div>
Expand Down Expand Up @@ -62,7 +62,7 @@
{%- for backlink in graph.nodes[graph.homeAlias].backLinks -%}
{%- if graph.nodes[backlink].url != graph.homeAlias -%}
<div class="backlink-card">
<i class="fa fa-link"></i> <a href="{{graph.nodes[backlink].url}}">{{graph.nodes[backlink].title}}</a>
<i icon-name="link"></i> <a href="{{graph.nodes[backlink].url}}">{{graph.nodes[backlink].title}}</a>
</div>
{%- endif -%}
{%- endfor -%}
Expand All @@ -75,7 +75,7 @@
{%- for backlink in graph.nodes[page.url].backLinks -%}
{%- if graph.nodes[backlink].url != page.url -%}
<div class="backlink-card">
<i class="fa fa-link"></i> <a href="{{graph.nodes[backlink].url}}">{{graph.nodes[backlink].title}}</a>
<i icon-name="link"></i> <a href="{{graph.nodes[backlink].url}}">{{graph.nodes[backlink].title}}</a>
</div>
{%- endif -%}
{%- endfor -%}
Expand Down
1 change: 1 addition & 0 deletions src/site/_includes/layouts/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@
{% for imp in dynamics.index.footer %}
{% include imp %}
{% endfor %}
{%include "components/lucideIcons.njk"%}
</body>
</html>
1 change: 1 addition & 0 deletions src/site/_includes/layouts/note.njk
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ permalink: "notes/{{ page.fileSlug | slugify }}/"
{% for imp in dynamics.notes.footer %}
{% include imp %}
{% endfor %}
{%include "components/lucideIcons.njk"%}
</body>
</html>
9 changes: 9 additions & 0 deletions src/site/styles/digital-garden-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,16 @@ ul.task-list {

.notelink {
padding: 5px 0 5px 25px;
display: flex;
align-items: center;
a {
&:hover {
text-decoration: underline !important;
}
}
svg {
flex-shrink: 0;
}
}

.foldername-wrapper {
Expand Down Expand Up @@ -523,6 +528,10 @@ ul.task-list {
&:hover {
border: 1px solid var(--text-accent);
}

.search-icon {
display: flex;
}
}

.search-keys {
Expand Down

0 comments on commit a784fd2

Please sign in to comment.