Module: Octopress::Social::GitHub

Extended by:
GitHub
Included in:
GitHub
Defined in:
lib/octopress-social/github.rb

Defined Under Namespace

Classes: Tag

Constant Summary collapse

DEFAULTS =
{
  'username'            => nil,
  'profile_link_text'   => ':username on GitHub',
  'profile_link_title'  => ':username on GitHub',
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config.



6
7
8
# File 'lib/octopress-social/github.rb', line 6

def config
  @config
end

Instance Method Details



35
36
37
38
39
40
# File 'lib/octopress-social/github.rb', line 35

def github_profile_link
  %Q{<a
    class="github-profile-link"
    href="https://github.com/#{username.sub('@', '')}"
    title="#{profile_link_title}">#{profile_link_text}</a>}
end


27
28
29
# File 'lib/octopress-social/github.rb', line 27

def profile_link_text
  config['profile_link_text'].sub(':username', username)
end


31
32
33
# File 'lib/octopress-social/github.rb', line 31

def profile_link_title
  config['profile_link_title'].sub(':username', username)
end

#set_config(site) ⇒ Object



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

def set_config(site)
  @config ||= begin
    config = site['octopress_social'] || site
    DEFAULTS.merge(config['github'] || {})
  end
end

#username(item = {}) ⇒ Object



23
24
25
# File 'lib/octopress-social/github.rb', line 23

def username(item={})
  config['username'] || ''
end