Skip to content

Commit

Permalink
Remove portrait in manifest.json + fix auto-translation bug by google…
Browse files Browse the repository at this point in the history
… translate (GladysAssistant#818)

* Add translate="no" to the template html

* Fix GladysAssistant#815: remove orientation portrait in the manifest.json
  • Loading branch information
Pierre-Gilles authored and NickDub committed Aug 7, 2020
1 parent 983d8ed commit 58746b5
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 54 deletions.
1 change: 0 additions & 1 deletion front/src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"short_name": "Gladys",
"start_url": "/",
"display": "standalone",
"orientation": "portrait",
"background_color": "#ffffff",
"theme_color": "#0052D4",
"icons": [
Expand Down
128 changes: 75 additions & 53 deletions front/src/template.html
Original file line number Diff line number Diff line change
@@ -1,56 +1,78 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" sizes="57x57"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-180x180.png">
<link rel="manifest" href="<%= htmlWebpackPlugin.files.publicPath %>manifest.json">
<% if (htmlWebpackPlugin.options.manifest.theme_color) { %>
<meta name="theme-color" content="<%= htmlWebpackPlugin.options.manifest.theme_color %>">
<% } %>
<% for (var chunk of webpack.chunks) { %>
<% if (chunk.names.length === 1 && chunk.names[0] === 'polyfills') continue; %>
<% for (var file of chunk.files) { %>
<% if (htmlWebpackPlugin.options.preload && file.match(/\.(js|css)$/)) { %>
<link rel="preload" href="<%= htmlWebpackPlugin.files.publicPath + file %>"
as="<%= file.match(/\.css$/)?'style':'script' %>">
<% } else if (file.match(/manifest\.json$/)) { %>
<link rel="manifest" href="<%= htmlWebpackPlugin.files.publicPath + file %>">
<% } %>
<% } %>
<% } %>
</head>

<body>
<%= htmlWebpackPlugin.options.ssr({
url: '/'
}) %>
<script defer src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script>
<script>
window.fetch || document.write('<script src="<%= htmlWebpackPlugin.files.chunks["polyfills"].entry %>"><\/script>')

</script>
</body>
<html translate="no">
<head>
<meta charset="utf-8" />
<title><%= htmlWebpackPlugin.options.title %></title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link
rel="apple-touch-icon"
sizes="57x57"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-57x57.png"
/>
<link
rel="apple-touch-icon"
sizes="60x60"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-60x60.png"
/>
<link
rel="apple-touch-icon"
sizes="72x72"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-72x72.png"
/>
<link
rel="apple-touch-icon"
sizes="76x76"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-76x76.png"
/>
<link
rel="apple-touch-icon"
sizes="114x114"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-114x114.png"
/>
<link
rel="apple-touch-icon"
sizes="120x120"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-120x120.png"
/>
<link
rel="apple-touch-icon"
sizes="144x144"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-144x144.png"
/>
<link
rel="apple-touch-icon"
sizes="152x152"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-152x152.png"
/>
<link
rel="apple-touch-icon"
sizes="180x180"
href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-icon-180x180.png"
/>
<link rel="manifest" href="<%= htmlWebpackPlugin.files.publicPath %>manifest.json" />
<% if (htmlWebpackPlugin.options.manifest.theme_color) { %>
<meta name="theme-color" content="<%= htmlWebpackPlugin.options.manifest.theme_color %>" />
<% } %> <% for (var chunk of webpack.chunks) { %> <% if (chunk.names.length === 1 && chunk.names[0] === 'polyfills')
continue; %> <% for (var file of chunk.files) { %> <% if (htmlWebpackPlugin.options.preload &&
file.match(/\.(js|css)$/)) { %>
<link
rel="preload"
href="<%= htmlWebpackPlugin.files.publicPath + file %>"
as="<%= file.match(/\.css$/)?'style':'script' %>"
/>
<% } else if (file.match(/manifest\.json$/)) { %>
<link rel="manifest" href="<%= htmlWebpackPlugin.files.publicPath + file %>" />
<% } %> <% } %> <% } %>
</head>

<body>
<%= htmlWebpackPlugin.options.ssr({ url: '/' }) %>
<script defer src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script>
<script>
window.fetch ||
document.write('<script src="<%= htmlWebpackPlugin.files.chunks["polyfills"].entry %>"><\/script>');
</script>
</body>
</html>

0 comments on commit 58746b5

Please sign in to comment.