Skip to content

Commit

Permalink
meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Oct 13, 2023
1 parent e35e36a commit 9224809
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
class HomeController < ApplicationController
def index

set_meta_tags(
title: "Rauversion",
description: "Stream Rauversion.",
image: helpers.image_url("gritt-zheng-uCUkq5H0_Y0-unsplash.jpg")
)

@artists = User.artists
.with_attached_avatar
.order("id desc").limit(12)
Expand Down
11 changes: 11 additions & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class UsersController < ApplicationController

def show
get_tracks
get_meta_tags
@as = :track
@section = "tracks/track_item"
end
Expand Down Expand Up @@ -58,6 +59,16 @@ def albums

private

def get_meta_tags
set_meta_tags(
# keywords: @user.tags.join(", "),
# url: Routes.articles_show_url(socket, :show, track.id),
title: "#{@user.username} on Rauversion",
description: "Stream #{@user.username} on Rauversion.",
image: @user.avatar_url(:small)
)
end

def get_tracks
# @collection = @user.tracks.page(params[:page]).per(2)
@collection = if current_user
Expand Down
2 changes: 1 addition & 1 deletion app/views/insights/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<div class="flex-shrink-0">

<img class="rounded-sm"
src="https://flagcdn.com/w40/<%= location.country.downcase %>.png"
src="https://flagcdn.com/w40/<%= location&.country&.downcase %>.png"
alt="">

</div>
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<html class="dark">
<head>
<title>RauversionRor</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
Expand Down

0 comments on commit 9224809

Please sign in to comment.