Skip to content

genehack/HiD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

HiD - Static website publishing framework

VERSION

CPAN version Build Status Coverage Status

SYNOPSIS

HÄ«D is a blog-aware, GitHub-friendly, static website generation system inspired by Jekyll.

DESCRIPTION

HiD users probably want to look at the documentation for the hid command.

Subsequent documentation in this file describes internal details that are only useful or interesting for people that are trying to modify or extend HiD.

ATTRIBUTES

categories

Categories hash, contains (category, post) pairs

cli_opts

Hashref of command line options to integrate into the config.

(HiD::App::Commands should pass in the $opt variable to this.)

config

Hashref of configuration information.

config_file

Path to a configuration file.

default_config

Hashref of standard configuration options. The default config is:

destination => '_site'    ,
include_dir => '_includes',
layout_dir  => '_layouts' ,
plugin_dir  => '_plugins' ,
posts_dir   => '_posts' ,
drafts_dir  => '_drafts' ,
source      => '.' ,

destination

Directory to write output files into.

N.B.: If it doesn't exist and is needed, it will be created.

draft_post_file_regex

Regular expression for which files will be recognized as draft blog posts.

FIXME should this be configurable?

FIXME this and post_file_regex should probably be built based on a common underlying "post_extensions_regex" attr...

excerpt_separator

String that distinguishes initial excerpt from "below the fold" content

Defaults to "\n\n"

include_dir

Directory for template "include" files

inputs

Hashref of input files. Keys are file paths; values are what type of file the system has classified that path as.

layout_dir

Directory where template files are located.

layouts

Hashref of HiD::Layout objects, keyed by layout name.

limit_posts

If set, only this many blog post files will be processed during publishing.

Setting this can significantly speed up publishing for sites with many blog posts.

objects

Array of objects (pages, posts, files) created during site processing.

page_file_regex

Regular expression for identifying "page" files.

# FIXME should it be possible to set this from the config?

pages

Arrayref of HiD::Page objects, populated during processing.

plugin_dir

Directory for plugins, which will be called after publish.

plugins

Plugins, which consume either of the HiD::Plugin or HiD::Generator roles.

Plugins used to subclass HiD::Plugin, but that behavior is deprecated and will be removed on or after 13 Nov 2014.

post_file_regex

Regular expression for which files will be recognized as blog posts.

FIXME should this be configurable?

posts_dir

Directory where blog posts are located.

posts

Arrayref of HiD::Post objects, populated during processing.

processor

Slot to hold the HiD::Processor object that will be used during the publication process.

processor_args

Arguments to use when instantiating the processor attribute.

Can be an arrayref or a hashref.

Defaults to appropriate Template Toolkit arguments.

regular_files

ArrayRef of HiD::File objects, populated during processing.

remove_unwritten_files ( Boolean )

Boolean value controlling whether files found in the dest_dir that weren't produced by HiD should be removed. In other words, when this is true, after a hid publish run, only files produced by HiD will be found in the dest_dir.

Defaults to true.

source

Base directory that all other paths are calculated relative to.

tags

Tags hash, contains (tag, posts) pairs

time

DateTime object from the start of the latest run of the system.

Cannot be set via argument.

written_files

Hashref of files written out during the publishing process.

METHODS

get_config

my $config_key_value = $self->get_config( $config_key_name );

Given a config key name, returns a config key value.

add_input

$self->add_input( $input_file => $input_type );

Record what input type a particular input file is.

seen_input

if( $self->seen_input( $input_file )) { ... }

Check to see if a particular input file has been seen.

get_layout_by_name

my $hid_layout_obj = $self->get_layout_by_name( $name );

Given a layout name (e.g., 'default') returns the corresponding HiD::Layout object.

add_object

$self->add_object( $generated_object );

Add an object to the set of objects generated during site processing.

all_objects

my @objects = $self->all_objects;

Returns the list of all objects that have been generated.

add_written_file

$self->add_written_file( $file => 1 );

Record that a file was written.

all_written_files

my @files = $self->all_written_files;

Return the list of all files that were written out.

wrote_file

if( $self->wrote_file( $file )) { ... }

Check to see if a particular file has been written out.

publish

$self->publish;

Process files and generate output per the active configuration.

CONTRIBUTORS

  • ChinaXing
  • reyjrar

SEE ALSO

AUTHOR

John SJ Anderson [email protected]

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by John SJ Anderson.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

About

Static website generation system *NOTE:* Main dev mirror at https://git.genehack.net/genehack/hid

Resources

Stars

Watchers

Forks

Packages

No packages published