-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from chonla/main
Custom meta tags and title
- Loading branch information
Showing
7 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,29 @@ | ||
module ApplicationHelper | ||
def custom_title(title) | ||
"#{title} #{default_meta_tags[:separator]} #{default_meta_tags[:site]}" | ||
end | ||
|
||
def default_meta_tags | ||
{ | ||
site: 'CDMM', | ||
title: 'Continuous Delivery Maturity Model', | ||
reverse: true, | ||
separator: '|', | ||
description: 'Continuous Delivery Maturity Assessment Form', | ||
keywords: 'action, horror, drama', | ||
canonical: request.original_url, | ||
noindex: !Rails.env.production?, | ||
icon: [ | ||
# { href: image_url('box.svg'), type: 'image/svg+xml' }, | ||
# { href: image_url('icon.jpg'), rel: 'apple-touch-icon', sizes: '180x180', type: 'image/jpg' }, | ||
], | ||
og: { | ||
site_name: 'CDMM', | ||
title: 'Continuous Delivery Maturity Model', | ||
description: 'The Continuous Delivery Maturity Assessment Form', | ||
type: 'website', | ||
url: request.original_url, | ||
} | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
<% | ||
set_meta_tags( | ||
title: @table[:title], | ||
description: @table[:title], | ||
og: { | ||
title: @table[:title], | ||
description: @table[:title] | ||
} | ||
) | ||
%> | ||
|
||
<div class="w-full"> | ||
<%= render "cdmm_form", table: @table %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# frozen_string_literal: true | ||
|
||
# Use this setup block to configure all options available in MetaTags. | ||
MetaTags.configure do |config| | ||
# How many characters should the title meta tag have at most. Default is 70. | ||
# Set to nil or 0 to remove limits. | ||
# config.title_limit = 70 | ||
|
||
# When true, site title will be truncated instead of title. Default is false. | ||
# config.truncate_site_title_first = false | ||
|
||
# Add HTML attributes to the <title> HTML tag. Default is {}. | ||
config.title_tag_attributes = { id: "page_title" } | ||
|
||
# Natural separator when truncating. Default is " " (space character). | ||
# Set to nil to disable natural separator. | ||
# This also allows you to use a whitespace regular expression (/\s/) or | ||
# a Unicode space (/\p{Space}/). | ||
# config.truncate_on_natural_separator = " " | ||
|
||
# Maximum length of the page description. Default is 300. | ||
# Set to nil or 0 to remove limits. | ||
# config.description_limit = 300 | ||
|
||
# Maximum length of the keywords meta tag. Default is 255. | ||
# config.keywords_limit = 255 | ||
|
||
# Default separator for keywords meta tag (used when an Array passed with | ||
# the list of keywords). Default is ", ". | ||
# config.keywords_separator = ', ' | ||
|
||
# When true, keywords will be converted to lowercase, otherwise they will | ||
# appear on the page as is. Default is true. | ||
# config.keywords_lowercase = true | ||
|
||
# When true, the output will not include new line characters between meta tags. | ||
# Default is false. | ||
# config.minify_output = false | ||
|
||
# When false, generated meta tags will be self-closing (<meta ... />) instead | ||
# of open (`<meta ...>`). Default is true. | ||
# config.open_meta_tags = true | ||
|
||
# List of additional meta tags that should use "property" attribute instead | ||
# of "name" attribute in <meta> tags. | ||
# config.property_tags.push( | ||
# 'x-hearthstone:deck', | ||
# ) | ||
end |