Module: Adocsite

Defined in:
lib/adocsite.rb,
lib/adocsite/site.rb,
lib/adocsite/config.rb,
lib/adocsite/engine.rb,
lib/adocsite/context.rb,
lib/adocsite/version.rb,
lib/adocsite/wp/post.rb,
lib/adocsite/commands.rb,
lib/adocsite/templates.rb,
lib/adocsite/content_types.rb,
lib/adocsite/content_loader.rb

Defined Under Namespace

Classes: Article, Category, Commands, Content, ContentLoader, Context, Engine, Page, Request, RequestProcessing, Site, Templates, WpPost

Constant Summary collapse

DefaultSettings =
{
  # general stuff
  :SITE_TITLE => "Site Title",
  # if you really want you can put site url here
  # but then you will not be able to browse site by
  # opening index.html file from file explorer
  :SITE_URL => "",

  # input locations
  :INPUT_FOLDERS => ["work", "docs"],
  :TEMPLATES_FOLDER => File.join(File.dirname(__FILE__), "..", "..", "tpl"),

  # output locations
  :OUTPUT_FOLDER => "deploy",
  :STYLES_FOLDER => "css",
  :SCRIPTS_FOLDER => "js",
  :IMAGES_FOLDER => "img",

  # templates
  :THEME => "default",

  # file filters
  :STYLES => ".css",
  :SCRIPTS => ".js",
  # constant (or variable) defined like this can be passed to method that accepts multiple arguments using *
  # i.e. String.ends_with?(*IMAGES)
  :IMAGES => [".jpg", ".jpeg", ".gif", ".png", ".tif", ".bmp", ".svg"],
  :DOCUMENTS => ".adoc",
  :TEMPLATES => ".haml",
}
DefaultWpSettings =
{
    :host => "localhost",
    :path => "/xmlrpc.php",
    :port => 80,
    :username => "editor",
    :password => "editor"
}
VERSION =
"1.0.1"

Class Method Summary collapse

Class Method Details

.configObject

AdocSite configuration



6
7
8
# File 'lib/adocsite/config.rb', line 6

def config
  @settings || Adocsite::DefaultSettings
end

.config=(value) ⇒ Object



10
11
12
# File 'lib/adocsite/config.rb', line 10

def config= value
  @settings = self.config.merge(value)
end

.wpconfigObject

Posting articles to Wordpress



49
50
51
# File 'lib/adocsite/config.rb', line 49

def wpconfig
  @wpsettings || Adocsite::DefaultWpSettings
end

.wpconfig=(value) ⇒ Object



53
54
55
# File 'lib/adocsite/config.rb', line 53

def wpconfig= value
  @wpsettings = self.wpconfig.merge(value)
end