Sha256: cc6745c84ae24f635483e742fa8797673a77ecef3f0e971fab9bb11046f9dfc6

Contents?: true

Size: 783 Bytes

Versions: 27

Compression:

Stored size: 783 Bytes

Contents

#
# title-link.rb: make permalink include all of title. $Revision: 1.3 $
#
# Copyright (C) 2005 TADA Tadashi <sho@spc.gr.jp>
# You can redistribute it and/or modify it under GPL2.
#
def title_of_day( date, title )
	if respond_to?( :blog_category ) then
		cats, stripped = title.scan( /^((?:\[[^\]]+\])+)\s*(.*)/ )[0]
		unless cats then
			cats = ''
			stripped = title
		else
			cats << ' '
		end
	else
		cats = ''
		stripped = title
	end
	r = <<-HTML
	<span class="title">
	#{cats}
	HTML
	if @mode == 'day' then
		r << stripped
	else
		r << %Q[<a href="#{h @index}#{anchor( date.strftime( '%Y%m%d' ) )}">#{stripped}</a>]
	end
	r << "</span>"
	return r.gsub( /^\t+/, '' ).chomp
end


# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
tdiary-blogkit-5.0.7 plugin/title-link.rb
tdiary-blogkit-5.0.6 plugin/title-link.rb
tdiary-blogkit-5.0.5 plugin/title-link.rb
tdiary-blogkit-5.0.4 plugin/title-link.rb
tdiary-blogkit-5.0.3 plugin/title-link.rb
tdiary-blogkit-5.0.2 plugin/title-link.rb
tdiary-blogkit-5.0.1 plugin/title-link.rb