Class: Lvr::Template::Tags::Footer

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/lvr/template/tags.rb

Overview

A tag that renders the footer badges.

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, text, tokens) ⇒ Footer

Returns a new instance of Footer.



12
# File 'lib/lvr/template/tags.rb', line 12

def initialize(tag_name, text, tokens) = super

Instance Method Details

#render(context) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/lvr/template/tags.rb', line 14

def render(context)
  project_title = CGI.escape(context['project']['title'])
  github_repository_link = CGI.escape(context['github']['repository']['link'])
  "    [![Share on X](https://img.shields.io/badge/share%20on-x-03A9F4?logo=x)](https://x.com/intent/post?url=\#{github_repository_link}&text=\#{project_title})\n    [![Share on Reddit](https://img.shields.io/badge/share%20on-reddit-red?logo=reddit)](https://reddit.com/submit?url=\#{github_repository_link}&title=\#{project_title})\n    [![Share on Hacker News](https://img.shields.io/badge/share%20on-hn-orange?logo=ycombinator)](https://news.ycombinator.com/submitlink?u=\#{github_repository_link}&t=\#{project_title})\n    [![Share on Facebook](https://img.shields.io/badge/share%20on-fb-1976D2?logo=facebook)](https://www.facebook.com/sharer/sharer.php?u=\#{github_repository_link})\n    [![Share on LinkedIn](https://img.shields.io/badge/share%20on-linkedin-3949AB?logo=linkedin)](https://www.linkedin.com/sharing/share-offsite/?url=\#{github_repository_link})\n  EOF\nend\n".chomp