Переглянути джерело

added custom.css and cookie support

pull/139/head
somratpro 4 роки тому
джерело
коміт
2c93466334

+ 0
- 0
assets/css/custom.css Переглянути файл


+ 16
- 1
assets/css/style.css Переглянути файл

@@ -2281,4 +2281,19 @@ figcaption {
display: block;
}

/*# sourceMappingURL=maps/style.css.map */
/* cookie */
.cookie-box {
position: fixed;
left: 0;
right: 0;
bottom: 0;
text-align: center;
padding: 1rem 2rem;
background: rgb(71, 71, 71);
transition: all .75s cubic-bezier(.19, 1, .22, 1);
color: #fdfdfd;
}

.cookie-box-hide {
display: none;
}

+ 5
- 0
exampleSite/config.toml Переглянути файл

@@ -98,6 +98,11 @@ post_share = true
enable = true
preloader = "images/logo.png"

# cookies
[params.cookies]
enable = true
expire_days = 2

# google map
[params.map]
enable = true

+ 23
- 0
layouts/partials/footer.html Переглянути файл

@@ -40,3 +40,26 @@
{{ "<!-- Main Script -->" | safeHTML }}
{{ $script := resources.Get "js/script.js" | minify | fingerprint "sha384"}}
<script src="{{ $script.Permalink }}" integrity="{{ $script.Data.Integrity }}"></script>

<!-- cookie -->
{{ if site.Params.cookies.enable }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.2.1/js.cookie.min.js"></script>
<div id="js-cookie-box" class="cookie-box cookie-box-hide">
This site uses cookies. By continuing to use this website, you agree to their use. <span id="js-cookie-button" class="btn btn-transparent">I Accept</span>
</div>
<script>
(function ($) {
const cookieBox = document.getElementById('js-cookie-box');
const cookieButton = document.getElementById('js-cookie-button');
if (!Cookies.get('cookie-box')) {
cookieBox.classList.remove('cookie-box-hide');
cookieButton.onclick = function () {
Cookies.set('cookie-box', true, {
expires: {{ site.Params.cookies.expire_days }}
});
cookieBox.classList.add('cookie-box-hide');
};
}
})(jQuery);
</script>
{{ end }}

+ 5
- 4
layouts/partials/head.html Переглянути файл

@@ -15,11 +15,12 @@
{{ end }}

{{"<!-- Main Stylesheet -->"|safeHTML}}
{{ $styles := resources.Get "css/style.css" | minify | fingerprint "sha384" }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
{{ $styles := resources.Get "css/style.css" | minify }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" media="screen">

{{"<!-- Custom stylesheet - for your changes -->" |safeHTML}}
<link rel="stylesheet" href="{{ `css/custom.css` | relURL}}" media="screen">
{{"<!-- Custom stylesheet - for your changes -->" |safeHTML}}
{{ $custom := resources.Get "css/custom.css" | minify }}
<link rel="stylesheet" href="{{ $custom.Permalink }}" media="screen">

{{ "<!--Favicon-->" | safeHTML }}
<link rel="shortcut icon" href="{{ `images/favicon.png` | absURL }}" type="image/x-icon">

Завантаження…
Відмінити
Зберегти