Skip to content

Commit

Permalink
Merge pull request #1173 from weather-gov/lmm/818-metatag
Browse files Browse the repository at this point in the history
Add and configure metatag module
  • Loading branch information
loganmcdonald-noaa authored May 9, 2024
2 parents 5b75ba8 + 91fa3b9 commit e13315c
Show file tree
Hide file tree
Showing 26 changed files with 277 additions and 7 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"drupal/core-recommended": "^10.2",
"drupal/key_asymmetric": "^1.1",
"drupal/log_stdout": "^1.5",
"drupal/metatag": "^2.0",
"drupal/new_relic_rpm": "^2.1",
"drupal/s3fs": "^3.1",
"drupal/samlauth": "^3.9",
Expand Down
71 changes: 69 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions docs/dev/contributed-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ _Added in May 2024_

We added this module to enable us to forward Drupal Watchdog logs to `stdout` and `stderr` instead of Drupal's internal logging database. This improves the developer experience by making logs easier to access and it allows cloud.gov to capture the logs and present them in its logging interface, which is easier to get around than Drupal's.

### [`metatag`](https://www.drupal.org/project/metatag)

_Added in May 2024_

We added metatag in order to allow content managers and administrators to customize our metatags for social share across content types on the site. We enabled the main module and other extensions for OpenGraph, Twitter, and Favicon management.

### [`new_relic_rpm`](https://www.drupal.org/project/new_relic_rpm)

_Added in January 2024_
Expand Down
11 changes: 11 additions & 0 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ if [ -z "${VCAP_SERVICES:-}" ]; then
exit 1;
fi

export home="/home/vcap"
dirs=( "${home}/private" "${home}/web/sites/default/files" )

for dir in $dirs; do
if [ ! -d $dir ]; then
echo "Creating ${dir} directory ... "
mkdir $dir
chown vcap. $dir
fi
done

