diff options
author | amazingrise <8315221+AmazingRise@users.noreply.github.com> | 2019-11-22 15:40:07 +0300 |
---|---|---|
committer | amazingrise <8315221+AmazingRise@users.noreply.github.com> | 2019-11-22 15:40:07 +0300 |
commit | 999e81b8105a5eda4a1bdca61afbb204ebbb397f (patch) | |
tree | 726deb165379c52a0f12bcac04e906bc8adf1c4c | |
parent | a1d2c88916847128e9834e7c6add5c90eeb30b08 (diff) |
Some small fix.
-rw-r--r-- | assets/scss/journal.scss (renamed from static/scss/journal.scss) | 2 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 5 | ||||
-rw-r--r-- | layouts/_default/single.html | 7 | ||||
-rw-r--r-- | layouts/index.html | 12 | ||||
-rw-r--r-- | layouts/partials/extrabar.html | 36 | ||||
-rw-r--r-- | layouts/partials/head.html | 47 | ||||
-rw-r--r-- | layouts/partials/header.html | 71 |
7 files changed, 163 insertions, 17 deletions
diff --git a/static/scss/journal.scss b/assets/scss/journal.scss index 6c8d555..cba70b5 100644 --- a/static/scss/journal.scss +++ b/assets/scss/journal.scss @@ -1,4 +1,4 @@ -$color-accent: #9f34ff; +$color-accent: #4db6ac; $back-container-background: #fcfcfc; $front-container-background: #ffffff; diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 34d7b82..d8194a5 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,11 +1,14 @@ <!DOCTYPE html> <html> {{- partial "head.html" . -}} - {{- partial "sidebar.html" . -}} <body> + <div id="app"> + {{- partial "sidebar.html" . -}} + {{- partial "extrabar.html" . -}} {{- partial "header.html" . -}} <div id="content"> {{- block "main" . }}{{- end }} </div> + </div> </body> </html> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index ec5f4ac..d02c430 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,13 +2,12 @@ <div ref="streamContainer" class="stream-container"> <div class="post-list-container post-list-container-shadow"> <div class="post"> - {{ $featured_image := false}} {{ $post_class := "post-head-wrapper-text-only"}} - {{ if $featured_image }} - {{ $post_class := "post-head-wrapper"}} + {{ if .Params.featured_image }} + {{ $post_class = "post-head-wrapper"}} {{ end }} <div class="{{$post_class}}" - style="background-image: url('<%= getFeaturedImage() %>')"> + style="background-image: url('{{.Params.featured_image}}')"> <div class="post-title"> {{ .Title }} <div class="post-meta"> diff --git a/layouts/index.html b/layouts/index.html index a5bee78..301dc93 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -19,14 +19,12 @@ {{ .PublishDate.Format "2006-01-02" }} </div> </div> - <!-- - <% if(item.featured_image){ %> - <div class="post-item-image-wrapper"> + {{ if .Params.featured_image }} + <div class="post-item-image-wrapper"> <div class="post-item-image" - style="background-image: url('<%= config.root + item.path + item.featured_image %>')"></div> - </div> - <% } %> - --> + style="background-image: url('{{.Params.featured_image}}')"></div> + </div> + {{ end }} </div> </div> {{ end }} diff --git a/layouts/partials/extrabar.html b/layouts/partials/extrabar.html new file mode 100644 index 0000000..c7c2b0d --- /dev/null +++ b/layouts/partials/extrabar.html @@ -0,0 +1,36 @@ +<div ref="extraContainer" class="extra-container"> + <div class="pagination"> + <a id="globalBackToTop" class="pagination-action animated-visibility" href="#top" :class="{ invisible: scrollY == 0 }"> + <i class="material-icons pagination-action-icon"> + keyboard_arrow_up + </i> + </a> + <!-- + <% if(!config.__noPager) { %> + <% if(page.current && page.total && page.total > 1) { %> + <div class="pagination-indicator"> + <span style="text-align: center"> + <%= page.current %><br><div style="display: inline-block; transform: rotate(-28deg)">-</div><br><%= page.total %> + </span> + </div> + <% } %> + + <% if (page.prev) { %> + <a class="pagination-action" href="<%- url_for(page.prev_link) %>"> + <i class="material-icons pagination-action-icon"> + chevron_left + </i> + </a> + <% } %> + + <% if (page.next) { %> + <a class="pagination-action" href="<%- url_for(page.next_link) %>"> + <i class="material-icons pagination-action-icon"> + chevron_right + </i> + </a> + <% } %> + <% } %> + --> + </div> +</div>
\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 1114549..4e49851 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,8 +1,12 @@ <head> <title>{{.Title}}</title> -{{ with resources.Get "/scss/journal.scss" }} -<style >{{ .Content | safeCSS }}</style> -{{ end }} + +<meta charset="utf-8"> +<meta name="X-UA-Compatible" content="IE=edge"> +<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"> +<meta content="telephone=no" name="format-detection"> +<meta name="renderer" content="webkit"> +<meta name="theme-color" content="#ffffff"> <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> @@ -17,13 +21,48 @@ <!-- Originally comes from head_includes.ejs --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css" integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" crossorigin="anonymous"> <!-- favicon --> -<link rel="icon" href="<%- config.favicon ? config.favicon : theme.favicon %>"> +<link rel="icon" href="{{ .Site.Params.favicon }}"> <link rel="stylesheet" type="text/css" href="/css/journal.css"> +<!-- +{{ with resources.Get "/scss/journal.scss" }} +<style >{{ .Content | safeCSS }}</style> +{{ end }} +--> + +{{ $styles := resources.Get "scss/journal.scss" | toCSS | minify | fingerprint }} +<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen"> + +<script src="/js/journal.js"></script> <script src="/js/loadCSS.js"></script> <script> loadCSS("https://fonts.googleapis.com/css?family=Lora|Montserrat|Fira+Mono|Material+Icons"); + (function (d) { + var config = { + kitId: 'dwg1tuc', + scriptTimeout: 3000, + async: true + }, + h = d.documentElement, t = setTimeout(function () { + h.className = h.className.replace(/\bwf-loading\b/g, "") + " wf-inactive"; + }, config.scriptTimeout), tk = d.createElement("script"), f = false, + s = d.getElementsByTagName("script")[0], a; + h.className += " wf-loading"; + tk.src = 'https://use.typekit.net/' + config.kitId + '.js'; + tk.async = true; + tk.onload = tk.onreadystatechange = function () { + a = this.readyState; + if (f || a && a != "complete" && a != "loaded") return; + f = true; + clearTimeout(t); + try { + Typekit.load(config) + } catch (e) { + } + }; + s.parentNode.insertBefore(tk, s) + })(document); </script> </head>
\ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index e69de29..d1819cd 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -0,0 +1,71 @@ +<div class="single-column-drawer-container" ref="drawer" + v-bind:class="{ 'single-column-drawer-container-active': isDrawerOpen }"> + <div class="drawer-content"> + <div class="drawer-menu"> + {{ $current := .Permalink}} + {{range $taxonomyname, $taxonomy := .Site.Taxonomies}} + + {{ with $.Site.GetPage (printf "/%s" $taxonomyname) }} + + {{$actived := "false"}} + {{if eq $current .Permalink}} + {{$actived = "active"}} + + {{end}} + <a class="a-block drawer-menu-item {{$actived}}" href="{{.Permalink}}"> + {{.Title}} + </a> + {{ end }} + {{ end }} + <!-- + <a class="a-block drawer-menu-item <%= is_home() && 'active' %>" href="<%= config.url %>"> + <%= __('Home') %> + </a> + <% if (theme.archives) { %> + <a class="a-block drawer-menu-item <%= is_current('archives') && 'active' %>" href="<%= config.root + "archives" %>"> + <%= __('Archive') %> + </a> + <% } %> + + <% if(site.pages){ %> + <% site.pages.each(function (page){ %> + <a class="a-block drawer-menu-item <%= is_current(page.path) && 'active' %>" href="<%= config.root + page.path %>"> + <%= page.title %> + </a> + <% });} %> + + <% if (theme.rss) { %> + <a class="a-block drawer-menu-item" href="<%= config.root + theme.rss %>"> + <%= __('RSS') %> + </a> + <% } %> + --> + </div> + </div> +</div> +<transition name="fade"> + <div v-bind:class="{ 'single-column-drawer-mask': mounted }" v-if="isDrawerOpen" v-on:click="toggleDrawer"></div> +</transition> +<nav ref="navBar" class="navbar sticky-top navbar-light single-column-nav-container"> + <div ref="navBackground" class="nav-background"></div> + <div class="container container-narrow nav-content"> + <button id="nav_dropdown_btn" class="nav-dropdown-toggle" type="button" v-on:click="toggleDrawer"> + <i class="material-icons"> + menu + </i> + </button> + <a ref="navTitle" class="navbar-brand" href="{{.Site.BaseURL}}"> + {{.Site.Title}} + </a> + </div> +</nav> +<div class="single-column-header-container" ref="pageHead" + v-bind:style="{ transform: 'translateZ(0px) translateY('+.3*scrollY+'px)', opacity: 1-navOpacity }"> + <a href="{{.Site.BaseURL}}"> + <div class="single-column-header-title">{{.Site.Title}}</div> + {{ with .Params.subtitle }} + <div class="single-column-header-subtitle">{{.}}</div> + {{ end }} + + </a> +</div>
\ No newline at end of file |