diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-05-12 15:26:46 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-05-12 15:26:46 -0400 |
commit | c2cfdb29e5530c46bffda39204adb29a247b6f52 (patch) | |
tree | 8f7d467ed8132ed9829051d8a425ae3e5865fbf3 /app/controllers/streams_controller.rb | |
parent | 64cfb748064971a6bfdc648a1ee41ba0d84207bc (diff) | |
download | thoughts-c2cfdb29e5530c46bffda39204adb29a247b6f52.tar.gz thoughts-c2cfdb29e5530c46bffda39204adb29a247b6f52.tar.bz2 thoughts-c2cfdb29e5530c46bffda39204adb29a247b6f52.zip |
Added opengraph info for stream pages
Diffstat (limited to 'app/controllers/streams_controller.rb')
-rw-r--r-- | app/controllers/streams_controller.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb index aa81ab1..ec4cee8 100644 --- a/app/controllers/streams_controller.rb +++ b/app/controllers/streams_controller.rb | |||
@@ -1,4 +1,5 @@ | |||
1 | class StreamsController < ApplicationController | 1 | class StreamsController < ApplicationController |
2 | include ApplicationHelper | ||
2 | 3 | ||
3 | def index | 4 | def index |
4 | @streams = Stream.order(latest_post_at: :desc).paginate(page: params[:page], per_page: 10) | 5 | @streams = Stream.order(latest_post_at: :desc).paginate(page: params[:page], per_page: 10) |
@@ -7,6 +8,19 @@ class StreamsController < ApplicationController | |||
7 | def show | 8 | def show |
8 | @stream = Stream.find_by_slug(params[:slug]) | 9 | @stream = Stream.find_by_slug(params[:slug]) |
9 | @updates = @stream.updates.paginate(page: params[:page], per_page: 10) | 10 | @updates = @stream.updates.paginate(page: params[:page], per_page: 10) |
11 | |||
12 | body = stripped_markdown(@stream.body) | ||
13 | |||
14 | set_meta_tags(og: { | ||
15 | title: @stream.title, | ||
16 | type: "article", | ||
17 | description: body[0, 299], | ||
18 | url: stream_url(@stream, host: "www.fourisland.com"), | ||
19 | article: { | ||
20 | published_time: @stream.created_at.iso8601, | ||
21 | modified_time: @stream.latest_post_at.iso8601 | ||
22 | } | ||
23 | }) | ||
10 | end | 24 | end |
11 | 25 | ||
12 | end | 26 | end |