mirror of
https://github.com/wassname/template.git
synced 2026-08-04 13:23:33 +08:00
More tutorials
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
export default function(dom) {
|
||||
if (!dom.querySelector("html").getAttribute("lang")) {
|
||||
dom.querySelector("html").setAttribute("lang", "en")
|
||||
}
|
||||
|
||||
let head = dom.querySelector("head");
|
||||
|
||||
if (!dom.querySelector("meta[charset]")) {
|
||||
let meta = dom.createElement("meta");
|
||||
meta.setAttribute("charset", "utf-8");
|
||||
head.appendChild(meta);
|
||||
}
|
||||
if (!dom.querySelector("meta[name=viewport]")) {
|
||||
let meta = dom.createElement("meta");
|
||||
meta.setAttribute("name", "viewport");
|
||||
meta.setAttribute("content", "width=device-width, initial-scale=1");
|
||||
head.appendChild(meta);
|
||||
}
|
||||
}
|
||||
+1
-11
@@ -1,14 +1,6 @@
|
||||
export default function(dom, data) {
|
||||
dom.querySelector("html").setAttribute("lang", "en")
|
||||
let head = dom.querySelector("head");
|
||||
|
||||
if (!dom.querySelector("meta[charset]")) {
|
||||
appendHtml(head, `<meta charset="utf-8">`);
|
||||
}
|
||||
if (!dom.querySelector("meta[name=viewport]")) {
|
||||
appendHtml(head, `<meta name="viewport" content="width=device-width, initial-scale=1">`);
|
||||
}
|
||||
|
||||
|
||||
appendHtml(head, `
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
||||
<link rel="icon" type="image/png" href="/favicon.png">
|
||||
@@ -79,8 +71,6 @@ export default function(dom, data) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function appendHtml(el, html) {
|
||||
el.innerHTML += html;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import layout from './styles-layout.css';
|
||||
import article from './styles-article.css';
|
||||
import code from './styles-code.css';
|
||||
|
||||
export default function(dom, data) {
|
||||
export default function(dom) {
|
||||
let s = dom.createElement("style");
|
||||
s.textContent = base + layout + article + code;
|
||||
dom.querySelector("head").appendChild(s);
|
||||
|
||||
Reference in New Issue
Block a user