diff --git a/Rakefile b/Rakefile index 16a0cf9..7a1f581 100644 --- a/Rakefile +++ b/Rakefile @@ -11,7 +11,7 @@ github_api_headers = { github_api_headers['Authorization'] = "Token #{ENV['GITHUB_API_BEARER_TOKEN']}" if ENV['GITHUB_API_BEARER_TOKEN'] desc 'Build the site in Netlify with the given context' -task :build, [:context, :base_url] do |_, args| +task :build, [:context, :base_url] => [:optimize_avatars] do |_, args| args.with_defaults(context: 'production') draft_args = '--environment development --buildDrafts --buildFuture --buildExpired' unless args.context == 'production' base_uri_args = "-b #{args.base_url}" if args.base_url @@ -22,6 +22,15 @@ task :build, [:context, :base_url] do |_, args| sh "nix develop -c hugo #{draft_args} #{base_uri_args} --destination public" end +desc 'Export the avatar images' +task :export_avatars, [:base_dir, :output_dir, :output_extension] do |_, args| + args.with_defaults(base_dir: './assets/svg/', output_dir: './static/icons/', output_extension: 'webp') + Dir.glob('avatars/**/*.svg', base: args.base_dir) do |f| + output_file = "#{File.dirname(f)}/#{File.basename(f, '.svg')}.#{args.output_extension}" + sh "magick #{args.base_dir}#{f} -quality 10 #{args.output_dir}#{output_file}" + end +end + desc 'Build the webring to be embedded with the site' task :build_webring, [:limit, :input, :output, :file] do |_, args| args.with_defaults( diff --git a/shell.nix b/shell.nix index f37ad73..a46cb4a 100644 --- a/shell.nix +++ b/shell.nix @@ -32,6 +32,7 @@ mkShell { tree-sitter (tree-sitter.withPlugins (_: tree-sitter.allGrammars)) netlify-cli + imagemagick # Formatters... rufo # ...for Ruby. diff --git a/static/icons/avatars/ezran/curious.webp b/static/icons/avatars/ezran/curious.webp index 5a64e61..bfb3350 100644 Binary files a/static/icons/avatars/ezran/curious.webp and b/static/icons/avatars/ezran/curious.webp differ diff --git a/static/icons/avatars/ezran/default.webp b/static/icons/avatars/ezran/default.webp index 6fc3d49..302f41a 100644 Binary files a/static/icons/avatars/ezran/default.webp and b/static/icons/avatars/ezran/default.webp differ diff --git a/static/icons/avatars/ezran/skeptical.webp b/static/icons/avatars/ezran/skeptical.webp index 651afc1..017200f 100644 Binary files a/static/icons/avatars/ezran/skeptical.webp and b/static/icons/avatars/ezran/skeptical.webp differ diff --git a/static/icons/avatars/foodogsquared/close.webp b/static/icons/avatars/foodogsquared/close.webp deleted file mode 100644 index 0faa437..0000000 Binary files a/static/icons/avatars/foodogsquared/close.webp and /dev/null differ diff --git a/static/icons/avatars/foodogsquared/curious.webp b/static/icons/avatars/foodogsquared/curious.webp index 03469c9..675c340 100644 Binary files a/static/icons/avatars/foodogsquared/curious.webp and b/static/icons/avatars/foodogsquared/curious.webp differ diff --git a/static/icons/avatars/foodogsquared/default.webp b/static/icons/avatars/foodogsquared/default.webp index d840ada..7fb11e5 100644 Binary files a/static/icons/avatars/foodogsquared/default.webp and b/static/icons/avatars/foodogsquared/default.webp differ diff --git a/static/icons/avatars/foodogsquared/nervous.webp b/static/icons/avatars/foodogsquared/nervous.webp index bcd2a8e..4e7ed8a 100644 Binary files a/static/icons/avatars/foodogsquared/nervous.webp and b/static/icons/avatars/foodogsquared/nervous.webp differ