File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11module ApplicationHelper
2+ def meta_title
3+ return content_for ( :meta_title ) if content_for? ( :meta_title )
4+ return "#{ content_for ( :title ) } - Hackorum" if content_for? ( :title )
5+
6+ "Hackorum"
7+ end
8+
9+ def meta_description
10+ return content_for ( :meta_description ) if content_for? ( :meta_description )
11+
12+ "PostgreSQL Hackers Archive"
13+ end
14+
15+ def meta_image_url
16+ return content_for ( :meta_image ) if content_for? ( :meta_image )
17+
18+ absolute_url ( "/icon.png" )
19+ end
20+
21+ def meta_url
22+ return content_for ( :meta_url ) if content_for? ( :meta_url )
23+ return "" unless respond_to? ( :request ) && request
24+
25+ request . original_url
26+ end
27+
28+ def meta_type
29+ return content_for ( :meta_type ) if content_for? ( :meta_type )
30+
31+ "website"
32+ end
33+
34+ def twitter_card
35+ return content_for ( :twitter_card ) if content_for? ( :twitter_card )
36+
37+ "summary"
38+ end
39+
40+ def absolute_url ( path )
41+ return path if path . start_with? ( "http://" , "https://" )
42+ return "" unless respond_to? ( :request ) && request
43+
44+ URI . join ( request . base_url + "/" , path . sub ( %r{\A /+} , "" ) ) . to_s
45+ end
46+
247 # Smart time display: relative for recent, absolute for old
348 def smart_time_display ( time )
449 return "" if time . nil?
Original file line number Diff line number Diff line change 11doctype html
22html data-theme =" light"
33 head
4- title
5- - if content_for?(:title )
6- = " #{ content_for(:title ) } - Hackorum"
7- - else
8- = " Hackorum"
4+ title = meta_title
5+ meta [name =" description" content= meta_description]
6+ meta [property =" og:site_name" content= " Hackorum" ]
7+ meta [property =" og:title" content= meta_title]
8+ meta [property =" og:description" content= meta_description]
9+ meta [property =" og:url" content= meta_url]
10+ meta [property =" og:image" content= meta_image_url]
11+ meta [property =" og:image:alt" content= meta_title]
12+ meta [property =" og:type" content= meta_type]
13+ meta [name =" twitter:card" content= twitter_card]
14+ meta [name =" twitter:title" content= meta_title]
15+ meta [name =" twitter:description" content= meta_description]
16+ meta [name =" twitter:image" content= meta_image_url]
917 meta [name =" viewport" content= " width=device-width,initial-scale=1" ]
1018 meta [name =" apple-mobile-web-app-capable" content= " yes" ]
1119 meta [name =" mobile-web-app-capable" content= " yes" ]
You can’t perform that action at this time.
0 commit comments