icons as a submodule

main
Ricard Illa 2022-08-25 16:09:27 +02:00
parent bde0a5ef71
commit 2d847aa1f9
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
12 changed files with 15 additions and 9 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "icons/feather"]
path = icons/feather
url = https://github.com/feathericons/feather/

View File

@ -2,7 +2,7 @@ BASE_URL_WWW ?= https://monotremata.xyz
BASE_URL_ONION ?= http://zswm576cm7wgmgcwluy4l4ixkfasj25taqbn2r5pnrrj552l263ff2qd.onion
SASS_FILES=$(shell find sass -name \*.scss)
ICON_FILES=$(shell find icons -name \*.svg)
FEATHER_ICONS=$(shell find icons/feather/icons -name \*.svg)
PAGES=$(shell find pages -maxdepth 1 -mindepth 1 -type d -printf "%f\n")
ASSETS=$(shell find assets -mindepth 1)
@ -45,7 +45,7 @@ define tidy_html
tidy --show-info no -output $@ $<
endef
page_deps = pages/%/*.j2 config.yaml header.j2 footer.j2 style.css $(ICON_FILES)
page_deps = pages/%/*.j2 config.yaml header.j2 footer.j2 style.css $(FEATHER_ICONS)
untidy_www_%.html: $(page_deps)
$(call build_html,$(BASE_URL_WWW))

View File

@ -18,6 +18,12 @@ My site is simple enough that using a proper static site generator would have
been overkill, but I still wanted something easier to maintain than directly
writing HTML by hand. So a templating system like Jinja2 is a nice compromise.
## Icons
I'm using the [feather icons](https://feathericons.com/) for the website
navigation bar. The repo with the icons is cloned as sub-module and the needed
SVGs are embedded into the HTML when the website is built.
## Build dependencies
There's a zero chance than anyone other than me would want to build this, and

View File

@ -18,3 +18,5 @@ nav:
- name: buy me a coffee
icon: coffee
endpoint: donate
icon_path: icons/feather/icons

View File

@ -16,7 +16,7 @@
class="nav-link"
href="{% if x.url is defined %}{{ x.url }}{% else %}{{ "BASE_URL" | env }}/{{ x.endpoint }}{% endif %}"
>
{% include "icons/" + x.icon + ".svg" %}{{ x.name }}
{% include icon_path + "/" + x.icon + ".svg" %}{{ x.name }}
</a>
{% endfor %}
</nav>

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-code"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>

Before

Width:  |  Height:  |  Size: 307 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-coffee"><path d="M18 8h1a4 4 0 0 1 0 8h-1"></path><path d="M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z"></path><line x1="6" y1="1" x2="6" y2="4"></line><line x1="10" y1="1" x2="10" y2="4"></line><line x1="14" y1="1" x2="14" y2="4"></line></svg>

Before

Width:  |  Height:  |  Size: 447 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-dollar-sign"><line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg>

Before

Width:  |  Height:  |  Size: 334 B

1
icons/feather Submodule

@ -0,0 +1 @@
Subproject commit f81cd40fdcdd5e94f3f97eb670a5058e3aac528d

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>

Before

Width:  |  Height:  |  Size: 473 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-info"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>

Before

Width:  |  Height:  |  Size: 347 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-mail"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>

Before

Width:  |  Height:  |  Size: 354 B