diff --git a/layouts/blog.erb b/layouts/blog.erb new file mode 100644 index 0000000..df2ac9d --- /dev/null +++ b/layouts/blog.erb @@ -0,0 +1,21 @@ +<%= render 'header' %> + + <%= render 'main-header', :toc => true %> + + <%= render 'title' %> + + <%= render 'mindkiller' %> + + <%= render 'episteme' %> + + <% render 'content' do %> + <%= yield %> + <% end %> + + <%= render 'comments' %> + + <%= render 'main-footer', :toc => true %> + + <%= render 'breadcrumb' %> + +<%= render 'footer' %> diff --git a/layouts/breadcrumb.erb b/layouts/breadcrumb.erb new file mode 100644 index 0000000..f1366bb --- /dev/null +++ b/layouts/breadcrumb.erb @@ -0,0 +1,6 @@ + +
+ <%= breadcrumbs.map do |crumb| + "#{crumb[:title].downcase}" + end.join(" » ") %> +
diff --git a/layouts/comments.erb b/layouts/comments.erb new file mode 100644 index 0000000..d631bcb --- /dev/null +++ b/layouts/comments.erb @@ -0,0 +1,25 @@ + +<% unless @item[:no_comments] or @item[:is_category] %> +
+
+ + + + blog comments powered by Disqus + +
+<% end %> diff --git a/layouts/content.erb b/layouts/content.erb new file mode 100644 index 0000000..8dc9bd4 --- /dev/null +++ b/layouts/content.erb @@ -0,0 +1,6 @@ + +
+ +<%= yield %> + +
diff --git a/layouts/default.erb b/layouts/default.erb index a4afb7a..c44a792 100644 --- a/layouts/default.erb +++ b/layouts/default.erb @@ -1,111 +1,21 @@ - - - - - <%= @item[:title] %> - - - - - - - -
"> - -
- - <% if @item[:title] %> - - <% end %> + <%= render 'main-header', :toc => true %> - <% if @item.mindkiller? %> -
-

Warning: this page contains mind-killing content. Proceed with caution. The author does not endorse any of the views expressed here, even when they may look convincing. If you feel offended, consider that the author might be trolling you and whether you want to encourage them even further.

-
- <% end %> - - - <% if @item.epistemic? %> -
-

- Last modified: - - <%= @item[:date] %> - (<%= techne @item[:techne] %>). - - - Epistemic state: - - <%= episteme @item[:episteme] %>. - -

-
- <% end %> + <%= render 'title' %> - -
+ <%= render 'mindkiller' %> -<%= yield %> + <%= render 'episteme' %> -
- - - <% unless @item[:no_comments] or @item[:is_category] %> -
-
- - - - blog comments powered by Disqus - -
- <% end %> -
+ <%= render 'comments' %> - <% if @item[:toc] %> - - - <% end %> + <%= render 'main-footer', :toc => true %> -
- - -
- <%= breadcrumbs.map do |crumb| - "#{crumb[:title].downcase}" - end.join(" » ") %> -
- - + <%= render 'breadcrumb' %> + +<%= render 'footer' %> diff --git a/layouts/episteme.erb b/layouts/episteme.erb new file mode 100644 index 0000000..3216d8d --- /dev/null +++ b/layouts/episteme.erb @@ -0,0 +1,14 @@ + +<% if @item.epistemic? %> +
+

+ Last modified: <%= @item[:date] %> (<%= techne @item[:techne] %>). + + + Epistemic state: + + <%= episteme @item[:episteme] %>. + +

+
+<% end %> diff --git a/layouts/footer.erb b/layouts/footer.erb new file mode 100644 index 0000000..308b1d0 --- /dev/null +++ b/layouts/footer.erb @@ -0,0 +1,2 @@ + + diff --git a/layouts/header.erb b/layouts/header.erb new file mode 100644 index 0000000..b11a572 --- /dev/null +++ b/layouts/header.erb @@ -0,0 +1,22 @@ + + + + + <%= @item[:title] %> + + + + + + + diff --git a/layouts/main-footer.erb b/layouts/main-footer.erb new file mode 100644 index 0000000..d560936 --- /dev/null +++ b/layouts/main-footer.erb @@ -0,0 +1,13 @@ + + +<% if @toc %> + <% if @item[:toc] %> + + + <% end %> + +<% end %> diff --git a/layouts/main-header.erb b/layouts/main-header.erb new file mode 100644 index 0000000..4b97ab0 --- /dev/null +++ b/layouts/main-header.erb @@ -0,0 +1,6 @@ +<% if @toc %> +
"> +<% end %> + + +
diff --git a/layouts/mindkiller.erb b/layouts/mindkiller.erb new file mode 100644 index 0000000..ff1bdb1 --- /dev/null +++ b/layouts/mindkiller.erb @@ -0,0 +1,5 @@ +<% if @item.mindkiller? %> +
+

Warning: this page contains mind-killing content. Proceed with caution. The author does not endorse any of the views expressed here, even when they may look convincing. If you feel offended, consider that the author might be trolling you and whether you want to encourage them even further.

+
+<% end %> diff --git a/layouts/title.erb b/layouts/title.erb new file mode 100644 index 0000000..c224aa4 --- /dev/null +++ b/layouts/title.erb @@ -0,0 +1,8 @@ + +<% if @item[:title] %> + +<% end %> diff --git a/lib/sites.rb b/lib/sites.rb index 8e7449d..681ef0e 100644 --- a/lib/sites.rb +++ b/lib/sites.rb @@ -10,3 +10,38 @@ def sites Dir['content_*'].map{|d| d.gsub(/^content_/, '')} end +def disqus_site + # TODO merge them all? + # site -> disqus shortname + case $site + when "muflax" + "muflax" + when "sutra" + "muflaxsutra" + when "daily" + "dailymuflax" + when "blog" + "muflaxblog" + else # put 'em on the main site + "muflax" + end +end + +def disqus_url item + "http://#{main_site? ? "" : "#{$site}."}muflax.com#{item.identifier}" +end + +def site_title + case $site + when "muflax" + "lies and wonderland" + when "sutra" + "Blogchen" + when "daily" + "muflax becomes a saint" + when "blog" + "muflax' mindstream" + else # placeholder + "muflaxia" + end +end