Class: Serif::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/serif/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(config_file) ⇒ Config

Returns a new instance of Config.



5
6
7
# File 'lib/serif/config.rb', line 5

def initialize(config_file)
  @config_file = config_file
end

Instance Method Details

#admin_passwordObject



13
14
15
# File 'lib/serif/config.rb', line 13

def admin_password
  yaml["admin"]["password"]
end

#admin_usernameObject



9
10
11
# File 'lib/serif/config.rb', line 9

def admin_username
  yaml["admin"]["username"]
end

#archive_enabled?Boolean

Returns:

  • (Boolean)


25
26
27
28
29
30
31
32
33
# File 'lib/serif/config.rb', line 25

def archive_enabled?
  a = yaml["archive"]

  if a
    a["enabled"]
  else
    false
  end
end

#archive_url_formatObject



35
36
37
# File 'lib/serif/config.rb', line 35

def archive_url_format
  (yaml["archive"] || {})["url_format"] || "/archive/:year/:month"
end

#image_upload_pathObject



17
18
19
# File 'lib/serif/config.rb', line 17

def image_upload_path
  yaml["image_upload_path"] || "/images/:timestamp_:name"
end


21
22
23
# File 'lib/serif/config.rb', line 21

def permalink
  yaml["permalink"] || "/:title"
end