Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

feature: allow set each talk in a separate config file #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions 2018/_src/bin/build.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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) = @_;

Expand Down