Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions templates/default.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%- block head -%}{%- endblock -%}<!DOCTYPE html>
{%- block head -%}
{%- endblock -%}<!DOCTYPE html>
Comment on lines +1 to +2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep <!DOCTYPE html> as the first rendered token.

Line 4 currently emits the doctype after the new DocSearch <link> and verification <meta>, which violates doctype-first and can affect document parsing. Move this block into the actual <head> after the doctype.

Proposed placement
-{%- block head -%}
-  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@4" />
-  <meta name="algolia-site-verification"  content="D96477DE35118476" />
-{%- endblock -%}<!DOCTYPE html>
+<!DOCTYPE html>

Then place the block contents inside the existing <head> element.

🧰 Tools
🪛 HTMLHint (1.9.2)

[error] 1-1: Doctype must be declared before any non-comment content.

(doctype-first)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/default.html` around lines 1 - 4, The DocSearch head block is
rendering before the document doctype, so move the existing head contents from
the top of the template into the actual <head> section after <!DOCTYPE html>.
Keep the unique `block head` content (`@docsearch/css@4` stylesheet link and
`algolia-site-verification` meta) inside the page’s `<head>` so `<!DOCTYPE
html>` remains the first rendered token.

Source: Linters/SAST tools

Comment thread
greptile-apps[bot] marked this conversation as resolved.
<html lang="{{ page.lang | default(value=config.default_language) }}">
{% include "includes/head.html" %}
<script>
Expand Down Expand Up @@ -44,7 +45,6 @@
></div>
<nav role="navigation" aria-label="Main">
<a role="menuitem" href="/download/">Download</a>

<div class="has-submenu">
<a role="menuitem" href="/docs/">Documentation</a>
<div class="submenu">
Expand All @@ -67,7 +67,7 @@
GitHub
<!-- Star count will be injected here by JS -->
</a>

<div id="docsearch"></div>
</nav>
</div>
</div>
Expand Down Expand Up @@ -140,6 +140,14 @@
<!-- End Google Tag Manager (noscript) -->
</div>


<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@4"></script>
<script type="text/javascript">
docsearch({
container: '#docsearch',
appId: 'CU4W5N30P1',
indexName: 'valkey documentation',
apiKey: 'bfe4dd082414b50b74e3cbcc490034d9',
});
</script>
</body>
</html>
5 changes: 4 additions & 1 deletion templates/includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<meta name="Copyright" content="" />
<meta name="keywords" content="open-source, valkey" />
<meta property="og:image" content="/img/valkey-logo-og.png" />
<meta name="algolia-site-verification" content="D96477DE35118476" />
{% if page and page.extra and page.extra.custom_meta%}
{{ page.extra.custom_meta | safe }}
{% endif %}
Expand Down Expand Up @@ -55,6 +56,7 @@
{%- endif -%}">

<link rel="stylesheet" href="/css/styles.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@4" />
<link rel="alternate" type="application/atom+xml" title="Atom feed" href="{{ get_url(path="atom.xml", trailing_slash=false) }}" />

<!-- Nav JS -->
Expand All @@ -74,6 +76,7 @@
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MFFCB7SR');</script>
<!-- End Google Tag Manager -->


{% if page and page.extra and page.extra.head_extra %}{{ page.extra.head_extra }}{% endif %}
</head>
</head>
Loading