diff options
author | DoraMrKim <““nn_201312@qq.comgit config --global user.email ““nn_201312@163.com> | 2020-05-05 14:31:25 +0300 |
---|---|---|
committer | DoraMrKim <““nn_201312@qq.comgit config --global user.email ““nn_201312@163.com> | 2020-05-05 14:31:25 +0300 |
commit | c3a5b95c323cf9e846b9b1978623ce11b33662d1 (patch) | |
tree | 47230590c5a1bbd44432c287a7a8c4a9966fafd8 | |
parent | a61b3d4d73a6d0bde238339b574842516ee9c272 (diff) |
added custom settings1.01
-rw-r--r-- | layouts/_default/single.html | 1 | ||||
-rw-r--r-- | layouts/index.html | 2 | ||||
-rw-r--r-- | layouts/partials/custom/footer.html | 0 | ||||
-rw-r--r-- | layouts/partials/custom/head.html | 0 | ||||
-rw-r--r-- | layouts/partials/custom/script.html | 0 | ||||
-rw-r--r-- | layouts/partials/footer.html | 1 | ||||
-rw-r--r-- | layouts/partials/head.html | 30 | ||||
-rw-r--r-- | layouts/partials/header.html | 2 | ||||
-rw-r--r-- | layouts/partials/script.html | 19 | ||||
-rw-r--r-- | layouts/partials/style.html | 3 | ||||
-rw-r--r-- | static/css/tony.css | 12 |
11 files changed, 59 insertions, 11 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d5a3156..5467c92 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -34,4 +34,5 @@ </div>
</div>
</body>
+ {{ partial "script.html" . }}
</html>
\ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index d36934a..bd4253c 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -20,4 +20,6 @@ </div>
</body>
{{ partial "footer.html" . }}
+
+ {{ partial "script.html" . }}
</html>
\ No newline at end of file diff --git a/layouts/partials/custom/footer.html b/layouts/partials/custom/footer.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/partials/custom/footer.html diff --git a/layouts/partials/custom/head.html b/layouts/partials/custom/head.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/partials/custom/head.html diff --git a/layouts/partials/custom/script.html b/layouts/partials/custom/script.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/partials/custom/script.html diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index e69de29..0f69312 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -0,0 +1 @@ +{{ partial "custom/footer.html" . }}
\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 6ecbe95..79f4f5b 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,10 +1,32 @@ <head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
+
+ {{ hugo.Generator }}
+
+ <!-- Responsive Web Design -->
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <!-- Avoid Automatic Format Detection -->
+ <meta name="format-detection" content="telephone=no, date=no, address=no, email=no" />
+ <!-- Avoid Transcoding -->
+ <meta http-equiv="Cache-Control" content="no-transform" />
+ <!-- Avoid Baidu Mobile Search Transcoding -->
+ <meta http-equiv="Cache-Control" content="no-siteapp" />
+
+ <!-- CSS -->
+ {{- partial "style.html" . }}
+
<link rel="shortcut icon" href="{{ $.Site.Params.siteLogo | relURL }}" type="image/x-icon" />
- <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
- <!--<link rel="stylesheet" href="{{ "/css/bootstrap.css" | relURL }}">-->
- <link rel="stylesheet" href="{{ "/css/tony.css" | relURL }}">
<title>{{ .Title }}</title>
+
+ <meta name="author" content="{{ .Params.author | default .Site.Author.name }}" />
+ {{- $description := .Description | default .Site.Params.siteDescription | plainify -}}
+ <meta name="description" content="{{ $description }}" />
+
+ <!-- SEO -->
+ <link rel="canonical" href="{{ .Permalink }}" />
+ {{- $Deliver := . -}}
+
+ {{ partial "custom/head.html" . }}
</head>
\ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 2cdd655..5702d55 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,4 +1,4 @@ -<header id="header-div" class="tony-header-scoll">
+<header id="header-div" class="tony-header-fixed">
<div class="header-div1">
<a href="{{ $.Site.BaseURL }}" style="display:inline-block;">
<img src="{{ $.Site.Params.siteLogo | relURL}}">
diff --git a/layouts/partials/script.html b/layouts/partials/script.html new file mode 100644 index 0000000..b211ad8 --- /dev/null +++ b/layouts/partials/script.html @@ -0,0 +1,19 @@ +<script>
+ header = document.getElementById('header-div');
+ SY = window.scrollY;
+ function setHeader(type) {
+ header.setAttribute('class','tony-header-' + type);
+ }
+ window.onscroll = function () {
+ SY = window.scrollY;
+ if (SY > 0) setHeader('scroll');
+ else setHeader('fixed');
+ }
+ header.addEventListener('mouseover', function () {
+ setHeader('scroll');
+ });
+ header.addEventListener('mouseout', function () {
+ if(SY === 0) setHeader('fixed');
+ });
+ {{ partial "custom/script.html" . }}
+</script>
\ No newline at end of file diff --git a/layouts/partials/style.html b/layouts/partials/style.html new file mode 100644 index 0000000..e1ec36e --- /dev/null +++ b/layouts/partials/style.html @@ -0,0 +1,3 @@ +<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
+<!--<link rel="stylesheet" href="{{ "/css/bootstrap.css" | relURL }}">-->
+<link rel="stylesheet" href="{{ "/css/tony.css" | relURL }}">
\ No newline at end of file diff --git a/static/css/tony.css b/static/css/tony.css index 70422a1..8f23023 100644 --- a/static/css/tony.css +++ b/static/css/tony.css @@ -54,7 +54,7 @@ color: #fff!important
}
- .tony-header-scoll {
+ .tony-header-scroll {
box-shadow: none!important;
background: linear-gradient(180deg,#1c1f2c,transparent)!important
}
@@ -2114,19 +2114,19 @@ img { }
@media screen and (max-width:767px) and (prefers-color-scheme:dark) {
- .tony-header-scoll {
+ .tony-header-scroll {
border-bottom: none!important
}
}
@media screen and (max-width:767px) and (prefers-color-scheme:light) {
- .tony-header-scoll {
+ .tony-header-scroll {
border-bottom: 1px solid #eee
}
}
@media screen and (max-width:767px) and (prefers-color-scheme:no-preference) {
- .tony-header-scoll {
+ .tony-header-scroll {
border-bottom: 1px solid #eee
}
}
@@ -2265,7 +2265,7 @@ table { background: transparent
}
-.tony-header-fixed,.tony-header-scoll {
+.tony-header-fixed,.tony-header-scroll {
width: 100%;
height: 60px;
position: fixed;
@@ -2276,7 +2276,7 @@ table { transition: .2s ease-in-out
}
-.tony-header-scoll {
+.tony-header-scroll {
box-shadow: 0 4px 8px rgba(0,0,0,.04);
background: hsla(0,0%,100%,.9)
}
|