Module: Octopress::LinkBlog
- Defined in:
- lib/octopress-linkblog.rb,
lib/octopress-linkblog/configuration.rb
Defined Under Namespace
Modules: Configuration
Classes: PageHook, PostHook, SiteHook
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
10
11
12
|
# File 'lib/octopress-linkblog.rb', line 10
def self.config
LinkBlog::Configuration.config
end
|
.post_link(title, url, classnames) ⇒ Object
93
94
95
|
# File 'lib/octopress-linkblog.rb', line 93
def self.post_link(title, url, classnames)
"<a href='#{url}' class='#{classnames}'>#{title}</a>"
end
|
.post_title_html(title, config) ⇒ Object
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/octopress-linkblog.rb', line 70
def self.post_title_html(title, config)
title = unorphan(title)
return title if !config['marker']
marker = "<span class='post-marker post-marker-#{config['marker_position']}'>#{config['marker']}</span>"
position = config['marker_position']
if config['marker_position'] == 'before'
title = "#{marker} #{title}"
else
title = "#{title} #{marker}"
end
title
end
|
.post_title_link(data) ⇒ Object
87
88
89
90
91
|
# File 'lib/octopress-linkblog.rb', line 87
def self.post_title_link(data)
classname = "article-link"
classname << " linkpost" if data['linkpost']
post_link(data['title_html'], data['title_url'], classname)
end
|
.post_title_text(title, config) ⇒ Object
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/octopress-linkblog.rb', line 97
def self.post_title_text(title, config)
return title if !config['marker']
position = config['marker_position']
if config['marker_position'] == 'before'
"#{config['marker']} #{title}"
else
"#{title} #{config['marker']}"
end
end
|
.unorphan(title) ⇒ Object
62
63
64
65
66
67
68
|
# File 'lib/octopress-linkblog.rb', line 62
def self.unorphan(title)
if LinkBlog.config['unorphan']
title.sub(/\s+(\S+)\s*$/, ' \1')
else
title
end
end
|