5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-03 10:46:07 +00:00
panel/lib/sutty.rb

32 lines
578 B
Ruby
Raw Normal View History

2017-09-25 22:35:06 +00:00
# frozen_string_literal: true
2017-09-28 20:20:31 +00:00
require 'yaml'
require_relative 'sutty/models/jekyll'
2017-09-25 22:35:06 +00:00
2017-09-28 20:20:31 +00:00
# Sutty
2017-09-25 22:35:06 +00:00
module Sutty
2017-09-28 20:20:31 +00:00
# La raíz
def self.root
@root ||= File.expand_path(File.join(File.dirname(__FILE__), '..'))
end
# La configuración
def self.settings
@settings ||= YAML.load(File.read(Sutty.config_file))
end
2017-09-25 22:35:06 +00:00
2017-09-28 20:20:31 +00:00
def self.config_file
@config_file ||= File.join(Sutty.root, '_config.yml')
end
def self.sites_dir
@sites_dir ||= File.join(Sutty.root, Sutty.settings['sites_dir'])
end
2017-09-25 22:35:06 +00:00
2017-09-28 20:20:31 +00:00
def self.sites
binding.pry
@sites ||= Jekyll.all
2017-09-25 22:35:06 +00:00
end
end