al-quran.reflectslight.io/nanoc/lib/mixin.rb

31 lines
578 B
Ruby
Raw Normal View History

2023-10-07 08:21:48 +02:00
# frozen_string_literal: true
module Mixin
2023-10-07 22:44:58 +02:00
require "memoize"
extend Memoize
2023-10-07 08:21:48 +02:00
require_relative "mixin/t"
require_relative "mixin/inline"
require_relative "mixin/erb"
require_relative "mixin/opengraph"
2024-05-01 16:51:18 +02:00
def app_version
@app_version ||= begin
ver = File.read File.join(Dir.getwd, "VERSION")
ver.gsub(/[^\d.]/, '')
end
end
2023-10-07 08:21:48 +02:00
def build_dir
nanoc = Ryo.from YAML.load_file(File.join(Dir.getwd, "nanoc.yaml"))
nanoc.output_dir
end
2023-10-07 22:44:58 +02:00
memoize :build_dir
2023-10-07 08:21:48 +02:00
include T
include Inline
include ERB
include OpenGraph
end
use_helper Mixin