20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/jekyll-wkd/generator.rb', line 20
def generate site
@site = site
pgp_home = Dir.mktmpdir "jekyll-wkd-"
GPGME::Engine.home_dir = pgp_home
Jekyll::Hooks.register :site, :post_write do
FileUtils.remove_dir pgp_home if File.directory? pgp_home
end
domains = Set.new
key_files.each do |file|
File.open(file.path) do |data|
GPGME::Key.import(data).imports.each do |key|
kf = KeyFile.new(
@site,
@site.source,
File.dirname(file.relative_path),
File.basename(file.relative_path),
key.fingerprint,
advanced?
)
domains << kf.domain
@site.static_files << kf
end
end
end
if !advanced? && domains.size > 1
Jekyll.logger.warn "Cannot export multiple domains in direct mode"
end
domains.each do |domain|
@site.pages << make_policy(domain)
end
end
|