Code cleanup and stuff
This commit is contained in:
parent
b6dae2ff2c
commit
e68036d4f8
11
blogalba
11
blogalba
|
@ -117,8 +117,8 @@ sub do_cache {
|
||||||
undef @posts and undef @pages if $#posts > 0 or $#pages > 0;
|
undef @posts and undef @pages if $#posts > 0 or $#pages > 0;
|
||||||
opendir POSTS, "$basedir/posts/" or die "Couldn't open posts directory $basedir/posts/";
|
opendir POSTS, "$basedir/posts/" or die "Couldn't open posts directory $basedir/posts/";
|
||||||
while(readdir POSTS) {
|
while(readdir POSTS) {
|
||||||
next if /^\./ or /draft$/;
|
next unless /\.md$/;
|
||||||
say "Error reading post $_" and next unless readpost "$basedir/posts/$_";
|
warn "Error reading post $_\n" and next unless readpost("$basedir/posts/$_",1);
|
||||||
$nposts++;
|
$nposts++;
|
||||||
}
|
}
|
||||||
closedir POSTS;
|
closedir POSTS;
|
||||||
|
@ -126,8 +126,8 @@ sub do_cache {
|
||||||
|
|
||||||
opendir PAGES, "$basedir/pages/" or die "Couldn't open pages directory $basedir/pages/";
|
opendir PAGES, "$basedir/pages/" or die "Couldn't open pages directory $basedir/pages/";
|
||||||
while(readdir PAGES) {
|
while(readdir PAGES) {
|
||||||
next if /^\./ or /draft$/;
|
next unless /\.md$/;
|
||||||
say "Error reading page $_" and next unless readpost("$basedir/pages/$_",2);
|
warn "Error reading page $_\n" and next unless readpage("$basedir/pages/$_",2);
|
||||||
}
|
}
|
||||||
closedir PAGES;
|
closedir PAGES;
|
||||||
|
|
||||||
|
@ -142,9 +142,6 @@ sub do_cache {
|
||||||
pagination_calc;
|
pagination_calc;
|
||||||
}
|
}
|
||||||
|
|
||||||
do_cache;
|
|
||||||
page_init;
|
|
||||||
|
|
||||||
set server => '127.0.0.1';
|
set server => '127.0.0.1';
|
||||||
set port => 42069;
|
set port => 42069;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue