Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 61089b0

Browse files
Splaktarjelbourn
authored andcommitted
fix: accessibility, SEO, typos, styling (#649)
add lang to html tag add robots.txt and sitemap.xml enable build-optimizer add Angular Material icon to footer fix typos use accent color on 2nd Get started button on homepage improve page title SEO better format copyright in footer add structured data, open graph, twitter to index preconnect and dns-prefetch fonts add apple-touch-icon links add site description, keywords, author, theme-color, Content-Type, etc. update favicons to Angular Material icons - support macOS touchbar and Windows 8/10 icons disable Angular CLI commonChunk refactor `main.scss` to `styles.scss` to be consistent with CLI
1 parent beaba0a commit 61089b0

35 files changed

+169
-67
lines changed

angular.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@
3636
"glob": "favicon.ico",
3737
"input": "src",
3838
"output": "/"
39-
}
39+
},
40+
"src/robots.txt",
41+
"src/sitemap.xml"
4042
],
4143
"styles": [
4244
{
43-
"input": "src/main.scss"
45+
"input": "src/styles.scss"
4446
},
4547
{
4648
"input": "src/highlightjs/material-light.scss"
@@ -70,6 +72,7 @@
7072
},
7173
"configurations": {
7274
"production": {
75+
"commonChunk": false,
7376
"optimization": true,
7477
"outputHashing": "all",
7578
"sourceMap": false,
@@ -115,7 +118,7 @@
115118
"scripts": [],
116119
"styles": [
117120
{
118-
"input": "src/main.scss"
121+
"input": "src/styles.scss"
119122
},
120123
{
121124
"input": "src/highlightjs/material-light.scss"

src/_app-theme.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
@import './styles/svg-theme';
1616
@import './styles/tables-theme';
1717

18-
1918
// Styles for the docs app that are based on the current theme.
2019
@mixin material-docs-app-theme($theme) {
2120
$primary: map-get($theme, primary);
@@ -61,3 +60,9 @@
6160
@include nav-bar-theme($theme);
6261
@include table-of-contents-theme($theme);
6362
}
63+
64+
// Define the light theme.
65+
$primary: mat-palette($mat-indigo);
66+
$accent: mat-palette($mat-pink, A200, A100, A400);
67+
68+
$theme: mat-light-theme($primary, $accent);

src/app/pages/homepage/homepage.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h2> Material Design components for Angular</h2>
2121
<div class="docs-homepage-promo-desc">
2222
<h2>Sprint from Zero to App</h2>
2323
<p>Hit the ground running with comprehensive, modern UI components that work across
24-
the web, mobile and desktop.</p>
24+
the web, mobile, and desktop.</p>
2525
</div>
2626
</div>
2727
<div class="docs-homepage-row docs-homepage-reverse-row">
@@ -44,7 +44,7 @@ <h2>Fast and Consistent</h2>
4444
</div>
4545
<div class="docs-homepage-promo-desc">
4646
<h2>Versatile</h2>
47-
<p>Themable, for when you need to stay on brand or just have a favorite color.
47+
<p>Themeable, for when you need to stay on brand or just have a favorite color.
4848
Accessible and internationalized so that all users are welcome.</p>
4949
</div>
5050
</div>
@@ -60,7 +60,7 @@ <h2>Optimized for Angular</h2>
6060
</div>
6161
</div>
6262
<div class="docs-homepage-bottom-start">
63-
<a mat-raised-button class="docs-button" routerLink="/guide/getting-started">Get started</a>
63+
<a mat-raised-button class="docs-button" routerLink="/guide/getting-started" color="accent">Get started</a>
6464
</div>
6565
</div>
6666

src/app/pages/page-title/page-title.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ import {Title} from '@angular/platform-browser';
77
@Injectable()
88
export class ComponentPageTitle {
99
_title = '';
10+
_originalTitle = 'Angular Material UI component library';
1011

1112
get title(): string { return this._title; }
1213

1314
set title(title: string) {
1415
this._title = title;
1516
if (title !== '') {
16-
title = `${title} | `;
17+
title = `${title} | Angular Material`;
18+
} else {
19+
title = this._originalTitle;
1720
}
18-
this.bodyTitle.setTitle(`${title}Angular Material`);
21+
this.bodyTitle.setTitle(title);
1922
}
2023

21-
constructor(private bodyTitle: Title) { }
22-
24+
constructor(private bodyTitle: Title) {}
2325
}

src/app/shared/footer/footer.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@
55
<div class="footer-logo">
66
<img class="docs-footer-angular-logo"
77
src="../../../assets/img/homepage/angular-white-transparent.svg"
8-
alt="angular">
8+
alt="Angular icon">
99
<span><a href="https://angular.io">Learn Angular</a></span>
1010
</div>
1111
</div>
1212

1313
<div class="docs-footer-version">
14+
<img class="angular-material-logo" src="../../../assets/img/angular-material-logo.svg"
15+
alt="Angular Material icon">
1416
<span class="version">Current Version: {{version}}</span>
1517
</div>
1618

1719
<div class="docs-footer-copyright">
18-
<span>Powered by Google ©2010-2019.</span>
19-
<a href="https://github.com/angular/components/blob/master/LICENSE">Code licensed under an MIT-style License.</a>
20-
<span>Documentation licensed under CC BY 4.0.</span>
20+
<div>
21+
<span>Powered by Google ©2010-2019.</span>
22+
<a href="https://github.com/angular/components/blob/master/LICENSE">Code licensed under an MIT-style License.</a>
23+
<span>Documentation licensed under CC BY 4.0.</span>
24+
</div>
2125
</div>
2226
</div>
2327
</footer>

src/app/shared/footer/footer.scss

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@
2020
}
2121

2222
.docs-footer-version {
23+
display: flex;
24+
justify-content: center;
25+
align-items: center;
2326
flex: 1;
24-
text-align: center;
27+
28+
.angular-material-logo {
29+
height: 40px;
30+
margin: 10px 0 10px 16px;
31+
}
32+
.version {
33+
margin: 0 40px;
34+
}
2535
}
2636

2737
.docs-footer-copyright {
@@ -30,7 +40,18 @@
3040
justify-content: flex-end;
3141
flex-direction: column;
3242
min-width: 225px;
33-
text-align: center;
43+
margin-top: 16px;
44+
45+
> div {
46+
display: flex;
47+
flex-direction: column;
48+
align-self: flex-end;
49+
text-align: center;
50+
}
51+
52+
@media (min-width: 885px) {
53+
margin-top: 0;
54+
}
3455
}
3556

3657
.docs-footer-logo span {
@@ -49,7 +70,8 @@ a {
4970
text-decoration: none;
5071
color: inherit;
5172

52-
&:hover {
73+
&:hover,
74+
&:focus {
5375
text-decoration: underline;
5476
}
5577
}
Lines changed: 1 addition & 0 deletions
Loading
Binary file not shown.
Loading
-1.63 KB
Binary file not shown.
-2.06 KB
Binary file not shown.
Loading
-2.87 KB
Binary file not shown.
-3.71 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-13.1 KB
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<browserconfig>
3+
<msapplication>
4+
<tile>
5+
<square150x150logo src="assets/img/favicons/mstile-150x150.png?v=8.2.3"/>
6+
<TileColor>#3f51b5</TileColor>
7+
</tile>
8+
</msapplication>
9+
</browserconfig>
-212 Bytes
Loading
-11 KB
Binary file not shown.
-875 Bytes
Loading
-4.72 KB
Binary file not shown.

src/assets/img/favicons/favicon.ico

0 Bytes
Binary file not shown.

src/assets/img/favicons/manifest.json

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,15 @@
55
"background_color": "#3F51B5",
66
"start_url": "/",
77
"display": "standalone",
8-
"orientation": "portrait",
98
"icons": [
109
{
11-
"src": "./android-chrome-36x36.png",
12-
"sizes": "36x36",
13-
"type": "image/png"
14-
},
15-
{
16-
"src": "./android-chrome-48x48.png",
17-
"sizes": "48x48",
18-
"type": "image/png"
19-
},
20-
{
21-
"src": "./android-chrome-72x72.png",
22-
"sizes": "72x72",
23-
"type": "image/png"
24-
},
25-
{
26-
"src": "./android-chrome-96x96.png",
27-
"sizes": "96x96",
28-
"type": "image/png"
29-
},
30-
{
31-
"src": "./android-chrome-144x144.png",
32-
"sizes": "144x144",
10+
"src": "/assets/img/favicons/android-chrome-192x192.png?v=8.2.3",
11+
"sizes": "192x192",
3312
"type": "image/png"
3413
},
3514
{
36-
"src": "./android-chrome-192x192.png",
37-
"sizes": "192x192",
15+
"src": "/assets/img/favicons/android-chrome-512x512.png?v=8.2.3",
16+
"sizes": "512x512",
3817
"type": "image/png"
3918
}
4019
]
1.39 KB
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/assets/img/site-preview.png

74.6 KB
Loading

src/favicon.ico

0 Bytes
Binary file not shown.

src/index.html

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,79 @@
11
<!doctype html>
2-
<html>
2+
<html lang="en-US">
33
<head>
44
<meta charset="utf-8">
5-
<title>Angular Material</title>
5+
<title>Angular Material UI component library</title>
6+
<link rel="canonical" href="https://material.angular.io">
67
<base href="/">
8+
9+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
10+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
711
<meta name="viewport" content="width=device-width, initial-scale=1">
812
<meta name="apple-mobile-web-app-capable" content="yes">
13+
<meta name="apple-mobile-web-app-status-bar-style" content="translucent">
914
<meta name="mobile-web-app-capable" content="yes">
15+
<meta name="theme-color" content="#3F50B5">
16+
<meta name="description" content="UI component infrastructure and Material Design components for mobile and desktop Angular web applications.">
17+
<meta name="keywords" content="angular, material design, material, angular material, web, ui, components, responsive, accessibility, typescript, css, mobile web, open source">
18+
<meta name="author" content="Angular Components Team">
19+
20+
<!--Twitter card metadata-->
21+
<meta name="twitter:card" content="summary" />
22+
<meta name="twitter:site" content="@Angular" />
23+
<meta name="twitter:creator" content="@Angular" />
24+
<meta name="twitter:title" content="Angular Material" />
25+
<meta name="twitter:description" content="UI component infrastructure and Material Design components for Angular web applications." />
26+
<meta name="twitter:image" content="https://material.angular.io/assets/img/site-preview.png">
27+
28+
<!--Facebook Open Graph-->
29+
<meta property="og:url" content="https://material.angular.io/" />
30+
<meta property="og:type" content="website" />
31+
<meta property="og:title" content="Angular Material" />
32+
<meta property="og:site_name" content="Angular Material">
33+
<meta property="og:locale" content="en_US">
34+
<meta property="og:description" content="UI component infrastructure and Material Design components for Angular web applications." />
35+
<meta property="og:image" content="https://material.angular.io/assets/img/site-preview.png" />
36+
<meta property="og:image:secure_url" content="https://material.angular.io/assets/img/site-preview.png" />
37+
<meta property="og:image:type" content="image/png">
38+
<meta property="og:image:width" content="1339" />
39+
<meta property="og:image:height" content="943" />
40+
41+
<link rel="apple-touch-icon" sizes="180x180" href="assets/img/favicons/apple-touch-icon.png?v=8.2.3">
42+
<link rel="icon" type="image/png" sizes="32x32" href="assets/img/favicons/favicon-32x32.png?v=8.2.3">
43+
<link rel="icon" type="image/png" sizes="16x16" href="assets/img/favicons/favicon-16x16.png?v=8.2.3">
44+
<link rel="manifest" href="assets/img/favicons/manifest.json?v=8.2.3">
45+
<link rel="mask-icon" href="assets/img/favicons/safari-pinned-tab.svg?v=8.2.3" color="#3f51b5">
46+
<link rel="shortcut icon" href="assets/img/favicons/favicon.ico?v=8.2.3">
47+
<meta name="msapplication-TileColor" content="#3f51b5">
48+
<meta name="msapplication-config" content="assets/img/favicons/browserconfig.xml?v=8.2.3">
49+
<meta name="theme-color" content="#3f51b5">
1050

11-
<link rel="icon" type="image/x-icon" href="favicon.ico">
12-
<link rel="icon" type="image/x-icon" href="assets/img/favicons/favicon.ico">
13-
<link rel="icon" type="image/png" href="assets/img/favicons/favicon-32x32.png" sizes="32x32">
14-
<link rel="icon" type="image/png" href="assets/img/favicons/favicon-194x194.png" sizes="194x194">
15-
<link rel="icon" type="image/png" href="assets/img/favicons/favicon-96x96.png" sizes="96x96">
16-
<link rel="icon" type="image/png" href="assets/img/favicons/favicon-16x16.png" sizes="16x16">
17-
<link rel="icon" type="image/png" href="assets/img/favicons/android-chrome-192x192.png"
18-
sizes="192x192">
19-
<link rel="manifest" href="assets/img/favicons/manifest.json">
2051
<link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=block" rel="stylesheet">
2152
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Mono:300&display=swap" rel="stylesheet">
53+
54+
<link rel="dns-prefetch" href="https://fonts.googleapis.com">
55+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
56+
<!--Structured Data-->
57+
<script type="application/ld+json">
58+
{
59+
"@context": "http://schema.org",
60+
"@type": "WebApplication",
61+
"name": "Angular Material",
62+
"description": "UI component infrastructure and Material Design components for Angular web applications.",
63+
"url": "https://material.angular.io",
64+
"image": "https://material.angular.io/assets/img/site-preview.png",
65+
"screenshot": "https://material.angular.io/assets/img/site-preview.png",
66+
"applicationCategory": "Software Documentation",
67+
"operatingSystem": "Android, Chrome OS, iOS, iPadOS, macOS, OS X, Linux, Windows",
68+
"author": {
69+
"@type": "Organization",
70+
"name": "Angular",
71+
"description": "Angular is a platform for building mobile and desktop web applications. Join the community of millions of developers who build compelling user interfaces with Angular.",
72+
"url": "https://angular.io",
73+
"logo": "https://angular.io/assets/images/logos/angular/angular.svg"
74+
}
75+
}
76+
</script>
2277
</head>
2378

2479
<body class="docs-app-background">

src/robots.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Sitemap: https://material.angular.io/sitemap.xml
2+
User-agent: *
3+
Disallow:

src/sitemap.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset
3+
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
6+
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
7+
8+
<url>
9+
<loc>https://material.angular.io</loc>
10+
<changefreq>yearly</changefreq>
11+
<priority>1.0</priority>
12+
</url>
13+
<url>
14+
<loc>https://material.angular.io/guides</loc>
15+
<changefreq>monthly</changefreq>
16+
<priority>0.9</priority>
17+
</url>
18+
<url>
19+
<loc>https://material.angular.io/components/categories</loc>
20+
<changefreq>monthly</changefreq>
21+
<priority>0.8</priority>
22+
</url>
23+
<url>
24+
<loc>https://material.angular.io/cdk/categories</loc>
25+
<changefreq>monthly</changefreq>
26+
<priority>0.7</priority>
27+
</url>
28+
</urlset>
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
@import '~@angular/material/theming';
21
@import './app-theme';
32
@import './styles/api';
43
@import './styles/markdown';
54
@import './styles/tables';
65
@import './styles/general';
76

8-
97
// Include material core styles.
108
@include mat-core();
119

12-
13-
// Define the light theme.
14-
$primary: mat-palette($mat-indigo);
15-
$accent: mat-palette($mat-pink, A200, A100, A400);
16-
17-
$theme: mat-light-theme($primary, $accent);
1810
@include angular-material-theme($theme);
1911
@include material-docs-app-theme($theme);

tools/deploy.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ echo ""
3030

3131
read -rp "Press <ENTER> to continue.."
3232

33-
npm run build-themes
34-
35-
"$(npm bin)"/ng build --aot --prod --build-optimizer=false
36-
"$(npm bin)"/firebase use $projectId
37-
"$(npm bin)"/firebase deploy
33+
yarn prod-build
34+
yarn firebase use $projectId
35+
yarn firebase deploy

0 commit comments

Comments
 (0)