Skip to content

Commit 2ff3a55

Browse files
authored
fix post breadcrumbs for supported languages (GoogleChrome#1397)
* fix tag breadcrumbs for 'es' * add missing pages for other langs * render tags to locale * add tag translation
1 parent d7e95f4 commit 2ff3a55

40 files changed

Lines changed: 445 additions & 3 deletions

site/_data/i18n/tags.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ devtools:
9090

9191
new-in-devtools:
9292
en: What's New in DevTools
93+
es: Qué hay de nuevo en DevTools
94+
ja: DevTools の新機能
95+
ko: DevTools 의 새로운 기능
96+
ru: Новинки DevTools
97+
zh: DevTools 新功能
98+
pt: O que há de novo no DevTools
9399

94100
devtools-engineering:
95101
en: DevTools Engineering

site/_utils/tag-11tydata.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ module.exports = locale => ({
3737
}
3838
return key;
3939
},
40+
permalink: data => {
41+
// Tag links appear without a locale, since it's a single shared collection.
42+
// Be sure to render in the right locale.
43+
return `/${locale}/${data.permalink}`;
44+
},
4045
},
4146
pagination: {
4247
/**

site/en/blog/index.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ description: ''
44
permalink: '{{locale}}/blog/{% if pagination.pageNumber > 0 %}{{ pagination.pageNumber + 1 }}/{% endif %}index.html'
55
layout: 'layouts/blog-landing.njk'
66
type: landing
7-
i18n:
8-
headings:
9-
latest-news: 'Latest Chrome news'
107
pagination:
118
data: collections.blog-en
129
size: 24

site/es/blog/blog.11tydata.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
type: 'blogPost',
3+
};

site/es/blog/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: 'Blog'
3+
description: ''
4+
permalink: '{{locale}}/blog/{% if pagination.pageNumber > 0 %}{{ pagination.pageNumber + 1 }}/{% endif %}index.html'
5+
layout: 'layouts/blog-landing.njk'
6+
type: landing
7+
pagination:
8+
data: collections.blog-es
9+
size: 24
10+
---

site/es/tags/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: 'Tags'
3+
description: 'Find blog posts tagged to a certain feature'
4+
permalink: '{{locale}}/tags/index.html'
5+
layout: 'layouts/tags-landing.njk'
6+
---

site/es/tags/tag/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: 'Tags'
3+
permalink: '{{paged.permalink}}'
4+
layout: 'layouts/tag-landing.njk'
5+
pagination:
6+
data: collections.tags
7+
size: 1
8+
alias: paged
9+
resolve: values
10+
---

site/es/tags/tag/tag.11tydata.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
const {locale} = require('../../es.11tydata');
18+
const tag11tyData = require('../../../_utils/tag-11tydata');
19+
20+
module.exports = tag11tyData(locale);

site/es/tags/tags.11tydata.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
const {locale} = require('../es.11tydata');
18+
const tags11tyData = require('../../_utils/tags-11tydata');
19+
20+
module.exports = tags11tyData(locale);

site/ja/blog/blog.11tydata.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
type: 'blogPost',
3+
};

0 commit comments

Comments
 (0)