Fix lint errors
This commit is contained in:
parent
9eb0935369
commit
ca5493f5cd
|
@ -5,7 +5,7 @@ created_at = "2025-03-03T18:42:56+01:00"
|
||||||
|
|
||||||
{ role=description }
|
{ 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
|
# The realm's secrets
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
|
|
||||||
buildInputs = with pkgs; [ ];
|
buildInputs = with pkgs; [ ];
|
||||||
|
|
||||||
MOONYTHM_DRAFTS = 1;
|
|
||||||
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
|
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
10
justfile
10
justfile
|
@ -7,6 +7,16 @@ minify-sitemap:
|
||||||
serve-dev:
|
serve-dev:
|
||||||
http-server dist
|
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
|
# {{{ Linting
|
||||||
lint: lint-vnu lint-css lint-htmltest lint-htmlvalidate
|
lint: lint-vnu lint-css lint-htmltest lint-htmlvalidate
|
||||||
|
|
||||||
|
|
|
@ -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
BIN
public/favicon.ico
Normal file
Binary file not shown.
After Width: 256px | Height: 256px | Size: 151 KiB |
|
@ -54,7 +54,12 @@ impl<'a> Pages<'a> {
|
||||||
let metadata =
|
let metadata =
|
||||||
PageMetadata::new(&mut self.last_modified_cache, content_path, source, events)?;
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
19
src/html.rs
19
src/html.rs
|
@ -287,13 +287,6 @@ impl<'s> Writer<'s> {
|
||||||
continue;
|
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(
|
template!("templates/post-summary.html", out)?.feed(
|
||||||
out,
|
out,
|
||||||
|label, out| {
|
|label, out| {
|
||||||
|
@ -366,29 +359,30 @@ impl<'s> Writer<'s> {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
write!(out, r##"<li><a href="#{}">"##, heading.id)?;
|
writeln!(out, r##"<li><a href="#{}">"##, heading.id)?;
|
||||||
for event in &heading.events {
|
for event in &heading.events {
|
||||||
self.render_event(event, out)?;
|
self.render_event(event, out)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We only close the <a> here, as we might want to include a
|
// We only close the <a> here, as we might want to include a
|
||||||
// sublist inside the same <li> element.
|
// sublist inside the same <li> element.
|
||||||
write!(out, "</a>")?;
|
writeln!(out, "</a>")?;
|
||||||
|
|
||||||
let next_level =
|
let next_level =
|
||||||
self.metadata.toc.get(i + 1).map_or(2, |h| h.level);
|
self.metadata.toc.get(i + 1).map_or(2, |h| h.level);
|
||||||
|
|
||||||
match heading.level.cmp(&next_level) {
|
match heading.level.cmp(&next_level) {
|
||||||
Ordering::Equal => {
|
Ordering::Equal => {
|
||||||
write!(out, "</li>")?;
|
writeln!(out, "</li>")?;
|
||||||
}
|
}
|
||||||
Ordering::Less => {
|
Ordering::Less => {
|
||||||
write!(out, "<ol>")?;
|
writeln!(out, "<ol>")?;
|
||||||
level_stack.push(next_level);
|
level_stack.push(next_level);
|
||||||
}
|
}
|
||||||
Ordering::Greater => {
|
Ordering::Greater => {
|
||||||
|
writeln!(out, "</li>")?;
|
||||||
while level_stack.last().unwrap() > &next_level {
|
while level_stack.last().unwrap() > &next_level {
|
||||||
write!(out, "</ol></li>")?;
|
writeln!(out, "</ol></li>")?;
|
||||||
level_stack.pop();
|
level_stack.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -726,6 +720,7 @@ impl<'s> Writer<'s> {
|
||||||
date.format("%a, %d %b %Y")
|
date.format("%a, %d %b %Y")
|
||||||
)?;
|
)?;
|
||||||
} else if matches!(self.states.last(), Some(State::Strikethrough)) {
|
} else if matches!(self.states.last(), Some(State::Strikethrough)) {
|
||||||
|
self.states.pop();
|
||||||
out.write_str("</s>")?;
|
out.write_str("</s>")?;
|
||||||
} else {
|
} else {
|
||||||
out.write_str("</span>")?;
|
out.write_str("</span>")?;
|
||||||
|
|
|
@ -6,9 +6,7 @@
|
||||||
name="viewport"
|
name="viewport"
|
||||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||||
/>
|
/>
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#faebff" />
|
||||||
<title>Moonythm</title>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/styles.css" />
|
<link rel="stylesheet" href="/styles.css" />
|
||||||
|
|
||||||
<!-- MathML -->
|
<!-- MathML -->
|
||||||
|
@ -25,6 +23,8 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Meta -->
|
<!-- 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:site_name" content="Moonythm" />
|
||||||
<meta property="og:title" content="{{title}}" />
|
<meta property="og:title" content="{{title}}" />
|
||||||
<meta property="twitter:title" content="{{title}}" />
|
<meta property="twitter:title" content="{{title}}" />
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
{{posted_on}} by <a href="base_url">prescientmoon</a>
|
{{posted_on}} by <a href="{{base_url}}">prescientmoon</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Last updated on {{updated_on}}. <a href="{{source_url}}">Source</a> |
|
Last updated on {{updated_on}}. <a href="{{source_url}}">Source</a> |
|
||||||
|
|
|
@ -5,5 +5,9 @@
|
||||||
"html-validate:a11y",
|
"html-validate:a11y",
|
||||||
"html-validate:document",
|
"html-validate:document",
|
||||||
"html-validate:prettier"
|
"html-validate:prettier"
|
||||||
]
|
],
|
||||||
|
"rules": {
|
||||||
|
"require-sri": "off",
|
||||||
|
"heading-level": "off"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue