Yggdrasil - Generates a website from a directory tree of content and templates |
Yggdrasil - Generates a website from a directory tree of content and templates
input_dir => '/home/me/site/source'
output_dir => '/home/me/www'
data_dir => 'data'
dir_mode => 0755
include => [qw(\.html$ \.shtml$)]
exclude => [qw(^_ \.tmpl$ ~$)]
@navigation
array.skip => [qw(^img ^index$)]
base_url => 'http://www.mysite.com'
base_template => 'base.tmpl'
template_extension => '.tmpl'
template_override => {beta => '/home/me/site/template.tmpl'}
timestamp_format => '%a %b %e %Y (%T)',
html_indices => [qw(index.html index.shtml)]
html_only => 0
front_page_navigation => 0
include_index => 0
siblings_include_index => 0
home_label => 'Home'
title_tag => 'h1'
default_title => 'No Title'
subpages => 1
pagination => 'Page '
ftp_host => 'ftp.mysite.com'
ftp_username => 'me'
ftp_password => 'secret'
ftp_path => '/www'
line(s)
of the log file.log_file_header => "# Yggdrasil log file\n"
line(s)
of the log file.log_file_footer => '# end of log file'
log_file_format => '{$fullname}'
release_file => '.release'
sp_command_line => '/usr/bin/nsgmls {$filename}',
forcecache => 0
help => 0
log_file => 'mysite.log'
update => 0
upload => 0
release => 0
validate => 0
verbose => 1
go()
find()
from File::Find. Depending on the configuration variables and commandline options it performs the following tasks:Before calling find()
: Open log file for writing, flush output directory, initialize progress bar.
After calling find()
: Close log file, delete files from output directory, upload files via FTP, update release file.
new()
See also: _init()
stats()
_pre_process(@files)
_process()
method. Creates or updates the following arrays:@siblings: A list of all files in the current directory, except subdirectories and HTML index files (set the configuration variable siblings_include_index
to 1 to include indexes).
@trail: The path to the current directory. The title of the root page is determined by the home_label
configuration variable. If the name of the current directory matches the name of the parent directory and the name of the current directory matches .*\/(\d+)$
, the current page is treated as a numbered subpage and a new title is generated from the pagination
configuration variable.
@navigation: A list of subpages. Contains all subpages except those matching any of the regexps in skip
or those that are numbered subpages of the current page.
All the above arrays contain hashrefs with the following data:
{ name => 'Page Title', href => 'relative_path/' }
See also: _process()
_process()
_post_process()
$depth
._bind_args()
See also: http://perlmonks.thepen.com/109068.html
_create_directory($directory)
dir_mode
._delete_files()
sync()
to get a list of the files removed from the input directory (if any). Deletes those files from the output directory._flush_output_directory()
_get_release()
release_file
. Sets release_time
to 0 if release file doesn’t exist._html_index($filename)
_include($filename)
$filename
matches any of the regexps in include
, false otherwise._init()
_init_stats()
_pmt($lexicon_entry,@parameters)
maketext()
(Print MakeText)._print_logline()
_read_configuration_file()
%Configuration
.Creates cache directory if it doesn’t exist.
Initializes external postprocessing sub if present.
_rmt($lexicon_entry,@parameters)
maketext()
(Return MakeText)._templates_in_path($directory)
template_extension
. Templates in subdirectories override templates in the root directory.The special template __base__
is set according to the configuration variable base_template
.
_trail_links()
See also: _html_index()
_update_content($filename)
_update_release_file()
_upload_files()
_validate_configuration()
_validate_file($filename)
$filename
in sp_command_line
and executes the command.Any error messages returned by the validator are appended to the errors
string.
No known bugs.
Yggdrasil requires the following modules:
AppConfig
Date::Format
Text::Template
Morten Wulff, <wulff@psyke.org>
Text::Template
Copyright 2002-2003, Morten Wulff
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Yggdrasil - Generates a website from a directory tree of content and templates |