forked from lavas-project/lavas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix index template (lavas-project#46)
Allow developers using custom variables in index.html.tmpl
- Loading branch information
Showing
12 changed files
with
117 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 59 additions & 4 deletions
63
packages/lavas-core-vue/test/fixtures/core/index.html.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,65 @@ | ||
<html> | ||
<!DOCTYPE html> | ||
|
||
<% if (ssr) { %> | ||
<< meta = meta.inject() >> | ||
<html lang="zh_CN" data-vue-meta-server-rendered {{{ meta.htmlAttrs.text() }}}> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<%= renderMeta() %> | ||
<%= renderManifest() %> | ||
|
||
{{{ meta.title.text() }}} | ||
{{{ meta.meta.text() }}} | ||
{{{ meta.link.text() }}} | ||
{{{ meta.style.text() }}} | ||
{{{ meta.script.text() }}} | ||
{{{ meta.noscript.text() }}} | ||
|
||
<!-- Add to home screen for Android and modern mobile browsers --> | ||
<link rel="manifest" href="{{ config.build.publicPath }}static/manifest.json?v={{ config.buildVersion }}"> | ||
<!-- Add to home screen for Safari on iOS --> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
</head> | ||
<body {{{ meta.bodyAttrs.text() }}}> | ||
<!--vue-ssr-outlet--> | ||
<< if (isProd) { >> | ||
<script> | ||
window.onload = function () { | ||
var script = document.createElement('script'); | ||
var firstScript = document.getElementsByTagName('script')[0]; | ||
script.type = 'text/javascript'; | ||
script.async = true; | ||
script.src = '{{ config.build.publicPath }}sw-register.js?v=' + Date.now(); | ||
firstScript.parentNode.insertBefore(script, firstScript); | ||
}; | ||
</script> | ||
<< } >> | ||
</body> | ||
</html> | ||
<% } else { %> | ||
<html lang="zh_CN"> | ||
<head> | ||
<title></title> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<!-- Add to home screen for Android and modern mobile browsers --> | ||
<link rel="manifest" href="<<= htmlWebpackPlugin.options.config.build.publicPath >>static/manifest.json?v=<<= htmlWebpackPlugin.options.config.buildVersion >>"> | ||
<!-- Add to home screen for Safari on iOS --> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
|
||
<< for (var jsFilePath of htmlWebpackPlugin.files.js) { >> | ||
<link rel="preload" href="<<= jsFilePath >>" as="script"> | ||
<< } >> | ||
<< for (var cssFilePath of htmlWebpackPlugin.files.css) { >> | ||
<link rel="preload" href="<<= cssFilePath >>" as="style"> | ||
<< } >> | ||
</head> | ||
<body> | ||
<%= renderEntry() %> | ||
<div id="app"></div> | ||
</body> | ||
</html> | ||
<% } %> |
Oops, something went wrong.