From c601c8697a47cd7262310826193fadbd70966cf3 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 22 Feb 2025 16:25:36 -0500 Subject: [PATCH] Start a language-specific css file for highlight colors. --- default_environment/stylesheet/language_nix.css | 9 +++++++++ default_environment/templates/html/src_block.dust | 2 +- src/context/blog_post_page.rs | 6 ++++++ src/context/blog_stream.rs | 6 ++++++ src/context/page.rs | 6 ++++++ 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 default_environment/stylesheet/language_nix.css diff --git a/default_environment/stylesheet/language_nix.css b/default_environment/stylesheet/language_nix.css new file mode 100644 index 0000000..afc2665 --- /dev/null +++ b/default_environment/stylesheet/language_nix.css @@ -0,0 +1,9 @@ +.main_content { + .src_block { + &.srclg_nix { + .srchl_keyword { + color: green; + } + } + } +} diff --git a/default_environment/templates/html/src_block.dust b/default_environment/templates/html/src_block.dust index 608f90d..b7fac67 100644 --- a/default_environment/templates/html/src_block.dust +++ b/default_environment/templates/html/src_block.dust @@ -1,4 +1,4 @@ -
+
{?.language}
{.language}
{/.language} diff --git a/src/context/blog_post_page.rs b/src/context/blog_post_page.rs index 9dce558..f1d566b 100644 --- a/src/context/blog_post_page.rs +++ b/src/context/blog_post_page.rs @@ -64,6 +64,12 @@ render!( render_context.output_file, "stylesheet/main.css", )?, + get_web_path( + render_context.config, + render_context.output_root_directory, + render_context.output_file, + "stylesheet/language_nix.css", + )?, ]; let js_files = vec![get_web_path( render_context.config, diff --git a/src/context/blog_stream.rs b/src/context/blog_stream.rs index fac3606..9182226 100644 --- a/src/context/blog_stream.rs +++ b/src/context/blog_stream.rs @@ -62,6 +62,12 @@ render!( render_context.output_file, "stylesheet/main.css", )?, + get_web_path( + render_context.config, + render_context.output_root_directory, + render_context.output_file, + "stylesheet/language_nix.css", + )?, ]; let js_files = vec![get_web_path( render_context.config, diff --git a/src/context/page.rs b/src/context/page.rs index cd8e5f0..5515189 100644 --- a/src/context/page.rs +++ b/src/context/page.rs @@ -43,6 +43,12 @@ render!(RenderPage, IPage, original, render_context, { render_context.output_file, "stylesheet/main.css", )?, + get_web_path( + render_context.config, + render_context.output_root_directory, + render_context.output_file, + "stylesheet/language_nix.css", + )?, ]; let js_files = vec![get_web_path( render_context.config,