From 3d5877e7826ee2c645829a351b603a9a78c485ff Mon Sep 17 00:00:00 2001 From: Francesc Guasch Date: Tue, 16 Oct 2018 12:06:30 +0200 Subject: [PATCH] feature: allow set each talk in a separate config file This way it will be easier to add some talks in parallel without conflicting in config.yml --- 2018/_src/bin/build.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/2018/_src/bin/build.pl b/2018/_src/bin/build.pl index dde9353..c006ff4 100755 --- a/2018/_src/bin/build.pl +++ b/2018/_src/bin/build.pl @@ -38,6 +38,8 @@ sub build_templates { $config->{schedule} = build_schedule($config); + load_talks_config($config); + say "Building templates:"; build_template('index.tt', $config, 'index.html'); @@ -54,6 +56,20 @@ sub build_templates { say "Done!"; } +sub load_talks_config { + my $config = shift; + + my $dir = "$current_dir/../talks.d"; + opendir my $talks_d, $dir or return; + while ( my $file = readdir $talks_d) { + next if $file !~ /\.yml$/; + + my $talk = LoadFile("$dir/$file"); + push @{$config->{talks}}, $talk; + } + closedir $talks_d; +} + sub build_template { my ($template_file, $vars, $output_file) = @_;