mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-01-30 22:57:59 +00:00
Ignore exported avatar images
This should enforce the build process to really export the images.
This commit is contained in:
parent
24b4db6783
commit
448527c85b
5
.gitignore
vendored
5
.gitignore
vendored
@ -3,7 +3,10 @@
|
||||
.direnv
|
||||
|
||||
# The code workspace used for the dedicated branches for certain content.
|
||||
./code-workspace/
|
||||
/code-workspace/
|
||||
|
||||
# The exported avatar images.
|
||||
/static/icons/avatars/
|
||||
|
||||
# Certain files just need to be ignored.
|
||||
/layouts/partials/openring.html
|
||||
|
8
Rakefile
8
Rakefile
@ -1,5 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'fileutils'
|
||||
require 'json'
|
||||
require 'open3'
|
||||
require 'shellwords'
|
||||
@ -26,7 +27,10 @@ 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: 'avif')
|
||||
Dir.glob('avatars/**/*.svg', base: args.base_dir) do |f|
|
||||
output_file = "#{File.dirname(f)}/#{File.basename(f, '.svg')}.#{args.output_extension}"
|
||||
dirname = File.dirname f
|
||||
output_file = "#{dirname}/#{File.basename(f, '.svg')}.#{args.output_extension}"
|
||||
|
||||
FileUtils.mkdir_p "#{args.output_dir}#{dirname}", verbose: true
|
||||
sh "magick #{args.base_dir}#{f} -quality 30 #{args.output_dir}#{output_file}"
|
||||
end
|
||||
end
|
||||
@ -52,7 +56,7 @@ task :build_webring, [:limit, :input, :output, :file] do |_, args|
|
||||
end
|
||||
|
||||
desc 'Create a web server'
|
||||
task :serve do
|
||||
task :serve => [:export_avatars] do
|
||||
sh 'nix develop -c hugo serve --buildFuture --verboseLog --destination public'
|
||||
end
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user