diff --git a/Cargo.lock b/Cargo.lock index d4f11ad..49d5b1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1593,6 +1593,7 @@ dependencies = [ "npezza93-tree-sitter-nix", "once_cell", "pulldown-cmark", + "rayon", "regex", "serde", "sha256", diff --git a/Cargo.toml b/Cargo.toml index da6921d..9887f9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ hypertext = "0.5.1" image = "0.24.0" katex = "0.4.6" once_cell = "1.19.0" +rayon = "1.10.0" regex = "1.10.5" serde = { version = "1.0.203", features = ["derive"] } sha256 = "1.5.0" diff --git a/content/posts/sejm.md b/content/posts/sejm.md deleted file mode 100644 index 28054c7..0000000 --- a/content/posts/sejm.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: A visit to Sejm -date: 2023-11-14T20:37:28.283Z ---- - - -![a](@assets/posts/sejm/IMG_20231110_125448.jpg) - -![a](@assets/posts/sejm/IMG_20231110_125640.jpg) - -![a](@assets/posts/sejm/IMG_20231111_112524.jpg) - -![a](@assets/posts/sejm/IMG_20231111_112655.jpg) - -![a](@assets/posts/sejm/IMG_20231111_112708.jpg) - -![a](@assets/posts/sejm/IMG_20231111_113421.jpg) - -![a](@assets/posts/sejm/IMG_20231111_113641.jpg) - -![a](@assets/posts/sejm/IMG_20231111_114027.jpg) - -![a](@assets/posts/sejm/IMG_20231111_114532.jpg) - -![a](@assets/posts/sejm/IMG_20231111_114547.jpg) - -![a](@assets/posts/sejm/IMG_20231111_114717.jpg) - -![a](@assets/posts/sejm/IMG_20231111_114731.jpg) - -![a](@assets/posts/sejm/IMG_20231111_115145.jpg) - -![a](@assets/posts/sejm/IMG_20231111_115155.jpg) - -![a](@assets/posts/sejm/IMG_20231111_115219.jpg) - -![a](@assets/posts/sejm/IMG_20231111_115223.jpg) - -![a](@assets/posts/sejm/IMG_20231111_120050.jpg) - -![a](@assets/posts/sejm/IMG_20231111_120845.jpg) - -![a](@assets/posts/sejm/IMG_20231111_120954.jpg) - -![a](@assets/posts/sejm/IMG_20231111_121205.jpg) - -![a](@assets/posts/sejm/IMG_20231111_121336.jpg) - -![a](@assets/posts/sejm/IMG_20231111_121618.jpg) - -![a](@assets/posts/sejm/IMG_20231111_122703.jpg) - -![a](@assets/posts/sejm/IMG_20231111_122706.jpg) - -![a](@assets/posts/sejm/IMG_20231111_124915.jpg) - diff --git a/content/posts/sejm/index.md b/content/posts/sejm/index.md new file mode 100644 index 0000000..d0faa97 --- /dev/null +++ b/content/posts/sejm/index.md @@ -0,0 +1,56 @@ +--- +title: A visit to Sejm +date: 2023-11-14T20:37:28.283Z +--- + + +![a](IMG_20231110_125448.jpg) + +![a](IMG_20231110_125640.jpg) + +![a](IMG_20231111_112524.jpg) + +![a](IMG_20231111_112655.jpg) + +![a](IMG_20231111_112708.jpg) + +![a](IMG_20231111_113421.jpg) + +![a](IMG_20231111_113641.jpg) + +![a](IMG_20231111_114027.jpg) + +![a](IMG_20231111_114532.jpg) + +![a](IMG_20231111_114547.jpg) + +![a](IMG_20231111_114717.jpg) + +![a](IMG_20231111_114731.jpg) + +![a](IMG_20231111_115145.jpg) + +![a](IMG_20231111_115155.jpg) + +![a](IMG_20231111_115219.jpg) + +![a](IMG_20231111_115223.jpg) + +![a](IMG_20231111_120050.jpg) + +![a](IMG_20231111_120845.jpg) + +![a](IMG_20231111_120954.jpg) + +![a](IMG_20231111_121205.jpg) + +![a](IMG_20231111_121336.jpg) + +![a](IMG_20231111_121618.jpg) + +![a](IMG_20231111_122703.jpg) + +![a](IMG_20231111_122706.jpg) + +![a](IMG_20231111_124915.jpg) + diff --git a/content/posts/university-postscriptum.md b/content/posts/university-postscriptum/index.md similarity index 98% rename from content/posts/university-postscriptum.md rename to content/posts/university-postscriptum/index.md index 671aff7..b50a4d3 100644 --- a/content/posts/university-postscriptum.md +++ b/content/posts/university-postscriptum/index.md @@ -34,7 +34,7 @@ I've decided to ditch fully-featured IDEs such as IntelliJ and lighter editors s I also like the fact that the entire config for Neovim can be stored in a git repository. I uploaded mine to a [GitHub repository](https://github.com/kamoshi/dotfiles/tree/main/nvim) for anyone curious. You can use Lua to configure this editor instead of Vimscript, which is pretty cool, I like Lua. -![Neovim screengrab](@assets/posts/neovim.png) +![Neovim screengrab](neovim.png) ## Arch Linux @@ -53,7 +53,7 @@ On top of all that, Arch Linux is a rolling release distro, which means that eve Below is an obligatory neofetch screenshot. -![Obligatory neofetch screengrab](@assets/posts/arch.png) +![Obligatory neofetch screengrab](arch.png) For some time I probably won't be writing anything new in here. It's really ironic, but now that I do have a lot of time, I don't really have anything interesting to write about. I have a ton of things to do, which I couldn't really do while I was studying full time at a university. diff --git a/content/wiki/touhouroom.md b/content/wiki/touhouroom.md deleted file mode 100644 index e910b30..0000000 --- a/content/wiki/touhouroom.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: Touhou meetups ---- - -## Remcon 2022 - -![Blackboard art and flag](../../assets/wiki/touhouroom/20220226-173752_1.jpg) - -## Remcon 2023 - -![Fumos](../../assets/wiki/touhouroom/IMG_20230225_185115.jpg) - -## Fantasmagoria 2023 - -![Blackboard art](../../assets/wiki/touhouroom/IMG_20230716_092353.jpg) -![Whiteboard art](../../assets/wiki/touhouroom/IMG_20230716_092402.jpg) - diff --git a/content/wiki/touhouroom/index.md b/content/wiki/touhouroom/index.md new file mode 100644 index 0000000..96a81b7 --- /dev/null +++ b/content/wiki/touhouroom/index.md @@ -0,0 +1,17 @@ +--- +title: Touhou meetups +--- + +## Remcon 2022 + +![Blackboard art and flag](20220226-173752_1.jpg) + +## Remcon 2023 + +![Fumos](IMG_20230225_185115.jpg) + +## Fantasmagoria 2023 + +![Blackboard art](IMG_20230716_092353.jpg) +![Whiteboard art](IMG_20230716_092402.jpg) + diff --git a/src/build.rs b/src/build.rs index daf78c2..b576576 100644 --- a/src/build.rs +++ b/src/build.rs @@ -7,6 +7,7 @@ use std::path::Path; use std::process::Command; use camino::{Utf8Path, Utf8PathBuf}; +use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use crate::pipeline::{AssetKind, Output, OutputKind, Sack, Virtual}; use crate::BuildContext; @@ -134,7 +135,7 @@ fn store_hash(buffer: &[u8]) -> Utf8PathBuf { pub(crate) fn store_hash_all(items: &[&Output]) -> Vec { items - .iter() + .par_iter() .filter_map(|item| match item.kind { OutputKind::Asset(ref asset) => match asset.kind { AssetKind::Image => { diff --git a/src/main.rs b/src/main.rs index ae187f5..5b492b4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -248,7 +248,7 @@ where fn process_content(item: PipelineItem) -> PipelineItem where - T: for<'de> Deserialize<'de> + Content + Clone + 'static, + T: for<'de> Deserialize<'de> + Content + Clone + Send + Sync + 'static, { let meta = match item { PipelineItem::Skip(e) if matches!(e.kind, FileItemKind::Index) => e, diff --git a/src/pipeline.rs b/src/pipeline.rs index b4718e9..a4727a3 100644 --- a/src/pipeline.rs +++ b/src/pipeline.rs @@ -65,7 +65,7 @@ pub(crate) struct FileItem { /// Marks how the asset should be processed by the SSG. pub(crate) enum AssetKind { /// Data renderable to HTML. In order to process the data, a closure should be called. - Html(Box String>), + Html(Box String + Send + Sync>), /// Bibliographical data. Bibtex(Library), /// Image. For now they are simply cloned to the `dist` director. @@ -87,7 +87,7 @@ impl Debug for AssetKind { } impl AssetKind { - pub fn html(f: impl Fn(&Sack) -> String + 'static) -> Self { + pub fn html(f: impl Fn(&Sack) -> String + Send + Sync + 'static) -> Self { Self::Html(Box::new(f)) } } @@ -103,10 +103,10 @@ pub(crate) struct Asset { /// Dynamically generated asset not corresponding to any file on disk. This is useful when the /// generated page is not a content page, e.g. page list. -pub(crate) struct Virtual(pub Box String>); +pub(crate) struct Virtual(pub Box String + Send + Sync>); impl Virtual { - pub fn new(call: impl Fn(&Sack) -> String + 'static) -> Self { + pub fn new(call: impl Fn(&Sack) -> String + Send + Sync + 'static) -> Self { Self(Box::new(call)) } }