# Create files for SAML auth
export home="/home/vcap"
export app_path="${home}/app"
Expand Down
10 changes: 10 additions & 0 deletions web/config/sync/core.entity_form_display.node.page.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ status: true
dependencies:
config:
- field.field.node.page.body
- field.field.node.page.field_meta_tags
- node.type.page
module:
- metatag
- path
- text
_core:
Expand All @@ -31,6 +33,14 @@ content:
region: content
settings: { }
third_party_settings: { }
field_meta_tags:
type: metatag_firehose
weight: 121
region: content
settings:
sidebar: false
use_details: true
third_party_settings: { }
path:
type: path
weight: 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ status: true
dependencies:
config:
- field.field.node.page.body
- field.field.node.page.field_meta_tags
- node.type.page
module:
- metatag
- text
- user
_core:
Expand All @@ -22,6 +24,13 @@ content:
third_party_settings: { }
weight: 100
region: content
field_meta_tags:
type: metatag_empty_formatter
label: above
settings: { }
third_party_settings: { }
weight: 102
region: content
links:
weight: 101
region: content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.page.body
- field.field.node.page.field_meta_tags
- node.type.page
module:
- text
Expand All @@ -27,4 +28,5 @@ content:
links:
weight: 101
region: content
hidden: { }
hidden:
field_meta_tags: true
4 changes: 4 additions & 0 deletions web/config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ module:
log_stdout: 0
menu_link_content: 0
menu_ui: 0
metatag: 0
metatag_favicons: 0
metatag_open_graph: 0
metatag_twitter_cards: 0
mysql: 0
node: 0
options: 0
Expand Down
21 changes: 21 additions & 0 deletions web/config/sync/field.field.node.page.field_meta_tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
uuid: db8693be-2b0c-4e82-8ed8-e58002ab1411
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_meta_tags
- node.type.page
module:
- metatag
id: node.page.field_meta_tags
field_name: field_meta_tags
entity_type: node
bundle: page
label: 'Meta tags'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: metatag
19 changes: 19 additions & 0 deletions web/config/sync/field.storage.node.field_meta_tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
uuid: 2c9730c2-51be-4a23-b173-dc689adf2cd1
langcode: en
status: true
dependencies:
module:
- metatag
- node
id: node.field_meta_tags
field_name: field_meta_tags
entity_type: node
type: metatag
settings: { }
module: metatag
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
12 changes: 12 additions & 0 deletions web/config/sync/metatag.metatag_defaults.403.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
uuid: 57bcbb81-1862-40c1-be6a-1f00c6a5cc3d
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: RDCkFL0NDt75Gwioooxo1iuA1S50xTVsBOgX__c6wTw
id: '403'
label: '403 access denied'
tags:
robots: noindex
canonical_url: '[site:url]'
shortlink: '[site:url]'
11 changes: 11 additions & 0 deletions web/config/sync/metatag.metatag_defaults.404.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
uuid: 1e90b9ac-5c82-4e3d-a58e-7693f9538e6c
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: puBstSLDz8mbaWU357zaqQDBGMGsJzG0j-TQNQkjg20
id: '404'
label: '404 page not found'
tags:
canonical_url: '[site:url]'
shortlink: '[site:url]'
12 changes: 12 additions & 0 deletions web/config/sync/metatag.metatag_defaults.front.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
uuid: fc7f80de-7774-43c4-820b-8dc5a19b5751
langcode: en
status: false
dependencies: { }
_core:
default_config_hash: 1noCXlegCr5HFehQRF1ViXy1jhU1jZ_sNN99a8Sj5jo
id: front
label: 'Front page'
tags:
canonical_url: '[site:url]'
shortlink: '[site:url]'
title: '[site:name]'
24 changes: 24 additions & 0 deletions web/config/sync/metatag.metatag_defaults.global.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
uuid: 8ef3ecdf-ffe1-4413-829f-27bb7abbac3c
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: sL588ui1E_8-2c_UupwyYxcqX2OVyMFp3HTLbbFqvPc
id: global
label: Global
tags:
canonical_url: '[current-page:url]'
description: 'The National Weather Service provides weather, water and climate data, forecasts, warnings, and impact-based decision support services to protect life and property, and enhance the national economy.'
icon_16x16: /themes/new_weather_theme/assets/images/weather/favicons/favicon-16x16.ico
icon_32x32: /themes/new_weather_theme/assets/images/weather/favicons/favicon-32x32.ico
icon_96x96: /themes/new_weather_theme/assets/images/weather/favicons/favicon-96x96.ico
og_description: 'The National Weather Service provides weather, water and climate data, forecasts, warnings, and impact-based decision support services to protect life and property, and enhance the national economy.'
og_image: /themes/new_weather_theme/assets/images/weather/nws-meta-og.png
og_site_name: '[site:name]'
og_type: website
og_url: '[site:url]'
shortcut_icon: /themes/new_weather_theme/assets/images/weather/favicons/nws-favicon.ico
twitter_cards_description: 'The National Weather Service provides weather, water and climate data, forecasts, warnings, and impact-based decision support services to protect life and property, and enhance the national economy.'
twitter_cards_image: /themes/new_weather_theme/assets/images/weather/nws-meta-og.png
twitter_cards_site: '@nws'
twitter_cards_type: summary_large_image
12 changes: 12 additions & 0 deletions web/config/sync/metatag.metatag_defaults.node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
uuid: a5b55f38-e0a5-4e53-914d-738a84c65690
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: rpwvgyEURXLz_JjgMCrkS1rUv-0k3L79BpO-ReN7fDI
id: node
label: Content
tags:
title: '[node:title] | [site:name]'
description: '[node:summary]'
canonical_url: '[node:url]'
12 changes: 12 additions & 0 deletions web/config/sync/metatag.metatag_defaults.taxonomy_term.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
uuid: 580a7789-6cae-4605-beec-c01af5ab2afb
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: 92bXZdyYJ5xqukdfmGRr_CYcwm1vfuS8b8aJ7X_G7E0
id: taxonomy_term
label: 'Taxonomy term'
tags:
canonical_url: '[term:url]'
description: '[term:description]'
title: '[term:name] | [site:name]'
12 changes: 12 additions & 0 deletions web/config/sync/metatag.metatag_defaults.user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
uuid: bb3cd54b-3559-4b27-b4cc-4509bb71c099
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: MvQPTbQx0Vxwy0ordSHyixdZmLCMpvMdLD69dlwkrKc
id: user
label: User
tags:
canonical_url: '[user:url]'
description: '[site:name]'
title: '[user:display-name] | [site:name]'
25 changes: 25 additions & 0 deletions web/config/sync/metatag.settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
_core:
default_config_hash: tKLBW2GXZVLFXqS9QgLyfTuxCLc1u_quKPQLtCia-Bw
entity_type_groups:
node:
page:
basic: basic
open_graph: open_graph
twitter_cards: twitter_cards
wfo_promo:
basic: basic
open_graph: open_graph
twitter_cards: twitter_cards
separator: ','
tag_trim_method: beforeValue
use_maxlength: true
tag_trim_maxlength:
metatag_maxlength_title: null
metatag_maxlength_description: null
metatag_maxlength_abstract: null
metatag_maxlength_og_site_name: null
metatag_maxlength_og_title: null
metatag_maxlength_og_description: null
metatag_maxlength_twitter_cards_title: null
metatag_maxlength_twitter_cards_description: null
tag_scroll_max_height: ''
2 changes: 1 addition & 1 deletion web/config/sync/system.site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ _core:
default_config_hash: l58O_yEXSo-SeJi19LXdzTU1tNJG3lmnIhCitRkM1tk
langcode: en
uuid: a8610938-ba2d-4f34-a473-bac1d92b4311
name: Weather.gov
name: beta.weather.gov
mail: admin@noaa.gov
slogan: 'National Weather Service'
page:
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<title>{% if weather.place %}{{ weather.place }} | {% endif %}{{ head_title|safe_join(' | ') }}</title>
<css-placeholder token="{{ placeholder_token }}">
<js-placeholder token="{{ placeholder_token }}">
<link rel="icon" type="image/png" href="/{{ directory }}/assets/images/weather/favicons/noaa-favicon.ico" />
<link rel="icon" type="image/png" href="/{{ directory }}/assets/images/weather/favicons/nws-favicon.ico" />
</head>
<body{{ attributes.addClass(body_classes) }}>
{#
Expand Down
Loading

0 comments on commit e13315c

Please sign in to comment.