|
1 | | -{{- $header := partial "header.html" . | jsonify -}} |
2 | | -{{- $footer := partial "footer.html" . | jsonify -}} |
3 | | -{{- $js := printf `// Ethmarks Web Components |
4 | | -// Generated automatically from Hugo partials |
| 1 | +// Ethmarks Web Components |
5 | 2 |
|
6 | 3 | class EthmarksHeader extends HTMLElement { |
7 | 4 | connectedCallback() { |
8 | | - this.innerHTML = %s; |
| 5 | + this.innerHTML = ` |
| 6 | + <header> |
| 7 | + <a href="https://ethmarks.github.io/" id="title" tabindex="0" aria-label="Home">Ethan Marks</a> |
| 8 | + <nav> |
| 9 | + <a id="nav-home" class="staggered" href="https://ethmarks.github.io/">Home</a> |
| 10 | + <a id="nav-about" class="staggered" href="https://ethmarks.github.io/about/">About</a> |
| 11 | + <a id="nav-posts" class="staggered" href="https://ethmarks.github.io/posts/">Posts</a> |
| 12 | + <a id="nav-blips" class="staggered" href="https://ethmarks.github.io/blips/">Blips</a> |
| 13 | + <a id="nav-projects" class="staggered" href="https://ethmarks.github.io/tags/projects/">Projects</a> |
| 14 | + </nav> |
| 15 | + </header>`; |
9 | 16 |
|
10 | 17 | const activeLink = this.getAttribute('active'); |
11 | 18 | if (activeLink) { |
12 | | - // Remove any existing active classes |
13 | | - const navLinks = this.querySelectorAll('nav a'); |
14 | | - navLinks.forEach(link => link.classList.remove('active')); |
15 | | - |
16 | | - // Add active class to the specified link by ID |
17 | 19 | const targetLink = this.querySelector('#nav-' + activeLink.toLowerCase()); |
18 | 20 | if (targetLink) { |
19 | 21 | targetLink.classList.add('active'); |
|
24 | 26 |
|
25 | 27 | class EthmarksFooter extends HTMLElement { |
26 | 28 | connectedCallback() { |
27 | | - this.innerHTML = %s; |
| 29 | + this.innerHTML = ` |
| 30 | + <footer> |
| 31 | + <span id="source"> |
| 32 | + <a href="https://github.com/ethmarks/ethmarks.github.io" id="sourcelink" target="_blank">Website Source</a> |
| 33 | + </span> |
| 34 | + <span id="copyright"><a href="https://ethmarks.github.io/about/">Ethan Marks</a>, ©2025</span> |
| 35 | + <span id="email"> |
| 36 | + <a href="mailto:ethmarks.dev@gmail.com" target="_blank">Contact</a> |
| 37 | + </span> |
| 38 | + </footer>`; |
28 | 39 |
|
29 | 40 | const sourceLink = this.getAttribute('source'); |
30 | 41 | if (sourceLink) { |
|
64 | 75 | // Register the custom elements |
65 | 76 | customElements.define('ethmarks-header', EthmarksHeader); |
66 | 77 | customElements.define('ethmarks-footer', EthmarksFooter); |
67 | | -` $header $footer -}} |
68 | | -{{- $resource := resources.FromString "js/ethmarks-components.js" $js -}} |
69 | | -{{- $resource.Publish -}} |
|
0 commit comments