docs(templates): fix Lighthouse SEO and accessibility issues
- Defer KaTeX CDN CSS with media="print" onload pattern - Add noscript fallback for non-JS browsers
This commit is contained in:
6
docs/templates/base.html
vendored
6
docs/templates/base.html
vendored
@@ -4,10 +4,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
{% if page.description %}<meta name="description" content="{{ page.description }}" />{% endif %}
|
||||||
<title>{{ title }} | {{ config.title }}</title>
|
<title>{{ title }} | {{ config.title }}</title>
|
||||||
<link rel="canonical" href="{{ base_url }}{{ page_path }}" />
|
<link rel="canonical" href="{{ base_url }}{{ page_path }}" />
|
||||||
<link rel="stylesheet" href="{{ prefix }}/style.css" />
|
<link rel="stylesheet" href="{{ prefix }}/style.css" />
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css" crossorigin="anonymous" />
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css" crossorigin="anonymous" media="print" onload="this.media='all'" />
|
||||||
|
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css" crossorigin="anonymous" /></noscript>
|
||||||
<link rel="icon" type="image/png" href="{{ prefix }}/logo.png" />
|
<link rel="icon" type="image/png" href="{{ prefix }}/logo.png" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -15,7 +17,7 @@
|
|||||||
<aside class="sidebar">
|
<aside class="sidebar">
|
||||||
<header>
|
<header>
|
||||||
<a href="{{ prefix }}/index.html" class="logo">
|
<a href="{{ prefix }}/index.html" class="logo">
|
||||||
<img src="{{ prefix }}/logo.png" alt="sukr" class="logo-img" />
|
<img src="{{ prefix }}/logo.png" alt="" class="logo-img" />
|
||||||
sukr
|
sukr
|
||||||
</a>
|
</a>
|
||||||
<span class="tagline">suckless static sites</span>
|
<span class="tagline">suckless static sites</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user