Theme Audit Checklist#
Use this checklist to audit a themes/<name>/ directory before declaring a
theme ready. Each item is a hard pass / fail.
Environment#
-
THEME_DIRis set in.envor the environment the Lesstruct process runs in (not only in a shell session that has since closed). -
THEME_DIRresolves to an existing directory. - Lesstruct was restarted after the most recent
THEME_DIRchange. - The theme directory has a
static/and atemplates/subdirectory (even if empty).
CSS (static/style.css)#
-
static/style.cssis valid CSS (run it through a linter). -
static/style.cssdoes not referencestyle.src.css(the source file is not served; only the minifiedstyle.cssis). - Every CSS variable the default theme defines is still defined in the override (or in a parent file the override loads). The full set is in the CSS Variable Reference.
-
@importURLs (fonts, third-party CSS) resolve.
Layout template (templates/layout.html)#
- File defines
{{define "layout"}}…{{end}}exactly once. - The HTML element has
lang="{{.Lang}}". -
<title>{{.PageTitle}}</title>is present. -
<link rel="stylesheet" href="/static/style.css">is present. -
<main>…{{template "body" .}}…</main>is present. - The Open Graph
<meta>tags are present (otherwise share previews break). -
<script src="/static/nav-auth.js"></script>and<script src="/static/search.js"></script>are present (otherwise the nav login/logout toggle and search dropdown break).
Page templates (any templates/<page>.html you ship)#
- The template defines
{{define "body"}}…{{end}}exactly once. - The template uses the data fields listed in
Template Data Fields by
their documented names (
.Title,.PageTitle, etc.).
JavaScript DOM contract#
If you override static/comments.js:
- The content template still has
<form id="comment-form" data-slug="…">. - The form has a
<textarea name="comment">. -
#comment-errorand#comment-successelements exist. -
#comment-login-linkexists (shown to logged-out users).
If you override static/auth.js:
- The login template has
<form id="login-form">with inputs namedusernameandpassword. - The register template has
<form id="register-form">with inputs namedusername,name,email, andpassword. - The forgot-password template has
<form id="forgot-form">with an input namedemail. - Each of the three templates has
#auth-errorand (for register and forgot)#auth-successelements.
If you override static/verify-email.js:
-
verify_email.htmlhas#auth-errorand#auth-successelements.
If you override static/reset-password.js:
-
reset_password.htmlhas<form id="reset-form">with<input id="new-password">. -
reset_password.htmlhas#auth-errorand#auth-successelements.
If you override static/nav-auth.js:
-
layout.htmlstill has<a id="nav-login">and<a id="nav-logout">. - If you keep the mobile nav toggle,
layout.htmlstill has<button class="nav-toggle">and<nav class="site-nav">.
If you override static/search.js:
-
layout.htmlstill has<button class="search-toggle">,<input id="search-input">, and<div id="search-dropdown">.
CDN assets#
- If your theme uses katex,
layout.htmlloadshttps://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.cssandkatex.min.js. - If your theme uses highlight.js,
layout.htmlloads the matching CSS and<script src="/static/highlight.min.js"></script>. - If your theme does not use katex or highlight.js, the matching
<link>and<script>tags have been removed fromlayout.html.
Smoke test#
- Run the page-by-page smoke test from
page-render-smoke-test.mdand confirm all 10 pages render correctly.
Documentation#
-
themes/<name>/CHANGELOG.mdrecords the Lesstruct version the theme was authored against. - The CHANGELOG lists every file the theme overrides.