1
Fork 0

Fix lint errors

This commit is contained in:
prescientmoon 2025-03-04 00:39:15 +01:00
parent 9eb0935369
commit ca5493f5cd
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
10 changed files with 34 additions and 21 deletions

View file

@ -5,7 +5,7 @@ created_at = "2025-03-03T18:42:56+01:00"
{ role=description }
:::
An overview of the inner workings and technical decisions behind this website, including my reasons for choosing [djot](https://djot.net/) over markdown, rendering LaTeX quickly, templating without needless allocations, and more.
An overview of the inner workings and technical decisions behind this website, including my reasons for choosing [djot](https://djot.net/) over markdown, rendering LaTeX, templating without needless allocations, and more.
:::
# The realm's secrets

View file

@ -38,7 +38,6 @@
buildInputs = with pkgs; [ ];
MOONYTHM_DRAFTS = 1;
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
};
};

View file

@ -7,6 +7,16 @@ minify-sitemap:
serve-dev:
http-server dist
# {{{ Building
build:
cargo run
build-dev:
MOONYTHM_DRAFTS=1 cargo run
update-modification-dates:
MOONYTHM_UPDATE_LAST_MODIFIED=1 cargo run
# }}}
# {{{ Linting
lint: lint-vnu lint-css lint-htmltest lint-htmlvalidate

View file

@ -1 +1 @@
pages = [["Posts", "2024-11-07T08:50:05+01:00"], [{ Post = "arcaea-pookies" }, "2025-03-03T22:34:06+01:00"], [{ Post = "the-realm-s-secrets" }, "2025-03-03T22:34:06+01:00"], [{ Post = "arcaea" }, "2025-03-03T22:34:06+01:00"], [{ Post = "yugioh-my-beloved" }, "2024-11-06T08:34:21+01:00"], [{ Post = "games" }, "2025-03-03T22:34:06+01:00"], ["NotFound", "2025-03-03T22:34:06+01:00"], ["Home", "2025-03-03T22:34:06+01:00"]]
pages = [["Posts", "2024-11-07T08:50:05+01:00"], [{ Post = "arcaea-pookies" }, "2025-03-03T22:34:06+01:00"], [{ Post = "the-realm-s-secrets" }, "2025-03-04T00:05:02+01:00"], [{ Post = "arcaea" }, "2025-03-03T22:34:06+01:00"], [{ Post = "yugioh-my-beloved" }, "2024-11-06T08:34:21+01:00"], [{ Post = "games" }, "2025-03-03T22:34:06+01:00"], ["NotFound", "2025-03-03T22:34:06+01:00"], ["Home", "2025-03-03T22:34:06+01:00"]]

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

View file

@ -54,7 +54,12 @@ impl<'a> Pages<'a> {
let metadata =
PageMetadata::new(&mut self.last_modified_cache, content_path, source, events)?;
self.pages.push(metadata);
if std::env::var("MOONYTHM_DRAFTS").unwrap_or_default() == "1"
|| metadata.config.created_at.is_some()
|| !matches!(metadata.route, crate::metadata::PageRoute::Post(_))
{
self.pages.push(metadata);
}
Ok(())
}

View file

@ -287,13 +287,6 @@ impl<'s> Writer<'s> {
continue;
}
// Skip drafts
if std::env::var("MOONYTHM_DRAFTS").unwrap_or_default() != "1"
&& post.config.created_at.is_none()
{
continue;
}
template!("templates/post-summary.html", out)?.feed(
out,
|label, out| {
@ -366,29 +359,30 @@ impl<'s> Writer<'s> {
continue;
}
write!(out, r##"<li><a href="#{}">"##, heading.id)?;
writeln!(out, r##"<li><a href="#{}">"##, heading.id)?;
for event in &heading.events {
self.render_event(event, out)?;
}
// We only close the <a> here, as we might want to include a
// sublist inside the same <li> element.
write!(out, "</a>")?;
writeln!(out, "</a>")?;
let next_level =
self.metadata.toc.get(i + 1).map_or(2, |h| h.level);
match heading.level.cmp(&next_level) {
Ordering::Equal => {
write!(out, "</li>")?;
writeln!(out, "</li>")?;
}
Ordering::Less => {
write!(out, "<ol>")?;
writeln!(out, "<ol>")?;
level_stack.push(next_level);
}
Ordering::Greater => {
writeln!(out, "</li>")?;
while level_stack.last().unwrap() > &next_level {
write!(out, "</ol></li>")?;
writeln!(out, "</ol></li>")?;
level_stack.pop();
}
}
@ -726,6 +720,7 @@ impl<'s> Writer<'s> {
date.format("%a, %d %b %Y")
)?;
} else if matches!(self.states.last(), Some(State::Strikethrough)) {
self.states.pop();
out.write_str("</s>")?;
} else {
out.write_str("</span>")?;

View file

@ -6,9 +6,7 @@
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<title>Moonythm</title>
<meta name="theme-color" content="#faebff" />
<link rel="stylesheet" href="/styles.css" />
<!-- MathML -->
@ -25,6 +23,8 @@
/>
<!-- Meta -->
<title>Moonythm | {{title}}</title>
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<meta property="og:site_name" content="Moonythm" />
<meta property="og:title" content="{{title}}" />
<meta property="twitter:title" content="{{title}}" />

View file

@ -4,7 +4,7 @@
<ul>
<li>
{{posted_on}} by <a href="base_url">prescientmoon</a>
{{posted_on}} by <a href="{{base_url}}">prescientmoon</a>
</li>
<li>
Last updated on {{updated_on}}. <a href="{{source_url}}">Source</a> |

View file

@ -5,5 +5,9 @@
"html-validate:a11y",
"html-validate:document",
"html-validate:prettier"
]
],
"rules": {
"require-sri": "off",
"heading-level": "off"
}
}