diff options
| -rw-r--r-- | LICENSE | 2 | ||||
| -rwxr-xr-x | README.md | 4 | ||||
| -rw-r--r-- | archetypes/default.md | 1 | ||||
| -rw-r--r-- | layouts/_default/list.html | 2 | ||||
| -rw-r--r-- | layouts/partials/footer.html | 15 | ||||
| -rw-r--r-- | layouts/partials/header.html | 6 | ||||
| -rw-r--r-- | static/css/style.css | 173 | ||||
| -rw-r--r-- | theme.toml | 2 |
8 files changed, 100 insertions, 105 deletions
@@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 nanxiaobei +Copyright (c) 2018 21beats Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -1,12 +1,12 @@ 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? -Paper is a responsive simple & clean Hugo theme. +Paper is a responsive simple, clean, flex Hugo theme. > Demo: https://nanxiaobei.github.io/hugo-paper/ diff --git a/archetypes/default.md b/archetypes/default.md index ac36e06..3b793e3 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,2 +1,3 @@ +++ + +++ diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 36553d8..aa76b4f 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -41,4 +41,4 @@ </nav> </footer> {{ end }} -{{ partial "footer.html" . }}
\ No newline at end of file +{{ partial "footer.html" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index d4d74f8..f7ddea3 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,29 +1,26 @@ </main> <footer class="footer"> - <span>© {{ if eq now.Year 2017 }}2017{{ else }}2017-{{ now.Year }}{{ end }} {{ .Site.Title }} 🎉</span> + <span>© {{ now.Year }} {{ .Site.Title }} 🎉</span> <span>·</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>·</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> <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 src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js" data-no-instant></script> <script data-no-instant> hljs.initHighlightingOnLoad(); - menuToggle(); + addMenuListener(); InstantClick.on('change', function() { var blocks = document.querySelectorAll('pre code'); for (var i = 0; i < blocks.length; i++) { hljs.highlightBlock(blocks[i]); } - menuToggle(); + addMenuListener(); }); - function menuToggle() { + function addMenuListener() { var $toggle = document.querySelector('.menu-toggle'); - if (!$toggle.offsetParent) { - return; - } var $body = document.querySelector('body'); $toggle.addEventListener('click', function() { $body.classList.toggle('noscroll'); diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 6781ddb..7b716a1 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -34,12 +34,12 @@ <!-- RSS --> <link rel="alternate" type="application/atom+xml" href="/index.xml" title="{{ .Site.Title }}"> </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"> {{ if .IsHome }} - <h1 class="title"><a href="{{ `/` }}"><span>🍱</span>{{ .Site.Title }}</a></h1> + <h1 class="title"><a href="{{ `/` }}">{{ .Site.Title }}</a></h1> {{ else }} - <p class="title"><a href="{{ `/` }}"><span>🍱</span>{{ .Site.Title }}</a></p> + <p class="title"><a href="{{ `/` }}">{{ .Site.Title }}</a></p> {{ end }} <button class="menu-toggle" type="button"></button> <nav class="menu"> diff --git a/static/css/style.css b/static/css/style.css index 76c282b..e3acfbd 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -12,6 +12,17 @@ *::after { 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 { -webkit-tap-highlight-color: transparent; } @@ -64,6 +75,11 @@ pre, code { font-family: Menlo, Consolas, monospace; font-size: inherit; } +/* Body +============================================================= */ +.list { + background: #fafafa; +} /* Header ============================================================= */ .header { @@ -73,105 +89,79 @@ pre, code { padding-left: 30px; padding-right: 30px; line-height: 65px; +} +.home .header { background: #fff; } .title a { display: block; margin-top: 18px; - font-size: 28px; + font-size: 24px; font-weight: 700; line-height: 35px; } -.title span { - display: inline-block; - margin-right: 10px; - transform: translateY(1px); +.noscroll { + overflow: hidden; } .menu-toggle { - display: none; + display: block; + position: absolute; + top: 0; + right: 0; + z-index: 20; + width: 80px; + height: 65px; } -.menu li { - display: inline-block; - margin-left: 20px; +.menu-toggle::before, +.menu-toggle::after { + content: ''; + position: absolute; + top: 50%; + left: 50%; + width: 20px; + height: 2px; + background: #000; } -.menu li.active a { - color: rgba(0, 0, 0, .4); +.menu-toggle::before { + transform: translate3d(-50%, -5px, 0); } -.menu a { +.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; - 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; - } +.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; } -/* Main -======================================================================= */ -.list { - background: #fafafa; +.menu li { + width: 100%; + margin-left: 0; +} +.menu a { + font-size: 20px; } /* Main ------------------------------- */ +======================================================================= */ .main { min-height: calc(100vh - 130px); overflow: hidden; @@ -250,7 +240,7 @@ pre, code { background: #fff; } .welcome-emoji { - font-size: 50px; + font-size: 60px; line-height: 1; } .first-entry .post-title { @@ -272,6 +262,10 @@ pre, code { background: #fff; border-radius: 6px; } +.post-entry:active { + transform: scale(.98); + transition: transform .1s; +} .post-entry + .post-entry { margin-top: 25px; } @@ -391,16 +385,18 @@ pre, code { } .post-content pre { padding: 20px; - background: rgba(0, 0, 0, .05); + background: #fafafa; + border-radius: 6px; } .post-content pre code { padding: 0; background: transparent; + border-radius: 0; } .post-content code { padding: 3px 6px; font-size: 15px; - background: rgba(0, 0, 0, .05); + background: #fafafa; border-radius: 3px; } .post-content blockquote { @@ -427,16 +423,17 @@ pre, code { } .post-tags a { display: block; - padding: 4px 15px; + padding: 6px 16px; color: rgba(0, 0, 0, .6); - background: rgba(0, 0, 0, .05); + font-size: 16px; + background: #f5f5f5; border-radius: 3px; } .post-tags li + li { margin-left: 3px; } .post-tags a:hover { - background: rgba(0, 0, 0, .08); + background: #eee; } @media (max-width: 767px) { .post-content blockquote { @@ -469,7 +466,7 @@ pre, code { ======================================================================= */ .footer { padding: 20px; - font-size: 15px; + font-size: 14px; line-height: 25px; text-align: center; } @@ -4,7 +4,7 @@ name = "Paper" license = "MIT" 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/" tags = ["Responsive", "Simple", "Clean", "Light", "White", "Blog"] features = ["Responsive", "One Column", "Blog"] |
