Module: Octopress::Social::GitHub
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
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
- #github_profile_link ⇒ Object
- #profile_link_text ⇒ Object
- #profile_link_title ⇒ Object
- #set_config(site) ⇒ Object
- #username(item = {}) ⇒ Object
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
6 7 8 |
# File 'lib/octopress-social/github.rb', line 6 def config @config end |
Instance Method Details
#github_profile_link ⇒ Object
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 |
#profile_link_text ⇒ Object
27 28 29 |
# File 'lib/octopress-social/github.rb', line 27 def profile_link_text config['profile_link_text'].sub(':username', username) end |
#profile_link_title ⇒ Object
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 |