🔖 Upgrade to 1.2

This commit is contained in:
nanxiaobei 2018-07-06 02:45:58 +08:00
parent eb04ce0e1a
commit cb2786f9b2
8 changed files with 100 additions and 105 deletions

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2018 nanxiaobei Copyright (c) 2018 21beats
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,12 +1,12 @@
Paper Paper
======== ========
Current version: [1.0](https://github.com/nanxiaobei/hugo-paper/releases) Current version: [1.2](https://github.com/nanxiaobei/hugo-paper/releases)
## Waht's Paper? ## Waht's Paper?
Paper is a responsive simple & clean Hugo theme. Paper is a responsive simple, clean, flex Hugo theme.
> Demo: https://nanxiaobei.github.io/hugo-paper/ > Demo: https://nanxiaobei.github.io/hugo-paper/

View File

@ -1,2 +1,3 @@
+++ +++
+++ +++

View File

@ -41,4 +41,4 @@
</nav> </nav>
</footer> </footer>
{{ end }} {{ end }}
{{ partial "footer.html" . }} {{ partial "footer.html" . }}

View File

@ -1,29 +1,26 @@
</main> </main>
<footer class="footer"> <footer class="footer">
<span>&copy; {{ if eq now.Year 2017 }}2017{{ else }}2017-{{ now.Year }}{{ end }} {{ .Site.Title }} 🎉</span> <span>&copy; {{ now.Year }} {{ .Site.Title }} 🎉</span>
<span>&middot;</span> <span>&middot;</span>
<span>Powered by <a href="https://gohugo.io/" target="_blank">Hugo</a></span> <span>Powered by <a href="https://gohugo.io/" target="_blank">Hugo</a> ❤️</span>
<span>&middot;</span> <span>&middot;</span>
<span>Designed by <a href="http://21beats.com/" target="_blank">21beats</a></span> <span>Designed by <a href="http://21beats.com/" target="_blank">21beats</a> ⚡️</span>
</footer> </footer>
<script src="https://cdn.bootcss.com/instantclick/3.0.1/instantclick.min.js" data-no-instant></script> <script src="https://cdn.bootcss.com/instantclick/3.0.1/instantclick.min.js" data-no-instant></script>
<script data-no-instant>InstantClick.init();</script> <script data-no-instant>InstantClick.init();</script>
<script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js" data-no-instant></script> <script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js" data-no-instant></script>
<script data-no-instant> <script data-no-instant>
hljs.initHighlightingOnLoad(); hljs.initHighlightingOnLoad();
menuToggle(); addMenuListener();
InstantClick.on('change', function() { InstantClick.on('change', function() {
var blocks = document.querySelectorAll('pre code'); var blocks = document.querySelectorAll('pre code');
for (var i = 0; i < blocks.length; i++) { for (var i = 0; i < blocks.length; i++) {
hljs.highlightBlock(blocks[i]); hljs.highlightBlock(blocks[i]);
} }
menuToggle(); addMenuListener();
}); });
function menuToggle() { function addMenuListener() {
var $toggle = document.querySelector('.menu-toggle'); var $toggle = document.querySelector('.menu-toggle');
if (!$toggle.offsetParent) {
return;
}
var $body = document.querySelector('body'); var $body = document.querySelector('body');
$toggle.addEventListener('click', function() { $toggle.addEventListener('click', function() {
$body.classList.toggle('noscroll'); $body.classList.toggle('noscroll');

View File

@ -34,12 +34,12 @@
<!-- RSS --> <!-- RSS -->
<link rel="alternate" type="application/atom+xml" href="/index.xml" title="{{ .Site.Title }}"> <link rel="alternate" type="application/atom+xml" href="/index.xml" title="{{ .Site.Title }}">
</head> </head>
<body class="{{if eq .Kind `page` }}single{{else}}list{{end}}"> <body class="{{if eq .Kind `page` }}single{{else}}list{{ if .IsHome }} home{{ end }}{{end}}">
<header class="header"> <header class="header">
{{ if .IsHome }} {{ if .IsHome }}
<h1 class="title"><a href="{{ `/` }}"><span>🍱</span>{{ .Site.Title }}</a></h1> <h1 class="title"><a href="{{ `/` }}">{{ .Site.Title }}</a></h1>
{{ else }} {{ else }}
<p class="title"><a href="{{ `/` }}"><span>🍱</span>{{ .Site.Title }}</a></p> <p class="title"><a href="{{ `/` }}">{{ .Site.Title }}</a></p>
{{ end }} {{ end }}
<button class="menu-toggle" type="button"></button> <button class="menu-toggle" type="button"></button>
<nav class="menu"> <nav class="menu">

View File

@ -12,6 +12,17 @@
*::after { *::after {
box-sizing: border-box; box-sizing: border-box;
} }
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, .2);
border-radius: 3px;
}
html { html {
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
} }
@ -64,6 +75,11 @@ pre, code {
font-family: Menlo, Consolas, monospace; font-family: Menlo, Consolas, monospace;
font-size: inherit; font-size: inherit;
} }
/* Body
============================================================= */
.list {
background: #fafafa;
}
/* Header /* Header
============================================================= */ ============================================================= */
.header { .header {
@ -73,105 +89,79 @@ pre, code {
padding-left: 30px; padding-left: 30px;
padding-right: 30px; padding-right: 30px;
line-height: 65px; line-height: 65px;
}
.home .header {
background: #fff; background: #fff;
} }
.title a { .title a {
display: block; display: block;
margin-top: 18px; margin-top: 18px;
font-size: 28px; font-size: 24px;
font-weight: 700; font-weight: 700;
line-height: 35px; line-height: 35px;
} }
.title span { .noscroll {
display: inline-block; overflow: hidden;
margin-right: 10px;
transform: translateY(1px);
} }
.menu-toggle { .menu-toggle {
display: block;
position: absolute;
top: 0;
right: 0;
z-index: 20;
width: 80px;
height: 65px;
}
.menu-toggle::before,
.menu-toggle::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 2px;
background: #000;
}
.menu-toggle::before {
transform: translate3d(-50%, -5px, 0);
}
.menu-toggle::after {
transform: translate3d(-50%, 4px, 0);
}
.noscroll .menu-toggle::before {
transform: translate3d(-50%, -1px, 0) rotateZ(45deg);
}
.noscroll .menu-toggle::after {
transform: translate3d(-50%, -1px, 0) rotateZ(-45deg);
}
.menu {
display: none; display: none;
} }
.menu li { .noscroll .menu {
display: inline-block; display: block;
margin-left: 20px;
} }
.menu li.active a { .menu ul {
color: rgba(0, 0, 0, .4); position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10;
background: #fff;
display: flex;
justify-content: center;
flex-direction: column;
text-align: center;
}
.menu li {
width: 100%;
margin-left: 0;
} }
.menu a { .menu a {
display: block; font-size: 20px;
font-size: 15px;
}
@media (max-width: 1023px) {
.noscroll {
overflow: hidden;
}
.menu-toggle {
display: block;
}
.menu-toggle {
position: absolute;
top: 0;
right: 0;
z-index: 20;
width: 80px;
height: 65px;
}
.menu-toggle::before,
.menu-toggle::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 2px;
background: #000;
}
.menu-toggle::before {
transform: translate3d(-50%, -5px, 0);
}
.menu-toggle::after {
transform: translate3d(-50%, 4px, 0);
}
.noscroll .menu-toggle::before {
transform: translate3d(-50%, -1px, 0) rotateZ(45deg);
}
.noscroll .menu-toggle::after {
transform: translate3d(-50%, -1px, 0) rotateZ(-45deg);
}
.menu {
display: none;
}
.noscroll .menu {
display: block;
}
.menu ul {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10;
background: #fff;
display: flex;
justify-content: center;
flex-direction: column;
text-align: center;
}
.menu li {
width: 100%;
margin-left: 0;
}
.menu a {
font-size: 20px;
}
} }
/* Main /* Main
======================================================================= */ ======================================================================= */
.list {
background: #fafafa;
}
/* Main
------------------------------ */
.main { .main {
min-height: calc(100vh - 130px); min-height: calc(100vh - 130px);
overflow: hidden; overflow: hidden;
@ -250,7 +240,7 @@ pre, code {
background: #fff; background: #fff;
} }
.welcome-emoji { .welcome-emoji {
font-size: 50px; font-size: 60px;
line-height: 1; line-height: 1;
} }
.first-entry .post-title { .first-entry .post-title {
@ -272,6 +262,10 @@ pre, code {
background: #fff; background: #fff;
border-radius: 6px; border-radius: 6px;
} }
.post-entry:active {
transform: scale(.98);
transition: transform .1s;
}
.post-entry + .post-entry { .post-entry + .post-entry {
margin-top: 25px; margin-top: 25px;
} }
@ -391,16 +385,18 @@ pre, code {
} }
.post-content pre { .post-content pre {
padding: 20px; padding: 20px;
background: rgba(0, 0, 0, .05); background: #fafafa;
border-radius: 6px;
} }
.post-content pre code { .post-content pre code {
padding: 0; padding: 0;
background: transparent; background: transparent;
border-radius: 0;
} }
.post-content code { .post-content code {
padding: 3px 6px; padding: 3px 6px;
font-size: 15px; font-size: 15px;
background: rgba(0, 0, 0, .05); background: #fafafa;
border-radius: 3px; border-radius: 3px;
} }
.post-content blockquote { .post-content blockquote {
@ -427,16 +423,17 @@ pre, code {
} }
.post-tags a { .post-tags a {
display: block; display: block;
padding: 4px 15px; padding: 6px 16px;
color: rgba(0, 0, 0, .6); color: rgba(0, 0, 0, .6);
background: rgba(0, 0, 0, .05); font-size: 16px;
background: #f5f5f5;
border-radius: 3px; border-radius: 3px;
} }
.post-tags li + li { .post-tags li + li {
margin-left: 3px; margin-left: 3px;
} }
.post-tags a:hover { .post-tags a:hover {
background: rgba(0, 0, 0, .08); background: #eee;
} }
@media (max-width: 767px) { @media (max-width: 767px) {
.post-content blockquote { .post-content blockquote {
@ -469,7 +466,7 @@ pre, code {
======================================================================= */ ======================================================================= */
.footer { .footer {
padding: 20px; padding: 20px;
font-size: 15px; font-size: 14px;
line-height: 25px; line-height: 25px;
text-align: center; text-align: center;
} }

View File

@ -4,7 +4,7 @@
name = "Paper" name = "Paper"
license = "MIT" license = "MIT"
licenselink = "https://github.com/nanxiaobei/hugo-paper/blob/master/LICENSE" licenselink = "https://github.com/nanxiaobei/hugo-paper/blob/master/LICENSE"
description = "A simple & clean hugo theme" description = "A simple, clean, flex hugo theme"
homepage = "https://github.com/nanxiaobei/hugo-paper/" homepage = "https://github.com/nanxiaobei/hugo-paper/"
tags = ["Responsive", "Simple", "Clean", "Light", "White", "Blog"] tags = ["Responsive", "Simple", "Clean", "Light", "White", "Blog"]
features = ["Responsive", "One Column", "Blog"] features = ["Responsive", "One Column", "Blog"]