Skip to content

Commit

Permalink
Merge pull request #88 from tstoeter/patch-3
Browse files Browse the repository at this point in the history
Fix missing quote marks for src and alt when template code is used
  • Loading branch information
not-matthias authored Jan 10, 2025
2 parents 6d5dbe7 + 1e5ed86 commit 528c46b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions templates/cards.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<ul class="pagination">
{% if paginator.previous %}
<span class="page-item page-prev">
<a href={{ paginator.previous }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
<a href="{{ paginator.previous }}" class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
</span>
{% endif %}

{% if paginator.next %}
<span class="page-item page-next">
<a href={{ paginator.next }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
<a href="{{ paginator.next }}" class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
</span>
{% endif %}
</ul>
Expand Down
14 changes: 7 additions & 7 deletions templates/macros/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<div>
<h1 class="title">
<a href={{ page.permalink | safe }}>{{page.title}}</a>
<a href="{{ page.permalink | safe }}">{{page.title}}</a>

{% if page.draft %}
<span class="draft-label">DRAFT</span>
Expand All @@ -43,7 +43,7 @@ <h1 class="title">
</div>

{% if not hide_read_more %}
<a class="readmore" href={{ page.permalink | safe }}>Read more ⟶</a>
<a class="readmore" href="{{ page.permalink | safe }}">Read more ⟶</a>
{% endif %}
</div>
</div>
Expand All @@ -59,7 +59,7 @@ <h1 class="title">
{%- for term in terms %}
<section class="list-item">
<h1 class="title">
<a href={{ term.permalink }}>{{term.name}}</a>
<a href="{{ term.permalink }}">{{term.name}}</a>
</h1>
</section>

Expand Down Expand Up @@ -210,19 +210,19 @@ <h1 class="toc-title">Table of Contents</h1>
{%- for page in pages %}
<div class="card">
{% if page.extra.local_image %}
<img class="card-image" alt={{ page.extra.local_image }} src="{{ get_url(path=page.extra.local_image) }}" />
<img class="card-image" alt="{{ page.extra.local_image }}" src="{{ get_url(path=page.extra.local_image) }}" />
{% elif page.extra.remote_image %}
<img class="card-image" alt={{ page.extra.remote_image }} src="{{ page.extra.remote_image }}" />
<img class="card-image" alt="{{ page.extra.remote_image }}" src="{{ page.extra.remote_image }}" />
{% else %}
<div class="card-image-placeholder"></div>
{% endif %}

<div class="card-info">
<h1 class="card-title">
{% if page.extra.link_to %}
<a href={{ page.extra.link_to }}>{{page.title}}</a>
<a href="{{ page.extra.link_to }}">{{page.title}}</a>
{% else %}
<a href={{ page.permalink | safe }}>{{page.title}}</a>
<a href="{{ page.permalink | safe }}">{{page.title}}</a>
{% endif %}
</h1>

Expand Down
22 changes: 11 additions & 11 deletions templates/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@

{# Favicon #}
{% if config.extra.favicon %}
<link rel="icon" type="image/png" href={{ config.extra.favicon }} />
<link rel="icon" type="image/png" href="{{ config.extra.favicon }}" />
{% endif %}

{# Font from cdn or disk #}
{% if config.extra.use_cdn | default(value=false) %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/jetbrains-mono.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/[email protected]/index.min.css">
{% else %}
<link href={{ get_url(path="fonts.css") }} rel="stylesheet" />
<link href="{{ get_url(path="fonts.css") }}" rel="stylesheet" />
{% endif %}

{# Analytics #}
Expand All @@ -100,17 +100,17 @@

{# Fancy Codeblock #}
{% if config.extra.fancy_code %}
<script src={{ get_url(path="js/codeblock.js") }}></script>
<script src="{{ get_url(path="js/codeblock.js") }}"></script>
{% endif %}

{# Table of contents #}
{% if config.extra.toc | default(value=false) %}
<script src={{ get_url(path="js/toc.js") }}></script>
<script src="{{ get_url(path="js/toc.js") }}"></script>
{% endif %}

{# Dynamic Note #}
{% if config.extra.dynamic_note | default(value=false) %}
<script src={{ get_url(path="js/note.js") }}></script>
<script src="{{ get_url(path="js/note.js") }}"></script>
{% endif %}

{% if config.extra.mathjax | default(value=false) %}
Expand All @@ -136,17 +136,17 @@
{% if theme == "dark" %}
<link rel="stylesheet" type="text/css" href="{{ get_url(path='theme/dark.css') }}" />
{% elif theme == "light" %}
<link rel="stylesheet" type="text/css" href={{ get_url(path="theme/light.css") }} />
<link rel="stylesheet" type="text/css" href="{{ get_url(path="theme/light.css") }}" />
{% elif theme == "auto" %}
<link rel="stylesheet" type="text/css" href={{ get_url(path="theme/light.css") }} />
<link rel="stylesheet" type="text/css" href="{{ get_url(path="theme/light.css") }}" />
<link rel="stylesheet" type="text/css" href="{{ get_url(path='theme/dark.css') }}" media="(prefers-color-scheme: dark)" />
{% elif theme == "toggle" %}
<link rel="stylesheet" type="text/css" href={{ get_url(path="theme/light.css") }} />
<link rel="stylesheet" type="text/css" href="{{ get_url(path="theme/light.css") }}" />
<link id="darkModeStyle" rel="stylesheet" type="text/css" href="{{ get_url(path='theme/dark.css') }}" />
{% endif %}

<!-- Set the correct theme in the script -->
<script src={{ get_url(path="js/themetoggle.js") }}></script>
<script src="{{ get_url(path="js/themetoggle.js") }}"></script>
{% if theme == "dark" %}
<script>setTheme("dark");</script>
{% elif theme == "light" %}
Expand All @@ -163,12 +163,12 @@
<script>setTheme(getSavedTheme());</script>
{% endif %}

<link rel="stylesheet" type="text/css" media="screen" href={{ get_url(path="main.css") }} />
<link rel="stylesheet" type="text/css" media="screen" href="{{ get_url(path="main.css") }}" />

{% if config.extra.stylesheets %}
{% for stylesheet in config.extra.stylesheets %}
<link rel="stylesheet" href="{{ get_url(path=stylesheet) }}">
{% endfor %}
{% endif %}
<script src={{ get_url(path="js/mermaid.js") }}></script>
<script src="{{ get_url(path="js/mermaid.js") }}"></script>
</head>
14 changes: 7 additions & 7 deletions templates/partials/nav.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<header>
<div class="main">
{% if config.extra.logo %}
<a href={{ config.base_url }} class="logo">
<img alt={{ config.title }} src={{ get_url(path=config.extra.logo) }}>
<a href="{{ config.base_url }}" class="logo">
<img alt="{{ config.title }}" src="{{ get_url(path=config.extra.logo) }}">
</a>
{% else %}
<a href={{ config.base_url }}>{{ config.title }}</a>
<a href="{{ config.base_url }}">{{ config.title }}</a>
{% endif %}

<div class="socials">
{% for social in config.extra.socials | default(value=[]) %}
<a rel="me" href="{{ social.url }}" class="social">
<img alt={{ social.name }} src={{ get_url(path="social_icons/" ~ social.icon ~ ".svg") }}>
<img alt="{{ social.name }}" src="{{ get_url(path="social_icons/" ~ social.icon ~ ".svg") }}">
</a>
{% endfor %}
</div>
</div>

<nav>
{% for menu in config.extra.menu | default(value=[]) %}
<a href={{ get_url(path=menu.url) }} style="margin-left: 0.5em">{{ menu.name }}</a>
<a href="{{ get_url(path=menu.url) }}" style="margin-left: 0.5em">{{ menu.name }}</a>
{% endfor %}

{% if config.extra.theme | default(value="toggle") == "toggle" %}
|<a id="dark-mode-toggle" onclick="toggleTheme(); event.preventDefault();" href="#">
<img src={{ get_url(path="feather/sun.svg") }} id="sun-icon" style="filter: invert(1);" alt="Light" />
<img src={{ get_url(path="feather/moon.svg") }} id="moon-icon" alt="Dark" />
<img src="{{ get_url(path="feather/sun.svg") }}" id="sun-icon" style="filter: invert(1);" alt="Light" />
<img src="{{ get_url(path="feather/moon.svg") }}" id="moon-icon" alt="Dark" />
</a>

<!-- Inititialize the theme toggle icons -->
Expand Down
4 changes: 2 additions & 2 deletions templates/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<ul class="pagination">
{% if paginator.previous %}
<span class="page-item page-prev">
<a href={{ paginator.previous }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
<a href="{{ paginator.previous }}" class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
</span>
{% endif %}

{% if paginator.next %}
<span class="page-item page-next">
<a href={{ paginator.next }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
<a href="{{ paginator.next }}" class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
</span>
{% endif %}
</ul>
Expand Down

0 comments on commit 528c46b

Please sign in to comment.