recipe.yml
7.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: SEO Tools
description: Adds common search engine optimisation tools such as meta tags, XML sitemap, robots.txt management and more.
type: Drupal CMS
recipes:
- core/recipes/image_media_type
install:
- field_group
- focal_point
- layout_builder
- menu_link_content
- metatag
- metatag_open_graph
- metatag_twitter_cards
- node
- robotstxt
- seo_checklist
- simple_sitemap
- sitemap
- token_or
- yoast_seo
config:
# Treat all field storages strictly, since they influence the database layout.
strict:
- field.storage.node.field_seo_analysis
- field.storage.node.field_seo_description
- field.storage.node.field_seo_image
- field.storage.node.field_seo_title
import:
metatag:
# Exclude Global, Front and Node as we create those in the config folder.
- metatag.metatag_defaults.403.yml
- metatag.metatag_defaults.404.yml
- metatag.metatag_defaults.taxonomy_term.yml
- metatag.metatag_defaults.user.yml
simple_sitemap: '*'
actions:
# Add SEO fields to all content types that are installed.
field.storage.node.field_seo_analysis:
addToAllBundles:
label: 'SEO analysis'
description: 'Pick the main keyword this page is about.'
field.storage.node.field_seo_description:
addToAllBundles:
label: 'SEO description'
description: 'Write a description for search engines and social media sites.'
field.storage.node.field_seo_image:
addToAllBundles:
label: 'SEO image'
description: 'Upload an image to be used when the page is shared on social media sites.'
# Ensure all instances of `field_seo_image` reference image media.
field.field.node.*.field_seo_image:
setSettings:
handler: 'default:media'
handler_settings:
target_bundles:
image: image
field.storage.node.field_seo_title:
addToAllBundles:
label: 'SEO title'
description: 'Use this field to overwrite the default HTML page title for SEO.'
# Configure the fields on the edit forms.
core.entity_form_display.node.*.default:
# Configure field group.
setThirdPartySettings:
- module: field_group
key: group_seo
value:
children:
- field_seo_title
- field_seo_description
- field_seo_image
- field_seo_analysis
label: 'Search Engine Optimization (SEO) Information'
region: content
parent_name: ''
weight: 50
format_type: details
format_settings:
classes: ''
show_empty_fields: false
id: group_seo
label_as_html: false
open: false
description: ''
required_fields: false
setComponents:
-
name: field_seo_analysis
options:
type: yoast_seo_widget
weight: 18
region: content
settings:
render_theme: NULL
render_view_mode: default
edit_title: 0
edit_description: 0
-
name: field_seo_description
options:
type: string_textarea
weight: 16
region: content
settings:
rows: 5
placeholder: ''
-
name: field_seo_image
options:
type: media_library_widget
weight: 17
region: content
settings:
media_types: { }
-
name: field_seo_title
options:
type: string_textfield
weight: 15
region: content
settings:
size: 60
placeholder: ''
robotstxt.settings:
# We add Drupal core's robots.txt and XML Sitemap.
simpleConfigUpdate:
content: |
#
# robots.txt
#
# This file is to prevent the crawling and indexing of certain parts
# of your site by web crawlers and spiders run by sites like Yahoo!
# and Google. By telling these "robots" where not to go on your site,
# you save bandwidth and server resources.
#
# This file will be ignored unless it is at the root of your host:
# Used: http://example.com/robots.txt
# Ignored: http://example.com/site/robots.txt
#
# For more information about the robots.txt standard, see:
# http://www.robotstxt.org/robots
User-agent: *
# CSS, JS, Images
Allow: /core/*.css$
Allow: /core/*.css?
Allow: /core/*.js$
Allow: /core/*.js?
Allow: /core/*.gif
Allow: /core/*.jpg
Allow: /core/*.jpeg
Allow: /core/*.png
Allow: /core/*.svg
Allow: /profiles/*.css$
Allow: /profiles/*.css?
Allow: /profiles/*.js$
Allow: /profiles/*.js?
Allow: /profiles/*.gif
Allow: /profiles/*.jpg
Allow: /profiles/*.jpeg
Allow: /profiles/*.png
Allow: /profiles/*.svg
# Directories
Disallow: /core/
Disallow: /profiles/
# Files
Disallow: /README.md
Disallow: /composer/Metapackage/README.txt
Disallow: /composer/Plugin/ProjectMessage/README.md
Disallow: /composer/Plugin/Scaffold/README.md
Disallow: /composer/Plugin/VendorHardening/README.txt
Disallow: /composer/Template/README.txt
Disallow: /modules/README.txt
Disallow: /sites/README.txt
Disallow: /themes/README.txt
# Paths (clean URLs)
Disallow: /admin/
Disallow: /comment/reply/
Disallow: /filter/tips
Disallow: /node/add/
Disallow: /search/
Disallow: /user/register
Disallow: /user/password
Disallow: /user/login
Disallow: /user/logout
Disallow: /media/oembed
Disallow: /*/media/oembed
# Paths (no clean URLs)
Disallow: /index.php/admin/
Disallow: /index.php/comment/reply/
Disallow: /index.php/filter/tips
Disallow: /index.php/node/add/
Disallow: /index.php/search/
Disallow: /index.php/user/password
Disallow: /index.php/user/register
Disallow: /index.php/user/login
Disallow: /index.php/user/logout
Disallow: /index.php/media/oembed
Disallow: /index.php/*/media/oembed
# XML sitemap
Sitemap: /sitemap.xml
sitemap.settings:
simpleConfigUpdate:
plugins.frontpage:
base_plugin: frontpage
enabled: true
weight: 0
settings:
title: 'Front page'
rss: /rss.xml
id: frontpage
provider: sitemap
plugins.menu:main:
base_plugin: menu
enabled: true
weight: 0
settings:
title: ''
show_disabled: false
id: 'menu:main'
provider: sitemap
system.performance:
simpleConfigUpdate:
# Ensure caching is on and set to 15 minutes for Lighthouse.
cache.page.max_age: 900
# Ensure CSS and JS are preprocessed.
css.preprocess: true
js.preprocess: true