mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-02-07 12:19:36 +00:00
Update Rakefile tasks
This commit is contained in:
parent
2f89659289
commit
ff3cc17d8c
15
Rakefile
15
Rakefile
@ -1,13 +1,18 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'rake/clean'
|
||||||
|
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'json'
|
require 'json'
|
||||||
require 'open3'
|
require 'open3'
|
||||||
|
require 'open-uri/cached'
|
||||||
require 'set'
|
require 'set'
|
||||||
require 'shellwords'
|
require 'shellwords'
|
||||||
|
|
||||||
|
OpenURI::Cache.cache_path = "#{Dir.pwd}/.cache"
|
||||||
|
|
||||||
desc 'Build the site'
|
desc 'Build the site'
|
||||||
task :build, [:context, :base_url] => [:export_avatars] do |_, args|
|
task :build, %i[context base_url] => %i[export_avatars] do |_, args|
|
||||||
args.with_defaults(context: 'production')
|
args.with_defaults(context: 'production')
|
||||||
draft_args = '--environment development --buildDrafts --buildFuture --buildExpired' unless args.context == 'production'
|
draft_args = '--environment development --buildDrafts --buildFuture --buildExpired' unless args.context == 'production'
|
||||||
base_uri_args = "-b #{args.base_url}" if args.base_url
|
base_uri_args = "-b #{args.base_url}" if args.base_url
|
||||||
@ -19,7 +24,7 @@ task :build, [:context, :base_url] => [:export_avatars] do |_, args|
|
|||||||
end
|
end
|
||||||
|
|
||||||
desc 'Export the avatar images'
|
desc 'Export the avatar images'
|
||||||
task :export_avatars, [:base_dir, :output_dir, :output_extension] do |_, args|
|
task :export_avatars, %i[base_dir output_dir output_extension] do |_, args|
|
||||||
args.with_defaults(base_dir: './assets/svg/', output_dir: './static/icons/', output_extension: 'avif')
|
args.with_defaults(base_dir: './assets/svg/', output_dir: './static/icons/', output_extension: 'avif')
|
||||||
|
|
||||||
output_dirs = Set[]
|
output_dirs = Set[]
|
||||||
@ -36,7 +41,7 @@ task :export_avatars, [:base_dir, :output_dir, :output_extension] do |_, args|
|
|||||||
end
|
end
|
||||||
|
|
||||||
desc 'Build the webring to be embedded with the site'
|
desc 'Build the webring to be embedded with the site'
|
||||||
task :build_webring, [:limit, :input, :output, :file] do |_, args|
|
task :build_webring, %i[limit input output file] do |_, args|
|
||||||
args.with_defaults(
|
args.with_defaults(
|
||||||
limit: 5,
|
limit: 5,
|
||||||
file: './data/blogs.json',
|
file: './data/blogs.json',
|
||||||
@ -56,8 +61,8 @@ task :build_webring, [:limit, :input, :output, :file] do |_, args|
|
|||||||
end
|
end
|
||||||
|
|
||||||
desc 'Create a web server'
|
desc 'Create a web server'
|
||||||
task :serve => [:export_avatars] do
|
task :serve do
|
||||||
sh 'nix develop -c hugo serve --buildFuture --verboseLog --destination public'
|
sh 'nix develop -c hugo serve --buildFuture --destination public'
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Update the Hugo modules for this project'
|
desc 'Update the Hugo modules for this project'
|
||||||
|
Loading…
Reference in New Issue
Block a user