Merge pull request #1 from rhazdon/master

Pull in latest from upstream master
This commit is contained in:
Duncan Mackenzie 2019-04-20 12:58:19 -07:00 committed by GitHub
commit c972e5035a
13 changed files with 23 additions and 108 deletions

View File

@ -300,35 +300,3 @@ hr {
width: auto;
z-index: 100000;
}
// #home-center {
// display: flex;
// flex-grow: 1;
// flex-direction: column;
// justify-content: center;
// }
//
// #home-title {
// margin: 0;
// text-align: center;
// }
//
// #home-subtitle {
// margin-top: 0;
// margin-bottom: 1.5em;
// text-align: center;
// line-height: normal;
// font-size: .7em;
// font-style: italic;
// opacity: .9;
// }
//
// #home-social {
// font-size: 1.4em;
// text-align: center;
// opacity: .8;
//
// a {
// margin: 0 .2em;
// }
// }

View File

@ -1,15 +1,17 @@
{{ define "main" }}
<div id="home-center">
<h1 id="home-title">{{ .Site.Title }}</h1>
<main aria-role="main">
<div>
<h1>{{ .Site.Title }}</h1>
{{- with .Site.Params.homeSubtitle }}
<p id="home-subtitle">{{.}}</p>
{{- end }}
{{- with .Site.Params.homeSubtitle }}
<p>{{.}}</p>
{{- end }}
{{- with .Site.Params.social }}
<div id="home-social">
{{ partialCached "social-icons.html" . }}
</div>
{{- end }}
</div>
{{- with .Site.Params.social }}
<div>
{{ partial "social-icons.html" . }}
</div>
{{- end }}
</div>
</main>
{{ end }}

View File

@ -20,12 +20,11 @@
{{ end }}
<!-- CSS -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Source+Code+Pro" rel="stylesheet"
type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.2.1/css/flag-icon.min.css" rel="stylesheet"
type="text/css">
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) }}
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
{{ range $val := $.Site.Params.customCSS }}
@ -46,9 +45,9 @@
<meta property="article:published_time" content="{{ time .Date }}" />{{ end }}
<!-- RSS -->
{{ if .RSSLink }}
<link href="{{ .Site.RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
<!-- JSON Feed -->
{{ if .OutputFormats.Get "json" }}
@ -59,4 +58,4 @@
<!-- Custom head tags -->
{{- if templates.Exists "partials/extra-head.html" -}}
{{ partial "extra-head.html" . }}
{{- end }}
{{- end }}

View File

@ -1,8 +1,8 @@
{{ $main := resources.Get "js/main.js" }}
{{ $menu := resources.Get "js/menu.js" }}
{{ $prism := resources.Get "js/prism.js" }}
{{ $theme := resources.Get "js/theme.js" }}
{{ $js := slice $main $menu $theme | resources.Concat "js/bundle.js" }}
{{ $secureJS := $js | resources.Fingerprint "sha512" }}
{{ $secureJS := slice $main $menu $prism $theme | resources.Concat "bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
{{- if .Site.GoogleAnalytics }}

View File

@ -15,7 +15,7 @@
</div>
<article>
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
{{- if .Params.toc }}
<hr />

View File

@ -1 +0,0 @@
{"Target":"js/bundle.f65a6fe80656eb86fce3f1228faa2ac0bf43b28d21eb91975f036839ed92dfd126cabb91223501623641f4ea67ac5d03882d0b8c744da38c637a1fdf8e9016c6.js","MediaType":"application/javascript","Data":{"Integrity":"sha512-9lpv6AZW64b84/Eij6oqwL9Dso0h65GXXwNoOe2S39EmyruRIjUBYjZB9OpnrF0DiC0LjHRNo4xjeh/fjpAWxg=="}}

View File

@ -1,9 +0,0 @@
const throttle=(callback,limit)=>{let timeoutHandler=null;return()=>{if(timeoutHandler==null){timeoutHandler=setTimeout(()=>{callback();timeoutHandler=null;},limit);}};};const listen=(ele,e,callback)=>{if(document.querySelector(ele)!==null){document.querySelector(ele).addEventListener(e,callback);}}
let header=document.getElementById('site-header');let lastScrollPosition=window.pageYOffset;const autoHideHeader=()=>{let currentScrollPosition=window.pageYOffset;if(currentScrollPosition>lastScrollPosition){header.classList.remove('slideInUp');header.classList.add('slideOutDown');}else{header.classList.remove('slideOutDown');header.classList.add('slideInUp');}
lastScrollPosition=currentScrollPosition;}
let mobileMenuVisible=false;const toggleMobileMenu=()=>{let mobileMenu=document.getElementById('mobile-menu');if(mobileMenuVisible==false){mobileMenu.style.animationName='bounceInRight';mobileMenu.style.webkitAnimationName='bounceInRight';mobileMenu.style.display='block';mobileMenuVisible=true;}else{mobileMenu.style.animationName='bounceOutRight';mobileMenu.style.webkitAnimationName='bounceOutRight'
mobileMenuVisible=false;}}
const showImg=()=>{document.querySelector('.bg-img').classList.add('show-bg-img');}
const hideImg=()=>{document.querySelector('.bg-img').classList.remove('show-bg-img');}
const toggleToc=()=>{document.getElementById('toc').classList.toggle('show-toc');}
if(header!==null){listen('#menu-btn',"click",toggleMobileMenu);listen('#toc-btn',"click",toggleToc);listen('#img-btn',"click",showImg);listen('.bg-img',"click",hideImg);window.addEventListener('scroll',throttle(()=>{autoHideHeader();if(mobileMenuVisible==true){toggleMobileMenu();}},250));}

View File

@ -1 +0,0 @@
{"Target":"js/main.min.8f39f24808e9d0a9b02da58c2d2838da859dc0b7bdfadbdb1883aae8b6adacfe.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-jznySAjp0KmwLaWMLSg42oWdwLe9+tvbGIOq6LatrP4="}}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"Target":"scss/main.min.099699ab246bf26f50616f7c9f00c79d46110459d1bd727b2d07d6fc09ece082.css","MediaType":"text/css","Data":{"Integrity":"sha256-CZaZqyRr8m9QYW98nwDHnUYRBFnRvXJ7LQfW/Ans4II="}}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"Target":"css/style.min.9a30741782203507f3d35fe9cefabad487c72fc82dfbdf59121759fc2fa52f92.css","MediaType":"text/css","Data":{"Integrity":"sha256-mjB0F4IgNQfz01/pzvq61IfHL8gt+99ZEhdZ/C+lL5I="}}