Skip to content

Commit 81d50e8

Browse files
authored
DOP-1882: add canonical link to landing pages (#63)
1 parent 13df516 commit 81d50e8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

gen_landings.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os.path
44
from sys import argv
55

6-
Site = collections.namedtuple('Site', ('input_path', 'output_path', 'title', 'search_properties'))
6+
Site = collections.namedtuple('Site', ('input_path', 'output_path', 'title', 'search_properties', 'canonical'))
77

88
# Build directory name will be the name of Makefile recipe
99
BUILD_DIR = argv[1]
@@ -12,11 +12,13 @@
1212
Site('./src/html/cloud.html',
1313
os.path.join(BUILD_DIR, 'cloud', 'index.html'),
1414
'Cloud Products — MongoDB Documentation',
15-
'atlas-master,mms-onprem-current,mms-cloud-master,stitch-master'),
15+
'atlas-master,mms-onprem-current,mms-cloud-master,stitch-master',
16+
'cloud'),
1617
Site('./src/html/tools.html',
1718
os.path.join(BUILD_DIR, 'tools', 'index.html'),
1819
'MongoDB Tools — MongoDB Documentation',
19-
'bi-connector-current,spark-connector-current,compass-master'),
20+
'bi-connector-current,spark-connector-current,compass-master',
21+
'tools'),
2022
]
2123

2224

@@ -37,6 +39,7 @@ def build_individual(template: str, site: Site) -> None:
3739
file_contents = file_contents.replace('{projectTitle}', project_title)
3840
file_contents = file_contents.replace('{searchProperties}', site.search_properties)
3941
file_contents = file_contents.replace('{body}', html)
42+
file_contents = file_contents.replace('{canonical}', site.canonical)
4043

4144
# Write the output file
4245
with open(site.output_path, 'w') as out_file:

src/html/_layout.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
<link rel="stylesheet" href="css/landing.css" />
1414
<link rel="stylesheet" href="css/navbar.min.css?t=nocache" />
1515
<link rel="stylesheet" href="css/feedback.min.css" />
16-
16+
<link rel="canonical" href="https://docs.mongodb.com/{canonical}/" />
17+
1718
<script>
1819
window['_fs_debug'] = false;
1920
window['_fs_host'] = 'fullstory.com';

0 commit comments

Comments
 (0)