Module: Octopress::Social

Extended by:
Social
Included in:
Social
Defined in:
lib/octopress-social.rb,
lib/octopress-social/email.rb,
lib/octopress-social/disqus.rb,
lib/octopress-social/github.rb,
lib/octopress-social/twitter.rb,
lib/octopress-social/version.rb,
lib/octopress-social/facebook.rb,
lib/octopress-social/google-plus.rb

Defined Under Namespace

Modules: Disqus, Email, Facebook, GitHub, GooglePlus, Twitter

Constant Summary collapse

VERSION =
"1.4.5"

Instance Method Summary collapse

Instance Method Details

#full_url(site, item) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/octopress-social.rb', line 17

def full_url(site, item)
  unless root = site['url']
    abort "Site url not configured. Please set url: http://your-site.com in Jekyll configuration file."
  end

  File.join(root, site['baseurl'], item['url'].sub('index.html', ''))
end

#item(context, input) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/octopress-social.rb', line 25

def item(context, input)
  if item = context[input]
    item['context'] = input
  elsif item = context['post']
    item['context'] = 'post'
  else
    item = context['page']
    item['context'] = 'page'
  end

  item
end