Class: Jekyll::PostLink
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::PostLink
- Defined in:
- lib/ext.rb
Instance Method Summary collapse
-
#initialize(tag_name, text, tokens) ⇒ PostLink
constructor
A new instance of PostLink.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, text, tokens) ⇒ PostLink
Returns a new instance of PostLink.
144 145 146 147 148 149 150 151 |
# File 'lib/ext.rb', line 144 def initialize(tag_name, text, tokens) @linkTitle = text.strip # page = Jekyll::sites[0].pages.find { |pg| # pg.name == @linkTitle # } end |
Instance Method Details
#render(context) ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/ext.rb', line 153 def render(context) # puts 'zzaa',context['site']['posts'][1].data,"zz" url = $g_title_link[@linkTitle] if url == nil || url == LOADINGFLG $g_title_link[@linkTitle] = LOADINGFLG return "`#{@linkTitle} Not Found`" else if $g_config["baseurl"] && $g_config["baseurl"].length > 0 return "[#{@linkTitle}](#{$g_config["baseurl"]}/#{url})" else return "[#{@linkTitle}](#{url})" end end end |