Add signature detection in addition to markdown inclusion.
This commit is contained in:
parent
9cf8456d7c
commit
b6cb5dff97
|
@ -15,6 +15,7 @@ baseurl: "" # the subpath of your site, e.g. /blog
|
||||||
url: "http://annabunch.es" # the base hostname & protocol for your site
|
url: "http://annabunch.es" # the base hostname & protocol for your site
|
||||||
twitter_username: annabunches
|
twitter_username: annabunches
|
||||||
github_username: annabunches
|
github_username: annabunches
|
||||||
|
exclude: ["_posts/**/*.asc"]
|
||||||
|
|
||||||
permalink: none
|
permalink: none
|
||||||
timezone: America/New_York
|
timezone: America/New_York
|
||||||
|
|
|
@ -14,7 +14,11 @@ layout: default
|
||||||
|
|
||||||
<div class="post-verify">
|
<div class="post-verify">
|
||||||
{% if page.md_file %}
|
{% if page.md_file %}
|
||||||
|
<hr width="10%" style="margin-bottom: 1em"/>
|
||||||
The markdown source for this post is available here: <a href="{{page.md_file}}">{{page.md_file}}</a> <br/>
|
The markdown source for this post is available here: <a href="{{page.md_file}}">{{page.md_file}}</a> <br/>
|
||||||
|
{% if page.sig_file %}
|
||||||
|
The gpg signature for the markdown source is available here: <a href="{{page.sig_file}}">{{page.sig_file}}</a> <br/>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
|
@ -1,14 +1,26 @@
|
||||||
# Adds metadata to the post object for linking to the source page.
|
# Adds metadata to the post object for linking to the source page.
|
||||||
|
# Also adds metadata linking to the gpg signature file, if it exists.
|
||||||
Jekyll::Hooks.register :posts, :pre_render do |post, payload|
|
Jekyll::Hooks.register :posts, :pre_render do |post, payload|
|
||||||
if post.path =~ /\.md$/
|
if post.path =~ /\.md$/
|
||||||
post.data['md_file'] = "/#{post.data['category']}/#{post.basename}"
|
post.data['md_file'] = "/#{post.data['category']}/#{post.basename}"
|
||||||
|
|
||||||
|
sig_filename = "#{post.path}.asc"
|
||||||
|
if File.exist?(sig_filename)
|
||||||
|
post.data['sig_file'] = post.data['md_file'] + '.asc'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Copy all of the source markdown files directly into the destination.
|
# Copy all of the source markdown files and signature files
|
||||||
|
# directly into the destination.
|
||||||
Jekyll::Hooks.register :site, :post_write do |site|
|
Jekyll::Hooks.register :site, :post_write do |site|
|
||||||
dest = site.dest
|
dest = site.dest
|
||||||
site.posts.docs.select{|p| p.path =~ /\.md$/}.each do |post|
|
site.posts.docs.select{|p| p.path =~ /\.md$/}.each do |post|
|
||||||
FileUtils.cp(post.path, "#{dest}/#{post.data['category']}/#{post.basename}")
|
FileUtils.cp(post.path, "#{dest}/#{post.data['md_file']}")
|
||||||
|
|
||||||
|
sig_filename = "#{post.path}.asc"
|
||||||
|
if File.exist?(sig_filename)
|
||||||
|
FileUtils.cp(sig_filename, "#{dest}/#{post.data['sig_file']}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,5 +38,5 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-verify {
|
.post-verify {
|
||||||
font-size: $small-font-size;
|
font-size: $very-small-font-size;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ $base-font-weight: 400;
|
||||||
$small-font-size: $base-font-size * 0.875;
|
$small-font-size: $base-font-size * 0.875;
|
||||||
$base-line-height: 1.5;
|
$base-line-height: 1.5;
|
||||||
$large-font-size: $base-font-size * 1.125;
|
$large-font-size: $base-font-size * 1.125;
|
||||||
|
$very-small-font-size: $base-font-size * 0.750;
|
||||||
|
|
||||||
$spacing-unit: 30px;
|
$spacing-unit: 30px;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user