mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
reorder methods
This commit is contained in:
parent
063ae60867
commit
1e32f43a4a
1 changed files with 10 additions and 10 deletions
20
bin/blog.rb
20
bin/blog.rb
|
|
@ -118,6 +118,15 @@ class Blag
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def shorten(n)
|
||||||
|
short = ''
|
||||||
|
while n > 0
|
||||||
|
short = ShortURLCodeSet[n % ShortURLBase, 1] + short
|
||||||
|
n = (n / ShortURLBase).floor
|
||||||
|
end
|
||||||
|
short
|
||||||
|
end
|
||||||
|
|
||||||
def copy_assets
|
def copy_assets
|
||||||
Dir[File.join(@src, 'css', '*.css')].each do |stylesheet|
|
Dir[File.join(@src, 'css', '*.css')].each do |stylesheet|
|
||||||
minified = File.join(@css_dest, File.basename(stylesheet).sub('.css', '.min.css'))
|
minified = File.join(@css_dest, File.basename(stylesheet).sub('.css', '.min.css'))
|
||||||
|
|
@ -209,7 +218,7 @@ class Blag
|
||||||
def rss_html(post)
|
def rss_html(post)
|
||||||
Mustache.render(rss_template(post[:type]), { :post => post })
|
Mustache.render(rss_template(post[:type]), { :post => post })
|
||||||
end
|
end
|
||||||
|
|
||||||
def rss_for_posts(options = {})
|
def rss_for_posts(options = {})
|
||||||
title = options[:title] || @title
|
title = options[:title] || @title
|
||||||
subtitle = options[:subtitle] || @subtitle
|
subtitle = options[:subtitle] || @subtitle
|
||||||
|
|
@ -248,15 +257,6 @@ class Blag
|
||||||
xml
|
xml
|
||||||
end
|
end
|
||||||
|
|
||||||
def shorten(n)
|
|
||||||
short = ''
|
|
||||||
while n > 0
|
|
||||||
short = ShortURLCodeSet[n % ShortURLBase, 1] + short
|
|
||||||
n = (n / ShortURLBase).floor
|
|
||||||
end
|
|
||||||
short
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
main if $0 == __FILE__
|
main if $0 == __FILE__
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue