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.3.0 plugin/title-link.rb
tdiary-blogkit-5.2.4 plugin/title-link.rb
tdiary-blogkit-5.2.3 plugin/title-link.rb
tdiary-blogkit-5.2.2 plugin/title-link.rb
tdiary-blogkit-5.2.1 plugin/title-link.rb
tdiary-blogkit-5.2.0 plugin/title-link.rb
tdiary-blogkit-5.1.7 plugin/title-link.rb
tdiary-blogkit-5.1.6 plugin/title-link.rb
tdiary-blogkit-5.1.5 plugin/title-link.rb
tdiary-blogkit-5.1.4 plugin/title-link.rb
tdiary-blogkit-5.1.3 plugin/title-link.rb
tdiary-blogkit-5.1.2 plugin/title-link.rb
tdiary-blogkit-5.1.1 plugin/title-link.rb
tdiary-blogkit-5.1.0 plugin/title-link.rb
tdiary-blogkit-5.0.13 plugin/title-link.rb
tdiary-blogkit-5.0.12 plugin/title-link.rb
tdiary-blogkit-5.0.11 plugin/title-link.rb
tdiary-blogkit-5.0.10 plugin/title-link.rb
tdiary-blogkit-5.0.9 plugin/title-link.rb
tdiary-blogkit-5.0.8 plugin/title-link.rb