Compare commits

..

86 Commits

Author SHA1 Message Date
Vojtěch Káně
9498944f53 Inline the submodule of themes/hermit with a git-subtree
Add 'themes/hermit/' from commit '56843f347a642324970ba30d58f23c64e037bb7c'

git-subtree-dir: themes/hermit
git-subtree-mainline: 7844fa5501c271b1b2b5ece2cb19f3202cd6e5ad
git-subtree-split: 56843f347a
2026-02-21 23:42:08 +01:00
Vojtěch Káně
56843f347a Add URL fragments in build time 2021-06-01 17:33:59 +02:00
Vojtěch Káně
c0f87fe601 Remove support for featured images 2021-06-01 17:32:58 +02:00
Vojtěch Káně
bcb0b3e9e4 Move header up and disable hiding 2021-06-01 17:32:06 +02:00
Track3
fc2dea0436 Merge pull request #108 from rlespinasse/french
Add French translation
2019-12-17 21:29:28 +08:00
romain lespinasse
a35fa27192 Add French translation 2019-10-27 21:53:20 +01:00
Track3
f647c23dac Merge pull request #106 from Nico264/patch-1
Add safeURL to social icons links
2019-10-27 20:45:42 +08:00
Track3
a39f22f280 Fix homepage overflow (#107)
Home content area overflows when screen height is short:
Fixed by using min-height instead of fixed 100vh height.
2019-10-27 20:36:43 +08:00
Nicolas Guichard
c6af673ff8 Add safeURL on social icons links
The social icon links are generated from developer-controlled config.toml file. They can be considered safe.
This enables using various URI schemes such as `tel:`, `sip:`, `geo:` or `whatever:`.
2019-10-27 13:14:30 +01:00
Tong Wu
f6d80e4407 Fix redundant .MediaType.Suffix (#100)
Fix alternative output formats list:
* Fix redundant .MediaType.Suffix
* Correct `title` attribute value to page title
2019-10-27 18:23:28 +08:00
Thai Ngo
91a18a1a92 Fix URLs in Multilingual Mode (#93)
Make below links correct in Multilingual Mode:
* tag links in single post page
* footer RSS link
* 404 page "archive" link
2019-09-15 17:04:56 +08:00
Adam Gausmann
1321f9e135 Add Twitch social icon (#95) 2019-09-15 16:29:44 +08:00
Dan Ho
3f7461d95d Add post author display (#91)
Add the ability to display post author set with `author` param in the content's front matter.
2019-09-08 21:27:52 +08:00
Alexander Dunkel
16c9d78ae5 Add code copy button to all code fields in the blog (#81) 2019-08-18 22:27:31 +08:00
Zorawar Moolenaar
a9f2ddcfa9 Fix Integrity and CORS issue on Chrome (#89)
Adding `crossorigin="anonymous"` to avoid CORS issues.
2019-08-18 20:38:40 +08:00
Track3
14cd856ac6 Update README.md 2019-07-28 18:34:18 +08:00
Hervy Qurrotul Ainur
24da8768ad Add new icons for designers (#85)
* Add several icons for designers & microstocker: shutterstock, freepik, adobestock, 123rf, dreamstime, dribbble, and behance.
* Update telegram & stackoverflow icon.
2019-07-28 18:10:43 +08:00
Track3
00dbd49a94 Add basic support for nested menu
* Related issue: #53
2019-06-22 18:44:30 +08:00
Akio Taniguchi
c2e02c5dff Fix behaviour of auto-hide header (#78)
Fixed #76: 
On mobile environment (iOS Safari), when the page scrolls to the top then bounce back, the header (bottom bar) turns to hide unexpectedly. Fixed it by forcing `currentScrollPosition` not a negative value.
2019-06-22 17:27:00 +08:00
Track3
6cee5adc69 Add related content section to single page (#77)
Set `relatedPosts` to `true` in the config to enable this.
2019-06-21 13:15:53 +08:00
Track3
e333628a26 Improve links design
* To provide a stronger feedback, all `a` tags now has a shadow on mouse hover.
* Links in contents now has a better animation.
2019-06-19 18:10:48 +08:00
Track3
c05698cf6d Add netlify.toml 2019-06-19 15:05:36 +08:00
Track3
41f77a9dc1 Regenerate resources after merge 2019-06-15 22:48:12 +08:00
Damien Lespiau
bb99c7b77f Improve the contrast between the background and text (#74)
Change text color from `#c6cddb` to `#e8eef2` in order to improve accessibility. Hermit theme now passes WCAG level AAA (contrast > 7.0).
2019-06-15 22:39:11 +08:00
Track3
8cdd37c74f Add stackoverflow icon
* See #68
2019-05-26 17:48:19 +08:00
Track3
0101f8b8d9 Update readme
Add instructions about modifying theme color or fonts, see #66
2019-05-11 22:12:21 +08:00
Tom Morris
281dd59105 Add rel="me" to social icons (#61) 2019-04-23 10:48:20 +08:00
Track3
028dc62e3b Add anchor points to post list page
* post-year now has anchor point, you can click on it or input url with hash tag to jump to a specific year.
* See #39
2019-03-24 11:45:41 +08:00
Milad Irannejad
e6177e0fde Update Readme.md (#56)
Change git submodules link to English version
2019-03-19 20:39:00 +08:00
Track3
1da63e341b Tweak the 404 page
* New svg image with animation
* Remove button word-break property (#51)
* Adjust margin
2019-02-26 23:53:31 +08:00
Track3
39cbfb324a Fix exampleSite taxonomies configuration
* See #50
2019-02-21 22:31:59 +08:00
Track3
ad75aca5c2 Add Netlify status badges and demo link to the readme 2019-02-14 16:29:13 +08:00
Track3
61592cc6fb Set word-wrap: break-word by default
* Closes #32
2019-02-14 15:58:07 +08:00
Track3
a892acdcb2 Regenerate resources after merge 2019-02-03 16:27:31 +08:00
Dmitry Yakimenko
ea656ac40c Disable wrapping of text in code blocks, scroll instead (#44)
* Disable wrapping of text in code blocks, scroll instead
* Remove pre.max-height
2019-02-03 16:10:21 +08:00
Dmitry Yakimenko
c099cb4a0f Add Telegram icon (#45)
This icon is originally designed by @dmitrytrusov for Hugo Minimo theme.
2019-02-03 09:56:20 +08:00
Track3
6da23e4e20 Put metadata tags into partial
And update example config.toml (relate to #40)
2019-02-01 18:14:07 +08:00
Giuseppe Pignataro
23e22be1eb Add Italian translation (#40) 2019-01-31 22:21:59 +08:00
Track3
545a122d6c Add anchor links to heading (#38)
* Closes #36
2019-01-27 12:20:29 +08:00
Track3
503a9a3934 Show "commit detail" link only when gitUrl is set
* See #34
2019-01-19 12:15:54 +08:00
Ge "David" Feng
885bf2c871 Fix analytics partial (#31)
Add the dot to pass along the current context
2019-01-10 12:12:58 +08:00
Track3
f995f7313c Remove absURL for featuredImg & bgImg
See #29
2019-01-07 20:39:51 +08:00
Track3
3f6885ac20 Fix exampleSite menu url 2019-01-05 13:24:57 +08:00
Track3
c3da1e0281 Fix menu toggle 2019-01-04 17:05:49 +08:00
Track3
334d05e5a1 Fix featured image toggle 2019-01-03 18:25:14 +08:00
Track3
f601584822 Add featured image to normal page template 2019-01-02 12:08:30 +08:00
Track3
1e17ccb801 Remove inline style and script of bg-img
* See #22
2019-01-01 17:53:20 +08:00
Track3
f38b9203b2 Add home footer copyright
* See #25
2019-01-01 14:06:04 +08:00
Track3
8a3041d5ee Fix header toggle bg-image button 2018-12-31 23:23:46 +08:00
Track3
4b2192f2fa Use images instead of featuredImg
`featuredImg` and `bgImg` are preserved in case you want to use a different background image from metadata images
2018-12-31 20:08:04 +08:00
Track3
f5b68c452f Add more customizations 2018-12-31 17:09:40 +08:00
Arnab Kumar Shil
97cc83914f Modularize analytics and add extra headers (#26) 2018-12-31 16:08:22 +08:00
Track3
97395d876c Slightly improve accessibility
* Add `title` attribute to some buttons or icons
2018-12-31 15:20:34 +08:00
Track3
1e25d7d93e Minor style improvements
* Get rid of inline style for mobile menu (#22)
* Improve background image & post meta link style
2018-12-31 14:29:07 +08:00
Track3
fbf51b713e Update README.md
* Add some tips about how to customize the theme
* See #23
2018-12-30 16:25:07 +08:00
Arnab Kumar Shil
269713b589 Add custom css support (#21) 2018-12-30 14:49:24 +08:00
Track3
4fb41e8a9a Improve javascript 2018-12-30 11:52:17 +08:00
Track3
efb0b592a0 Put comments into a partial
* Also removed unnecessary Disqus style (didn't regenerate resources)
2018-12-30 11:06:38 +08:00
Arnab Kumar Shil
6f864b437d Add meta descriptions to document head (#19)
Use Hugo‘s built in `schema.html` `opengraph.html` `twitter_cards.html` templates
2018-12-29 13:50:49 +08:00
Track3
c7ebd82a83 Merge pull request #18 from Track3/feature-toc
Add support for Table of Contents
2018-12-28 23:24:34 +08:00
Track3
451d527ae6 Regenerate resources before merge 2018-12-28 23:18:51 +08:00
Track3
98c3c64499 Add toggle toc button 2018-12-28 22:52:23 +08:00
Track3
1770524126 Fix menu url in multilingual mode
* See #17
2018-12-28 15:32:03 +08:00
Track3
3ad9401e81 Merge pull request #16 from kevinm416/master
Fixed usage of RelPermalink in baseof.html
2018-12-27 15:36:58 +08:00
Kevin Morgan
512d6ca9f2 Fixed usage of RelPermalink in baseof.html
When the static site is built, js and css import fails
with RelPermalink.
2018-12-26 16:18:55 -08:00
Ali Cirik
36fc9820cb Show rss links if RSS is not in disableKinds (#15)
* If RSS is disabled in the configuration using `disableKinds`, the "rss" link in the footer won't show up
2018-12-26 16:49:41 +08:00
Track3
2b5999616d Add translation for toc title 2018-12-24 22:56:07 +08:00
Track3
feb4c38717 Add basic toc support 2018-12-24 22:17:22 +08:00
Track3
0abf3ea012 Add example for figure Shortcode 2018-12-24 17:36:17 +08:00
Track3
67f9b4167a Adjust style
<figure>, footnotes, <hr> etc.
2018-12-16 00:02:21 +08:00
Track3
8711c169be Add i18n support for translation of strings
* Also add Simplified Chinese translations
* See #3
2018-12-14 15:17:48 +08:00
Samuel Guyah
c128b75243 Update README (#11)
* Update README.md

Following the proposed set-up on https://gohugo.io/getting-started/quick-start/ , I added the instructions for downloading the theme as a submodule.
2018-12-14 13:00:05 +08:00
Track3
561dc2ae87 Output year based on the current local time
For footer copyright message
2018-12-13 16:20:03 +08:00
Track3
3876e51665 Remove screen-reader-text (#8) 2018-12-12 19:52:58 +08:00
Track3
3bb532df30 Improve code quality & consistency
* Add EditorConfig
* Rebuild animate.css: remove an unused animation
* Slightly rewrite header part
2018-12-12 00:02:36 +08:00
Track3
caf088cbfb Fix Disqus
* Use Hugo's built-in disqus template
* Add some extra style
* See #9
2018-12-11 13:41:01 +08:00
Track3
50fe5d1045 Add shorthand emoji support by default
* Add enableEmoji option in example config.toml
* Update the demo content
* Closes #7
2018-12-01 13:24:28 +08:00
Track3
52d0c69421 Merge pull request #5 from pin3da/master
Add gitlab to social icons
2018-11-29 11:24:59 +08:00
Manuel Pineda
09bbd88cfb Update social icons 2018-11-28 13:29:17 -02:00
Manuel Pineda
814ef2bfb7 Add gitlab in sgv.html 2018-11-28 13:28:40 -02:00
Track3
0e1ceb690c Update example config.toml 2018-11-28 15:49:29 +08:00
Track3
61f76591cb Merge pull request #4 from ceriath/patch-1
Keep line-endings on checkout
2018-11-28 14:03:26 +08:00
Ceriath
d6b0fad0f1 Keep line-endings on checkout
Had the same issue as #1 - by telling git to always keep the LF line-endings people will not run into this issue anymore
2018-11-27 22:17:28 +01:00
Track3
e594f1a494 Add homepage background image
See #2
2018-11-22 21:33:07 +08:00
Track3
0a0ee1a1c7 Regenerate resources/ 2018-11-20 13:31:54 +08:00
Track3
44dbcd6f34 First commit 2018-10-23 13:15:50 +08:00
64 changed files with 4175 additions and 34 deletions

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "themes/hermit"]
path = themes/hermit
url = https://github.com/vojta001/hermit.git

18
flake.lock generated
View File

@@ -1,22 +1,5 @@
{
"nodes": {
"hermit": {
"flake": false,
"locked": {
"lastModified": 1622561639,
"narHash": "sha256-Zw/+3EE6DAQ4NS1i22vadXwDEo6CnJkByy7IpdGuRYM=",
"owner": "vojta001",
"repo": "hermit",
"rev": "56843f347a642324970ba30d58f23c64e037bb7c",
"type": "github"
},
"original": {
"owner": "vojta001",
"ref": "tmp",
"repo": "hermit",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1662096612,
@@ -35,7 +18,6 @@
},
"root": {
"inputs": {
"hermit": "hermit",
"nixpkgs": "nixpkgs"
}
}

View File

@@ -3,12 +3,7 @@
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.hermit = {
url = "github:vojta001/hermit/tmp";
flake = false;
};
outputs = { self, nixpkgs, hermit }:
outputs = { self, nixpkgs, }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
@@ -18,12 +13,6 @@
pname = "vkane.cz";
version = "";
src = self;
# the theme is included as a submodule, and with nix it is an alchemy whether it is somehow included or not (in which case the empty parent directory might be missing)
preConfigure = ''
rm --dir --force themes/hermit
mkdir -p themes
ln --symbolic '${hermit}' themes/hermit
'';
buildPhase = ''
'${pkgs.hugo}'/bin/hugo --buildExpired --buildFuture --destination "$out" --minify --printPathWarnings --printI18nWarnings
'';

Submodule themes/hermit deleted from 56843f347a

View File

@@ -0,0 +1,20 @@
# editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.{html,xml}]
indent_style = tab
[*.md]
indent_style = unset
indent_size = unset
insert_final_newline = unset
trim_trailing_whitespace = unset

2
themes/hermit/.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
* text eol=lf
*.png binary

20
themes/hermit/LICENSE Normal file
View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2018 Track3
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

118
themes/hermit/README.md Executable file
View File

@@ -0,0 +1,118 @@
# Hugo theme Hermit
[![Netlify Status](https://api.netlify.com/api/v1/badges/01a2e2de-d57d-4d89-8322-95685000e60f/deploy-status)](https://app.netlify.com/sites/hugo-theme-hermit/deploys)
Hermit is a minimal and fast theme for Hugo. It's built for bloggers who want a simple and focused website.
![](https://github.com/Track3/hermit/raw/master/images/screenshot.png)
## Features
* A single-column layout and carefully crafted typography offers a great reading experience.
* Navigations and functions are placed in the bottom bar which will hide when you scroll down.
* Featured image is supported. It will be displayed as a dimmed background of the page.
* Displays all of your posts on a single page, with one section per year, simple and compact.
* Extremely lightweight and load fast. No third party framework, no unnecessary code.
* All code fields feature syntax highlighting and a code-copy function
* Responsive & Retina Ready. Scales gracefully from a big screen all the way down to the smallest mobile phone. Assets in vector format ensures that it looks sharp on high-resolution screens.
**[Theme Demo](https://hugo-theme-hermit.netlify.com/)** (uses contents and config from the `exampleSite` folder)
![](https://github.com/Track3/hermit/raw/master/images/hermit.png)
## Getting started
### Installation
Run this command from the root of your Hugo directory:
```bash
$ git clone https://github.com/Track3/hermit.git themes/hermit
```
Or, if your Hugo site is already in git, you can include this repository as a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules). This makes it easier to update this theme. For this you need to run:
```bash
$ git submodule add https://github.com/Track3/hermit.git themes/hermit
```
Alternatively, if you are not familiar with git, you can download the theme as a `.zip` file, unzip the theme contents, and then move the unzipped source into your `themes` directory.
For more information, read the official [documentation](https://gohugo.io/themes/installing-and-using-themes/) of Hugo.
### Configuration
The example config file can be found in the theme's `exampleSite` folder. You can just copy the `config.toml` to the root directory of your Hugo site. There are instructions in the example config file, feel free to change strings as you like to customize your website.
#### Favicon
Use [RealFaviconGenerator](https://realfavicongenerator.net/) to generate these files, put them into your site's `static` folder:
* android-chrome-192x192.png
* android-chrome-512x512.png
* apple-touch-icon.png
* favicon-16x16.png
* favicon-32x32.png
* favicon.ico
* mstile-150x150.png
* safari-pinned-tab.svg
* site.webmanifest
#### Social icons
The following icons are supported, please make sure the `name` filed is exactly one of these:
| name | | | |
| --------------- | ----------- | ------------ | --------- |
| `email` | `codepen` | `facebook` | `github` |
| `gitlab` | `instagram` | `linkedin` | `slack` |
| `stackoverflow` | `telegram` | `twitter` | `youtube` |
| `shutterstock` | `freepik` | `adobestock` | `123rf` |
| `dreamstime` | `dribbble` | `behance` | `paypal` |
| `twitch` | | | |
If that's not enough, you can see [Overriding templates](#overriding-templates) section.
### Manage content
* Keep your regular pages in the `content` folder. To create a new page, run `hugo new page-title.md`
* Keep your blog posts in the `content/posts` folder. To create a new post, run `hugo new posts/post-title.md`
### More customizations
#### Overriding templates
In Hugo, layouts can live in either the projects (root) or the themes layout folders, any template inside the root layout folder will override theme's layout that relative to it, for example: `layouts/_default/baseof.html` will override `themes/hermit/layouts/_default/baseof.html`. So, you can easily customize the theme without edit it directly, which makes updating the theme easier. Here's some common customizations:
##### Customize social icons
You can modify or add any svg icons in site's `layouts/partials/svg.html`.
##### Customize comment system
We only have built-in support for Disqus at the moment, if that doesn't fit your needs, you can just add html to site's `layouts/partials/comments.html`.
##### Add custom analytics
If you prefer to use different analytics system other than google analytics, then add them inside `layouts/partials/analytics.html`.
#### Customize CSS
If you'd like to customize theme color or fonts, you can simply override `assets/scss/_predefined.scss`, by simply copy it to site's root (keep the same relative path) then edit those variables. But keep in mind, you'll need **Hugo extended version** which has the ability to rebuild SCSS. You don't have to use extended version in production but in this case it's necessary to make sure the `resources` folder is committed and "up to date" (by running `hugo` or `hugo server` locally using the extended version). But anyway, always use the extended version if you can.
For adding other custom CSS to the theme, you can assign an array of references in `config.toml` like following:
```
[params]
customCSS = ["css/foo.css", "css/bar.css"]
```
You may reference as many stylesheets as you want. Their paths need to be relative to the `static` folder or it can be a full URL for external resources.
#### Code injection
You can inject any html code to every page's document head or right above the closing body tag. This makes it easier to add any html meta data, custom css/js, dns-prefetch etc. To do this you simply need to create a file at site's `layouts/partials/extra-head.html` or `layouts/partials/extra-foot.html`, code inside will be injected to every page.
## Acknowledgments
* [normalize.css](https://necolas.github.io/normalize.css/) - [MIT](https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
* [animate.css](https://daneden.github.io/animate.css/) - [MIT](https://github.com/daneden/animate.css/blob/master/LICENSE)
* [feather](https://feathericons.com/) - [MIT](https://github.com/feathericons/feather/blob/master/LICENSE)
* [code-copy.js](assets/js/code-copy.js) - [Tom Spencer](https://www.fiznool.com/blog/2018/09/14/adding-click-to-copy-buttons-to-a-hugo-powered-blog/)
Thanks!

View File

@@ -0,0 +1,8 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
comments: false
images:
---

View File

@@ -0,0 +1,10 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
toc: false
images:
tags:
- untagged
---

View File

@@ -0,0 +1,56 @@
/**
* Utils
*/
// Add code-copy buttons using progressive enhancement
// © 2019. Tom Spencer
// https://www.fiznool.com/blog/2018/09/14/adding-click-to-copy-buttons-to-a-hugo-powered-blog/
(function() {
'use strict';
if(!document.queryCommandSupported('copy')) {
return;
}
function flashCopyMessage(el, msg) {
el.textContent = msg;
setTimeout(function() {
el.textContent = "Copy";
}, 1000);
}
function selectText(node) {
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(node);
selection.removeAllRanges();
selection.addRange(range);
return selection;
}
function addCopyButton(containerEl) {
var copyBtn = document.createElement("button");
copyBtn.className = "highlight-copy-btn";
copyBtn.textContent = "Copy";
var codeEl = containerEl.firstElementChild;
copyBtn.addEventListener('click', function() {
try {
var selection = selectText(codeEl);
document.execCommand('copy');
selection.removeAllRanges();
flashCopyMessage(copyBtn, 'Copied!')
} catch(e) {
console && console.log(e);
flashCopyMessage(copyBtn, 'Failed :\'(')
}
});
containerEl.appendChild(copyBtn);
}
// Add copy button to code blocks
var highlightBlocks = document.getElementsByClassName('highlight');
Array.prototype.forEach.call(highlightBlocks, addCopyButton);
})();

View File

@@ -0,0 +1,39 @@
// addEventListener Helper
//
const listen = (ele, e, callback) => {
if (document.querySelector(ele) !== null) {
document.querySelector(ele).addEventListener(e, callback);
}
}
let header = document.getElementById('site-header');
// Mobile Menu Toggle
//
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;
}
}
// ToC Toggle
//
const toggleToc = () => {
document.getElementById('toc').classList.toggle('show-toc');
}
if (header !== null) {
listen('#menu-btn', "click", toggleMobileMenu);
listen('#toc-btn', "click", toggleToc);
}

View File

@@ -0,0 +1,11 @@
@charset "UTF-8";
/*!
* animate.css -https://daneden.github.io/animate.css/
* Version - 3.7.0
* Licensed under the MIT license - http://opensource.org/licenses/MIT
*
* Copyright (c) 2019 Daniel Eden
*/
@keyframes bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:translateZ(0)}}.bounceInRight{animation-name:bounceInRight}@keyframes bounceOutRight{20%{opacity:1;transform:translate3d(-20px,0,0)}to{opacity:0;transform:translate3d(2000px,0,0)}}.bounceOutRight{animation-name:bounceOutRight}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fadeIn{animation-name:fadeIn}.animated{animation-duration:1s;animation-fill-mode:both}.animated.infinite{animation-iteration-count:infinite}.animated.fast{animation-duration:.8s}.animated.faster{animation-duration:.5s}.animated.slow{animation-duration:2s}@media (prefers-reduced-motion),(print){.animated{animation:unset!important;transition:none!important}}

View File

@@ -0,0 +1,341 @@
/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

View File

@@ -0,0 +1,33 @@
// Colors
//
$theme: #018574;
$text: #e8eef2;
$light-grey: #494f5c;
$dark-grey: #3B3E48;
$highlight-grey: #7d828a;
$midnightblue: #2c3e50;
// Fonts
//
$fonts: "Trebuchet MS", Verdana, "Verdana Ref", "Segoe UI", Candara, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif;
$code-fonts: Consolas, "Andale Mono WT", "Andale Mono", Menlo, Monaco, "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, "YaHei Consolas Hybrid", monospace, "Segoe UI Emoji", "PingFang SC", "Microsoft YaHei";
// Mixins
//
@mixin dimmed {
opacity: .6;
}
@mixin aTag {
a {
word-wrap: break-word;
border: none;
box-shadow: inset 0 -4px 0 $theme;
transition-property: box-shadow;
transition-duration: .1s;
&:hover {
box-shadow: inset 0 -1em 0 $theme;
}
}
}

View File

@@ -0,0 +1,59 @@
/* Background */ .chroma { color: #eee; background-color: $midnightblue }
/* Error */ .chroma .err { color: #960050; background-color: #1e0010 }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc }
/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
/* Keyword */ .chroma .k { color: #66d9ef }
/* KeywordConstant */ .chroma .kc { color: #66d9ef }
/* KeywordDeclaration */ .chroma .kd { color: #66d9ef }
/* KeywordNamespace */ .chroma .kn { color: #f92672 }
/* KeywordPseudo */ .chroma .kp { color: #66d9ef }
/* KeywordReserved */ .chroma .kr { color: #66d9ef }
/* KeywordType */ .chroma .kt { color: #66d9ef }
/* NameAttribute */ .chroma .na { color: #a6e22e }
/* NameClass */ .chroma .nc { color: #a6e22e }
/* NameConstant */ .chroma .no { color: #66d9ef }
/* NameDecorator */ .chroma .nd { color: #a6e22e }
/* NameException */ .chroma .ne { color: #a6e22e }
/* NameFunction */ .chroma .nf { color: #a6e22e }
/* NameOther */ .chroma .nx { color: #a6e22e }
/* NameTag */ .chroma .nt { color: #f92672 }
/* Literal */ .chroma .l { color: #ae81ff }
/* LiteralDate */ .chroma .ld { color: #e6db74 }
/* LiteralString */ .chroma .s { color: #e6db74 }
/* LiteralStringAffix */ .chroma .sa { color: #e6db74 }
/* LiteralStringBacktick */ .chroma .sb { color: #e6db74 }
/* LiteralStringChar */ .chroma .sc { color: #e6db74 }
/* LiteralStringDelimiter */ .chroma .dl { color: #e6db74 }
/* LiteralStringDoc */ .chroma .sd { color: #e6db74 }
/* LiteralStringDouble */ .chroma .s2 { color: #e6db74 }
/* LiteralStringEscape */ .chroma .se { color: #ae81ff }
/* LiteralStringHeredoc */ .chroma .sh { color: #e6db74 }
/* LiteralStringInterpol */ .chroma .si { color: #e6db74 }
/* LiteralStringOther */ .chroma .sx { color: #e6db74 }
/* LiteralStringRegex */ .chroma .sr { color: #e6db74 }
/* LiteralStringSingle */ .chroma .s1 { color: #e6db74 }
/* LiteralStringSymbol */ .chroma .ss { color: #e6db74 }
/* LiteralNumber */ .chroma .m { color: #ae81ff }
/* LiteralNumberBin */ .chroma .mb { color: #ae81ff }
/* LiteralNumberFloat */ .chroma .mf { color: #ae81ff }
/* LiteralNumberHex */ .chroma .mh { color: #ae81ff }
/* LiteralNumberInteger */ .chroma .mi { color: #ae81ff }
/* LiteralNumberIntegerLong */ .chroma .il { color: #ae81ff }
/* LiteralNumberOct */ .chroma .mo { color: #ae81ff }
/* Operator */ .chroma .o { color: #f92672 }
/* OperatorWord */ .chroma .ow { color: #f92672 }
/* Comment */ .chroma .c { color: #75715e }
/* CommentHashbang */ .chroma .ch { color: #75715e }
/* CommentMultiline */ .chroma .cm { color: #75715e }
/* CommentSingle */ .chroma .c1 { color: #75715e }
/* CommentSpecial */ .chroma .cs { color: #75715e }
/* CommentPreproc */ .chroma .cp { color: #75715e }
/* CommentPreprocFile */ .chroma .cpf { color: #75715e }
/* GenericDeleted */ .chroma .gd { color: #f92672 }
/* GenericEmph */ .chroma .ge { font-style: italic }
/* GenericInserted */ .chroma .gi { color: #a6e22e }
/* GenericStrong */ .chroma .gs { font-weight: bold }
/* GenericSubheading */ .chroma .gu { color: #75715e }

View File

@@ -0,0 +1,898 @@
@import "predefined.scss";
@import "normalize.scss";
@import "syntax.scss";
@import "animate.scss";
/* Webkit Scrollbar Customize */
::-webkit-scrollbar {
width: 8px;
height: 8px;
background: $midnightblue;
}
::-webkit-scrollbar-thumb {
background: #888;
&:hover {
background: $text;
}
}
html {
background: $light-grey;
line-height: 1.6;
letter-spacing: .06em;
scroll-behavior: smooth;
}
body,
button,
input,
select,
textarea {
color: $text;
font-family: $fonts;
}
pre,
code,
pre tt {
font-family: $code-fonts;
}
pre {
padding: .7em 1.1em;
overflow: auto;
font-size: .9em;
line-height: 1.5;
letter-spacing: normal;
white-space: pre;
color: #eee;
background: $midnightblue;
border-radius: 4px;
// -webkit-overflow-scrolling: touch;
code {
padding: 0;
margin: 0;
background: $midnightblue;
}
}
code {
color: #eee;
background: $highlight-grey;
border-radius: 3px;
padding: 0 3px;
margin: 0 4px;
word-wrap: break-word;
letter-spacing: normal;
}
blockquote {
border-left: .25em solid;
margin: 1em;
padding: 0 1em;
font-style: italic;
cite {
font-weight: bold;
font-style: normal;
&::before {
content: "—— ";
}
}
}
a {
color: $text;
text-decoration: none;
border: none;
transition-property: color;
transition-duration: .4s;
transition-timing-function: ease-out;
&:hover {
color: #fff;
text-shadow: 0 0 1px #fff;
}
}
hr {
opacity: .2;
border-width: 0 0 5px 0;
border-style: dashed;
background: transparent;
width: 50%;
margin: 1.8em auto;
}
table {
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
width: 100%;
max-width: 100%;
th,
td {
padding: 1.5%;
border: 1px solid;
}
th {
font-weight: 700;
vertical-align: bottom;
}
}
.section-inner {
margin: 0 auto;
max-width: 1200px;
width: 93%;
}
.thin {
max-width: 720px;
margin: auto;
}
.feather {
display: inline-block;
vertical-align: -.125em;
width: 1em;
height: 1em;
}
.sub-menu {
font-size: .7em;
}
.desktop-only, .desktop-only-ib {
display: none;
}
// Code copy buttons
//
.highlight {
position: relative;
}
.highlight pre {
padding-right: 75px;
}
.highlight-copy-btn {
position: absolute;
bottom: 7px;
right: 7px;
border: 0;
border-radius: 4px;
padding: 1px;
font-size: 0.7em;
line-height: 1.8;
color: #fff;
background-color: #777;
opacity: 0.6;
min-width: 55px;
text-align: center;
}
.highlight-copy-btn:hover {
background-color: #666;
}
// Accessibility
//
.screen-reader-text {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute !important;
width: 1px;
word-wrap: normal !important;
}
.screen-reader-text:focus {
background-color: #f1f1f1;
border-radius: 3px;
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
clip: auto !important;
clip-path: none;
color: #21759b;
display: block;
font-size: 14px;
font-size: 0.875rem;
font-weight: bold;
height: auto;
left: 5px;
line-height: normal;
padding: 15px 23px 14px;
text-decoration: none;
top: 5px;
width: auto;
z-index: 100000;
}
// Header & Footer
//
#site-header {
position: fixed;
z-index: 1;
top: 0;
width: 100%;
box-sizing: border-box;
box-shadow: -1px -2px 3px rgba(0, 0, 0, 0.45);
background-color: $dark-grey;
}
.hdr-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
padding: .5em 0;
font-size: 1.2rem;
.site-branding {
display: inline-block;
margin-right: .8em;
font-size: 1.2em;
}
.site-nav {
display: inline-block;
font-size: 1.1em;
opacity: .8;
.has-children {
padding-right: .5em;
border-right: 2px solid $highlight-grey;
}
.sub-menu > a{
margin-left: .3em;
}
a {
margin-left: .8em;
}
}
}
.hdr-icons {
font-size: 1.2em;
}
.hdr-social {
display: inline-block;
margin-left: .6em;
&>a {
margin-left: .4em;
}
}
.hdr-btn {
border: none;
background: none;
padding: 0;
margin-left: .4em;
cursor: pointer;
}
#menu-btn {
display: none;
margin-left: .6em;
cursor: pointer;
}
#mobile-menu {
position: fixed;
top: 5em;
right: 1.5em;
display: none;
padding: .6em 1.8em;
z-index: 1;
box-sizing: border-box;
box-shadow: -1px -2px 3px 0px rgba(0, 0, 0, 0.45);
background-color: $dark-grey;
ul {
list-style: none;
margin: 0;
padding: 0;
line-height: 2;
font-size: 1.2em;
}
}
#site-footer {
text-align: center;
font-size: .9em;
margin-bottom: 96px;
margin-top: 64px;
p {
margin: 0;
}
}
// Spotlight
//
#spotlight {
display: flex;
min-height: 100vh;
flex-direction: column;
align-items: center;
justify-content: center;
max-width: 93%;
margin: auto;
font-size: 1.5rem;
&.error-404 {
flex-direction: row;
line-height: normal;
}
}
p.img-404 {
margin: 0;
svg {
width: 180px;
max-width: 100%;
height: auto;
}
}
.banner-404 {
margin-left: 2em;
h1 {
font-size: 3em;
margin: .5rem 0;
}
p {
margin-top: 0;
}
.btn-404 {
font-size: .8em;
a {
display: inline-block;
border: 2px solid $text;
border-radius: 5px;
padding: 5px;
transition-property: color, border-color;
&:first-child {
margin-right: 1em;
}
&:hover {
border-color: #fff;
}
svg {
margin-right: .5em;
}
}
}
}
#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;
}
}
#home-nav {
opacity: .8;
a {
display: block;
text-align: center;
margin-top: .5em;
}
}
#home-footer {
text-align: center;
font-size: .6em;
line-height: normal;
@include dimmed;
p {
margin-top: 0;
}
}
// list.html
//
.posts-group {
display: flex;
margin-bottom: 1.9em;
line-height: normal;
.post-year {
padding-top: 6px;
margin-right: 1.8em;
font-size: 1.6em;
@include dimmed;
&:hover {
text-decoration: underline;
cursor: pointer;
}
}
.posts-list {
flex-grow: 1;
margin: 0;
padding: 0;
list-style: none;
}
.post-item {
border-bottom: 1px $highlight-grey dashed;
a {
display: flex;
justify-content: space-between;
align-items: baseline;
padding: 12px 0;
}
}
.post-day {
flex-shrink: 0;
margin-left: 1em;
@include dimmed;
}
}
// single.html
//
.bg-img {
width: 100vw;
height: 100vh;
opacity: .03;
z-index: -1;
position: fixed;
top: 0;
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
transition: opacity .5s;
}
.show-bg-img {
z-index: 100;
opacity: 1;
cursor: pointer;
}
.post-header {
margin-top: 1.2em;
line-height: normal;
.post-meta {
font-size: .9em;
letter-spacing: normal;
@include dimmed;
}
h1 {
margin-top: .1em;
}
}
hr.post-end {
width: 50%;
margin-top: 1.6em;
margin-bottom: .8em;
margin-left: 0;
border-style: solid;
border-bottom-width: 4px;
}
.content {
{{- with .Site.Params.justifyContent }}
text-align: justify;
text-justify: inter-ideograph; //For IE/Edge
{{- end }}
@include aTag;
figure {
max-width: 100%;
height: auto;
margin: 0;
text-align: center;
p {
font-size: .8em;
font-style: italic;
@include dimmed;
}
}
figure.left {
float: left;
margin-right: 1.5em;
max-width: 50%;
}
figure.right {
float: right;
margin-left: 1.5em;
max-width: 50%;
}
figure.big {
max-width: 100vw;
}
img {
display: block;
max-width: 100%;
height: auto;
margin: auto;
border-radius: 4px;
}
ul,
ol {
padding: 0;
margin-left: 1.8em;
}
a.anchor {
float: left;
margin-left: -20px;
padding-right: 6px;
box-shadow: none;
opacity: .8;
&:hover {
background: none;
color: $theme;
opacity: 1;
}
svg {
display: inline-block;
width: 14px;
height: 14px;
vertical-align: baseline;
visibility: hidden;
}
&:focus svg {
visibility: visible;
}
}
h1:hover a.anchor svg,
h2:hover a.anchor svg,
h3:hover a.anchor svg,
h4:hover a.anchor svg,
h5:hover a.anchor svg,
h6:hover a.anchor svg {
visibility: visible;
}
}
.footnotes {
font-size: .85em;
a {
box-shadow: none;
text-decoration: underline;
transition-property: color;
&:hover {
background: transparent;
}
&.footnote-return {
text-decoration: none;
}
}
ol {
line-height: 1.8;
}
}
.footnote-ref a {
box-shadow: none;
text-decoration: none;
padding: 2px;
border-radius: 2px;
background-color: $midnightblue;
}
.post-info {
font-size: .8rem;
line-height: normal;
@include dimmed;
p {
margin: .8em 0;
}
a:hover {
border-bottom: 1px solid $theme;
}
svg {
margin-right: .8em;
}
.tag {
margin-right: .5em;
&::before {
content: "#"
}
}
}
#toc {
position: fixed;
left: 50%;
top: 0;
display: none;
}
.toc-title {
margin-left: 1em;
margin-bottom: .5em;
font-size: .8em;
font-weight: bold;
}
#TableOfContents {
font-size: .8em;
@include dimmed;
ul {
padding-left: 1em;
margin: 0;
}
&>ul {
list-style-type: none;
ul ul {
font-size: .9em;
}
}
a:hover {
border-bottom: $theme 1px solid;
}
}
.post-nav {
display: flex;
justify-content: space-between;
margin-top: 1.5em;
margin-bottom: 2.5em;
font-size: 1.2em;
a {
flex-basis: 50%;
flex-grow: 1;
}
.next-post {text-align: left; padding-right: 5px;}
.prev-post {text-align: right; padding-left: 5px;}
.post-nav-label {
font-size: .8em;
opacity: .8;
text-transform: uppercase;
}
}
.related-posts {
padding: .8em;
margin-top: 1.5em;
font-size: .8rem;
border: 3px dashed rgba(255, 255, 255, .2);
border-radius: 5px;
h2{
margin: 0;
line-height: normal;
}
ul {
margin-top: .5em;
margin-bottom: 0;
}
}
.site-main {
margin-top: 5em;
}
// Media Queries
//
@media (min-width: 800px) {
hr.post-end {
width: 40%;
}
}
@media (min-width: 960px) {
.site-main {
margin-top: 6em;
}
}
@media (min-width: 1300px) {
.site-main {
margin-top: 8em;
}
.desktop-only,
#toc.show-toc {
display: block;
}
.desktop-only-ib {
display: inline-block;
}
figure.left {
margin-left: -240px;
p {
text-align: left;
}
}
figure.right {
margin-right: -240px;
p {
text-align: right;
}
}
figure.big {
width: 1200px;
margin-left: -240px;
}
hr.post-end {
width: 30%;
}
#toc {
top: 13em;
margin-left: 370px;
max-width: 220px;
}
}
@media (min-width: 1800px) {
.site-main {
margin-top: 10em;
}
.section-inner {
max-width: 1600px;
}
.thin {
max-width: 960px;
}
figure.left {
max-width: 75%;
margin-left: -320px;
}
figure.right {
max-width: 75%;
margin-right: -320px;
}
figure.big {
width: 1600px;
margin-left: -320px;
}
hr.post-end {
width: 30%;
}
#toc {
top: 15em;
margin-left: 490px;
max-width: 300px;
}
}
@media (max-width: 760px) {
.hide-in-mobile,
.site-nav.hide-in-mobile {
display: none;
}
#menu-btn {
display: inline-block;
}
.posts-group {
display: block;
.post-year {
margin: -6px 0 4px;
}
}
#spotlight.error-404 {
flex-direction: column;
text-align: center;
.banner-404 {
margin: 0;
}
}
}
@media (max-width: 520px) {
.content figure.left,
.content figure.right {
float: unset;
max-width: 100%;
margin: 0;
}
hr.post-end {
width: 60%;
}
#mobile-menu {
right: 1.2em;
}
}

View File

@@ -0,0 +1,80 @@
baseURL = "https://example.com"
languageCode = "en-us"
defaultContentLanguage = "en"
title = "Hugo Hermit"
theme = "hermit"
# enableGitInfo = true
pygmentsCodefences = true
pygmentsUseClasses = true
# hasCJKLanguage = true # If Chinese/Japanese/Korean is your main content language, enable this to make wordCount works right.
rssLimit = 10 # Maximum number of items in the RSS feed.
copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License." # This message is only used by the RSS template.
enableEmoji = true # Shorthand emojis in content files - https://gohugo.io/functions/emojify/
# googleAnalytics = "UA-123-45"
# disqusShortname = "yourdiscussshortname"
[author]
name = "John Doe"
[blackfriday]
# hrefTargetBlank = true
# noreferrerLinks = true
# nofollowLinks = true
[taxonomies]
tag = "tags"
# Categories are disabled by default.
[params]
dateform = "Jan 2, 2006"
dateformShort = "Jan 2"
dateformNum = "2006-01-02"
dateformNumTime = "2006-01-02 15:04 -0700"
# Metadata mostly used in document's head
# description = ""
# images = [""]
themeColor = "#494f5c"
homeSubtitle = "A minimal and fast theme for Hugo."
footerCopyright = ' &#183; <a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener">CC BY-NC 4.0</a>'
# bgImg = "" # Homepage background-image URL
# Prefix of link to the git commit detail page. GitInfo must be enabled.
# gitUrl = "https://github.com/username/repository/commit/"
# Toggling this option needs to rebuild SCSS, requires Hugo extended version
justifyContent = false # Set "text-align: justify" to `.content`.
relatedPosts = false # Add a related content section to all single posts page
code_copy_button = true # Turn on/off the code-copy-button for code-fields
# Add custom css
# customCSS = ["css/foo.css", "css/bar.css"]
# Social Icons
# Check https://github.com/Track3/hermit#social-icons for more info.
[[params.social]]
name = "twitter"
url = "https://twitter.com/"
[[params.social]]
name = "instagram"
url = "https://instagram.com/"
[[params.social]]
name = "github"
url = "https://github.com/"
[menu]
[[menu.main]]
name = "Posts"
url = "posts/"
weight = 10
[[menu.main]]
name = "About"
url = "about-hugo/"
weight = 20

View File

@@ -0,0 +1,17 @@
+++
title = "About Hugo"
date = "2014-04-09"
+++
Hugo is the **worlds fastest framework for building websites**. It is written in Go.
It makes use of a variety of open source projects including:
* https://github.com/russross/blackfriday
* https://github.com/alecthomas/chroma
* https://github.com/muesli/smartcrop
* https://github.com/spf13/cobra
* https://github.com/spf13/viper
Learn more and contribute on [GitHub](https://github.com/gohugoio).

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,339 @@
+++
title = "(Hu)go Template Primer"
tags = [
"go",
"golang",
"templates",
"themes",
"development",
]
date = "2014-04-02"
toc = true
+++
Hugo uses the excellent [Go][] [html/template][gohtmltemplate] library for
its template engine. It is an extremely lightweight engine that provides a very
small amount of logic. In our experience that it is just the right amount of
logic to be able to create a good static website. If you have used other
template systems from different languages or frameworks you will find a lot of
similarities in Go templates.
This document is a brief primer on using Go templates. The [Go docs][gohtmltemplate]
provide more details.
## Introduction to Go Templates
Go templates provide an extremely simple template language. It adheres to the
belief that only the most basic of logic belongs in the template or view layer.
One consequence of this simplicity is that Go templates parse very quickly.
A unique characteristic of Go templates is they are content aware. Variables and
content will be sanitized depending on the context of where they are used. More
details can be found in the [Go docs][gohtmltemplate].
## Basic Syntax
Golang templates are HTML files with the addition of variables and
functions.
**Go variables and functions are accessible within {{ }}**
Accessing a predefined variable "foo":
{{ foo }}
**Parameters are separated using spaces**
Calling the add function with input of 1, 2:
{{ add 1 2 }}
**Methods and fields are accessed via dot notation**
Accessing the Page Parameter "bar"
{{ .Params.bar }}
**Parentheses can be used to group items together**
{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}
## Variables
Each Go template has a struct (object) made available to it. In hugo each
template is passed either a page or a node struct depending on which type of
page you are rendering. More details are available on the
[variables](/layout/variables) page.
A variable is accessed by referencing the variable name.
<title>{{ .Title }}</title>
Variables can also be defined and referenced.
{{ $address := "123 Main St."}}
{{ $address }}
## Functions
Go template ship with a few functions which provide basic functionality. The Go
template system also provides a mechanism for applications to extend the
available functions with their own. [Hugo template
functions](/layout/functions) provide some additional functionality we believe
are useful for building websites. Functions are called by using their name
followed by the required parameters separated by spaces. Template
functions cannot be added without recompiling hugo.
**Example:**
{{ add 1 2 }}
## Includes
When including another template you will pass to it the data it will be
able to access. To pass along the current context please remember to
include a trailing dot. The templates location will always be starting at
the /layout/ directory within Hugo.
**Example:**
{{ template "chrome/header.html" . }}
## Logic
Go templates provide the most basic iteration and conditional logic.
### Iteration
Just like in Go, the Go templates make heavy use of range to iterate over
a map, array or slice. The following are different examples of how to use
range.
**Example 1: Using Context**
{{ range array }}
{{ . }}
{{ end }}
**Example 2: Declaring value variable name**
{{range $element := array}}
{{ $element }}
{{ end }}
**Example 2: Declaring key and value variable name**
{{range $index, $element := array}}
{{ $index }}
{{ $element }}
{{ end }}
### Conditionals
If, else, with, or, & and provide the framework for handling conditional
logic in Go Templates. Like range, each statement is closed with `end`.
Go Templates treat the following values as false:
* false
* 0
* any array, slice, map, or string of length zero
**Example 1: If**
{{ if isset .Params "title" }}<h4>{{ index .Params "title" }}</h4>{{ end }}
**Example 2: If -> Else**
{{ if isset .Params "alt" }}
{{ index .Params "alt" }}
{{else}}
{{ index .Params "caption" }}
{{ end }}
**Example 3: And & Or**
{{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
**Example 4: With**
An alternative way of writing "if" and then referencing the same value
is to use "with" instead. With rebinds the context `.` within its scope,
and skips the block if the variable is absent.
The first example above could be simplified as:
{{ with .Params.title }}<h4>{{ . }}</h4>{{ end }}
**Example 5: If -> Else If**
{{ if isset .Params "alt" }}
{{ index .Params "alt" }}
{{ else if isset .Params "caption" }}
{{ index .Params "caption" }}
{{ end }}
## Pipes
One of the most powerful components of Go templates is the ability to
stack actions one after another. This is done by using pipes. Borrowed
from unix pipes, the concept is simple, each pipeline's output becomes the
input of the following pipe.
Because of the very simple syntax of Go templates, the pipe is essential
to being able to chain together function calls. One limitation of the
pipes is that they only can work with a single value and that value
becomes the last parameter of the next pipeline.
A few simple examples should help convey how to use the pipe.
**Example 1 :**
{{ if eq 1 1 }} Same {{ end }}
is the same as
{{ eq 1 1 | if }} Same {{ end }}
It does look odd to place the if at the end, but it does provide a good
illustration of how to use the pipes.
**Example 2 :**
{{ index .Params "disqus_url" | html }}
Access the page parameter called "disqus_url" and escape the HTML.
**Example 3 :**
{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
Stuff Here
{{ end }}
Could be rewritten as
{{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }}
Stuff Here
{{ end }}
## Context (aka. the dot)
The most easily overlooked concept to understand about Go templates is that {{ . }}
always refers to the current context. In the top level of your template this
will be the data set made available to it. Inside of a iteration it will have
the value of the current item. When inside of a loop the context has changed. .
will no longer refer to the data available to the entire page. If you need to
access this from within the loop you will likely want to set it to a variable
instead of depending on the context.
**Example:**
{{ $title := .Site.Title }}
{{ range .Params.tags }}
<li> <a href="{{ $baseurl }}/tags/{{ . | urlize }}">{{ . }}</a> - {{ $title }} </li>
{{ end }}
Notice how once we have entered the loop the value of {{ . }} has changed. We
have defined a variable outside of the loop so we have access to it from within
the loop.
# Hugo Parameters
Hugo provides the option of passing values to the template language
through the site configuration (for sitewide values), or through the meta
data of each specific piece of content. You can define any values of any
type (supported by your front matter/config format) and use them however
you want to inside of your templates.
## Using Content (page) Parameters
In each piece of content you can provide variables to be used by the
templates. This happens in the [front matter](/content/front-matter).
An example of this is used in this documentation site. Most of the pages
benefit from having the table of contents provided. Sometimes the TOC just
doesn't make a lot of sense. We've defined a variable in our front matter
of some pages to turn off the TOC from being displayed.
Here is the example front matter:
```
---
title: "Permalinks"
date: "2013-11-18"
aliases:
- "/doc/permalinks/"
groups: ["extras"]
groups_weight: 30
notoc: true
---
```
Here is the corresponding code inside of the template:
{{ if not .Params.notoc }}
<div id="toc" class="well col-md-4 col-sm-6">
{{ .TableOfContents }}
</div>
{{ end }}
## Using Site (config) Parameters
In your top-level configuration file (eg, `config.yaml`) you can define site
parameters, which are values which will be available to you in chrome.
For instance, you might declare:
```yaml
params:
CopyrightHTML: "Copyright &#xA9; 2013 John Doe. All Rights Reserved."
TwitterUser: "spf13"
SidebarRecentLimit: 5
```
Within a footer layout, you might then declare a `<footer>` which is only
provided if the `CopyrightHTML` parameter is provided, and if it is given,
you would declare it to be HTML-safe, so that the HTML entity is not escaped
again. This would let you easily update just your top-level config file each
January 1st, instead of hunting through your templates.
```
{{if .Site.Params.CopyrightHTML}}<footer>
<div class="text-center">{{.Site.Params.CopyrightHTML | safeHtml}}</div>
</footer>{{end}}
```
An alternative way of writing the "if" and then referencing the same value
is to use "with" instead. With rebinds the context `.` within its scope,
and skips the block if the variable is absent:
```
{{with .Site.Params.TwitterUser}}<span class="twitter">
<a href="https://twitter.com/{{.}}" rel="author">
<img src="/images/twitter.png" width="48" height="48" title="Twitter: {{.}}"
alt="Twitter"></a>
</span>{{end}}
```
Finally, if you want to pull "magic constants" out of your layouts, you can do
so, such as in this example:
```
<nav class="recent">
<h1>Recent Posts</h1>
<ul>{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{end}}</ul>
</nav>
```
[go]: https://golang.org/
[gohtmltemplate]: https://golang.org/pkg/html/template/

View File

@@ -0,0 +1,84 @@
+++
title = "Getting Started with Hugo"
tags = [
"go",
"golang",
"hugo",
"development",
]
date = "2014-04-02"
toc = true
+++
## Step 1. Install Hugo
Go to [Hugo releases](https://github.com/spf13/hugo/releases) and download the
appropriate version for your OS and architecture.
Save it somewhere specific as we will be using it in the next step.
More complete instructions are available at [Install Hugo](https://gohugo.io/getting-started/installing/)
## Step 2. Build the Docs
Hugo has its own example site which happens to also be the documentation site
you are reading right now.
Follow the following steps:
1. Clone the [Hugo repository](http://github.com/spf13/hugo)
2. Go into the repo
3. Run hugo in server mode and build the docs
4. Open your browser to http://localhost:1313
Corresponding pseudo commands:
git clone https://github.com/spf13/hugo
cd hugo
/path/to/where/you/installed/hugo server --source=./docs
> 29 pages created
> 0 tags index created
> in 27 ms
> Web Server is available at http://localhost:1313
> Press ctrl+c to stop
Once you've gotten here, follow along the rest of this page on your local build.
## Step 3. Change the docs site
Stop the Hugo process by hitting Ctrl+C.
Now we are going to run hugo again, but this time with hugo in watch mode.
/path/to/hugo/from/step/1/hugo server --source=./docs --watch
> 29 pages created
> 0 tags index created
> in 27 ms
> Web Server is available at http://localhost:1313
> Watching for changes in /Users/spf13/Code/hugo/docs/content
> Press ctrl+c to stop
Open your [favorite editor](http://vim.spf13.com) and change one of the source
content pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*.
Content files are found in `docs/content/`. Unless otherwise specified, files
are located at the same relative location as the url, in our case
`docs/content/overview/quickstart.md`.
Change and save this file.. Notice what happened in your terminal.
> Change detected, rebuilding site
> 29 pages created
> 0 tags index created
> in 26 ms
Refresh the browser and observe that the typo is now fixed.
Notice how quick that was. Try to refresh the site before it's finished building. I double dare you.
Having nearly instant feedback enables you to have your creativity flow without waiting for long builds.
## Step 4. Have fun
The best way to learn something is to play with it.

View File

@@ -0,0 +1,151 @@
---
date: 2014-03-10
title: Migrate to Hugo from Jekyll
toc: true
---
## Move static content to `static`
Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output. Hugo keeps all static content under `static`. You should therefore move it all there.
With Jekyll, something that looked like
▾ <root>/
▾ images/
logo.png
should become
▾ <root>/
▾ static/
▾ images/
logo.png
Additionally, you'll want any files that should reside at the root (such as `CNAME`) to be moved to `static`.
## Create your Hugo configuration file
Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the [Hugo configuration documentation](/overview/configuration/) for details.
## Set your configuration publish folder to `_site`
The default is for Jekyll to publish to `_site` and for Hugo to publish to `public`. If, like me, you have [`_site` mapped to a git submodule on the `gh-pages` branch](http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html), you'll want to do one of two alternatives:
1. Change your submodule to point to map `gh-pages` to public instead of `_site` (recommended).
git submodule deinit _site
git rm _site
git submodule add -b gh-pages git@github.com:your-username/your-repo.git public
2. Or, change the Hugo configuration to use `_site` instead of `public`.
{
..
"publishdir": "_site",
..
}
## Convert Jekyll templates to Hugo templates
That's the bulk of the work right here. The documentation is your friend. You should refer to [Jekyll's template documentation](http://jekyllrb.com/docs/templates/) if you need to refresh your memory on how you built your blog and [Hugo's template](/layout/templates/) to learn Hugo's way.
As a single reference data point, converting my templates for [heyitsalex.net](http://heyitsalex.net/) took me no more than a few hours.
## Convert Jekyll plugins to Hugo shortcodes
Jekyll has [plugins](http://jekyllrb.com/docs/plugins/); Hugo has [shortcodes](/doc/shortcodes/). It's fairly trivial to do a port.
### Implementation
As an example, I was using a custom [`image_tag`](https://github.com/alexandre-normand/alexandre-normand/blob/74bb12036a71334fdb7dba84e073382fc06908ec/_plugins/image_tag.rb) plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing.
Jekyll's plugin:
module Jekyll
class ImageTag < Liquid::Tag
@url = nil
@caption = nil
@class = nil
@link = nil
// Patterns
IMAGE_URL_WITH_CLASS_AND_CAPTION =
IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i
IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i
IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
def initialize(tag_name, markup, tokens)
super
if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
@class = $1
@url = $3
@caption = $7
@link = $9
elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION
@class = $1
@url = $3
@caption = $7
elsif markup =~ IMAGE_URL_WITH_CAPTION
@url = $1
@caption = $5
elsif markup =~ IMAGE_URL_WITH_CLASS
@class = $1
@url = $3
elsif markup =~ IMAGE_URL
@url = $1
end
end
def render(context)
if @class
source = "<figure class='#{@class}'>"
else
source = "<figure>"
end
if @link
source += "<a href=\"#{@link}\">"
end
source += "<img src=\"#{@url}\">"
if @link
source += "</a>"
end
source += "<figcaption>#{@caption}</figcaption>" if @caption
source += "</figure>"
source
end
end
end
Liquid::Template.register_tag('image', Jekyll::ImageTag)
is written as this Hugo shortcode:
<!-- image -->
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
{{ if .Get "link"}}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>{{ if isset .Params "title" }}
{{ .Get "title" }}{{ end }}
{{ if or (.Get "caption") (.Get "attr")}}<p>
{{ .Get "caption" }}
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
{{ .Get "attr" }}
{{ if .Get "attrlink"}}</a> {{ end }}
</p> {{ end }}
</figcaption>
{{ end }}
</figure>
<!-- image -->
### Usage
I simply changed:
{% image full http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg "One of my favorite touristy-type photos. I secretly waited for the good light while we were "having fun" and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." ->http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/ %}
to this (this example uses a slightly extended version named `fig`, different than the built-in `figure`):
{{%/* fig class="full" src="http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg" title="One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." link="http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/" */%}}
As a bonus, the shortcode named parameters are, arguably, more readable.
## Finishing touches
### Fix content
Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that `hugo server --watch` is your friend. Test your changes and fix errors as needed.
### Clean up
You'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it.
## A practical example in a diff
[Hey, it's Alex](http://heyitsalex.net/) was migrated in less than a _father-with-kids day_ from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this [diff](https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610).

View File

@@ -0,0 +1,23 @@
---
title: "Post With Featured Image"
date: 2018-10-01T16:15:09+08:00
draft: false
images:
- https://picsum.photos/1024/768/?random
tags:
- Demo
- Image
---
Just define the image URL in the contents front matter, the featured image will be displayed as the background.
For example:
```yaml
---
images:
- https://picsum.photos/1024/768/?random
---
```
This is an array, you can set multiple urls, only the first url will be used. These images is also used in [Twitter Cards](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started.html) and the [Open Graph](http://ogp.me/) metadata.

View File

@@ -0,0 +1,41 @@
---
title: 'The "figure" Shortcode'
date: 2018-12-24T12:29:41+08:00
draft: false
featuredImg: ""
tags:
- demo
- image
---
Hugo has `figure` shortcode built in, so you can easily add figcaptions or hyperlink rel attributes to images. Documentations can be found here:
https://gohugo.io/content-management/shortcodes/#figure
This theme has 3 CSS classes made for figure elements:
* `big`: images will break the width limit of main content area.
* `left`: images will float to the left.
* `right`: images will float to the right.
If a figure has no class set, the image will behave just like a normal markdown image: `![]()`.
Here's some examples, please be aware that these styles only take effect when the page width is over 1300px.
{{< figure src="https://via.placeholder.com/1600x800" alt="image" caption="figure-normal (without any classes)" >}}
Pellentesque posuere sem nec nunc varius, id hendrerit arcu consequat. Maecenas commodo, sapien ut gravida porttitor, dolor risus facilisis enim, eget pharetra nibh nisl porttitor sapien. Proin finibus elementum ligula sit amet hendrerit. Praesent et erat sodales ante accumsan pharetra non eu nulla. Sed vehicula consequat lorem, a fermentum ante faucibus quis. Aliquam erat volutpat. In vitae tincidunt dui. Proin sit amet ligula sodales, elementum tortor et, venenatis sem. Maecenas non nisl erat. Curabitur nec velit eros. Ut cursus lacus nisi, non pretium libero euismod et. Fusce luctus in nisi quis sollicitudin. Aenean nec blandit ligula. Duis ac felis lorem. Proin tellus tellus, dictum nec tempus sit amet, venenatis ac felis. Sed in pharetra nulla, non mollis sem.
{{< figure src="https://via.placeholder.com/1600x800" alt="image" caption="figure-big" class="big" >}}
Suspendisse fringilla malesuada massa, in malesuada orci lacinia a. Praesent dapibus faucibus nisl, id volutpat elit bibendum eu. Nulla vitae laoreet nibh, eu hendrerit lacus. Donec lacinia auctor ligula, vel interdum ipsum malesuada vitae. Donec placerat a justo eu gravida. Aenean ultricies imperdiet convallis. Pellentesque accumsan non ex sed euismod. Proin bibendum lectus nec enim faucibus feugiat. Donec hendrerit nisi viverra ornare luctus. Nullam non viverra nisl. Nam vel tellus et tortor elementum volutpat sit amet et erat. Aliquam a libero quis libero porta consectetur. Etiam aliquam felis vel nulla mattis finibus. Mauris laoreet lacus arcu, sed rhoncus odio condimentum sed. Aenean in dui rutrum elit faucibus faucibus nec fringilla augue. Fusce non ornare mauris.
{{< figure src="https://via.placeholder.com/400x280" alt="image" caption="figure-left" class="left" >}}
In a libero varius, luctus ligula et, bibendum tortor. Sed sit amet dui malesuada, mattis justo id, ultricies enim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam sollicitudin cursus feugiat. Vivamus suscipit ipsum eget lobortis sollicitudin. Fusce vehicula neque tellus. Integer eu posuere quam, id laoreet tortor. Mauris sit amet turpis urna. Donec venenatis tempor dolor, nec laoreet orci aliquet et. Sed condimentum elit eu tristique aliquam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc luctus ipsum sit amet nisl maximus pellentesque.
{{< figure src="https://via.placeholder.com/400x280" alt="image" caption="figure-right" class="right" >}}
Pellentesque eu consequat nunc. Vivamus eu eros ut nulla dapibus molestie in id tortor. Cras viverra ligula erat, tincidunt hendrerit diam blandit nec. Cras id urna vel dolor dictum mattis. Vestibulum congue erat ac eros molestie accumsan. Maecenas lorem nibh, maximus vel justo eget, facilisis egestas lectus. Mauris eu est ut odio blandit consequat id feugiat eros. Fusce id suscipit mi, et lacinia lectus. Mauris a arcu placerat dolor iaculis feugiat nec non mi. Ut porttitor elit tortor, eget tempus velit mollis eu. Aliquam sem nulla, dictum cursus mauris ac, semper ullamcorper leo.
Donec nec tincidunt est. Sed id metus in erat fringilla mattis at id turpis. Aliquam tempor vehicula faucibus. Phasellus consequat aliquam odio. Morbi a ex vitae sapien porta auctor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec sit amet nulla arcu. Praesent ut tortor purus. Praesent id eros diam. Pellentesque vitae dolor at nibh ultrices accumsan eu id urna. Aliquam finibus interdum orci in varius. Pellentesque a enim condimentum, condimentum felis id, vehicula augue. Vivamus cursus commodo eros nec lacinia.

View File

@@ -0,0 +1,69 @@
---
title: "Typography"
date: 2018-09-29T11:36:33+08:00
draft: false
featuredImg: ""
tags:
- Demo
- Typography
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
> An apple is a sweet, edible fruit produced by an apple tree (Malus pumila). Apple trees are cultivated worldwide, and are the most widely grown species in the genus Malus. The tree originated in Central Asia, where its wild ancestor, Malus sieversii, is still found today. Apples have been grown for thousands of years in Asia and Europe, and were brought to North America by European colonists. Apples have religious and mythological significance in many cultures, including Norse, Greek and European Christian traditions.[^1]
---
Inline styles
**strong**, *emphasis*, ***strong and emphasis***,`code`, <u>underline</u>, ~~strikethrough~~, :joy:🤣, $\LaTeX$, X^2^, H~2~O, ==highlight==, [Link](https://example.com), and image:
![img](https://picsum.photos/600/400/?random)
---
Headings:
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Table:
| Left-Aligned | Center Aligned | Right Aligned |
| :------------ | :-------------: | ------------: |
| col 3 is | some wordy text | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
Lists:
* Unordered list item 1.
* Unordered list item 2.
1. ordered list item 1.
2. ordered list item 2.
+ sub-unordered list item 1.
+ sub-unordered list item 2.
+ [x] something is DONE.
+ [ ] something is NOT DONE.
Syntax Highlighting:
```javascript
var num1, num2, sum
num1 = prompt("Enter first number")
num2 = prompt("Enter second number")
sum = parseInt(num1) + parseInt(num2) // "+" means "add"
alert("Sum = " + sum) // "+" means combine into a string
```
[^1]: From https://en.wikipedia.org/wiki/Apple

View File

@@ -0,0 +1,38 @@
# Translations for English
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# 404.html
#
[notFound]
other = "Oops, page not found…"
[home]
other = "Home"
[archives]
other = "Archives"
# posts/single.html
#
[seeAlso]
other = "See Also"
[wordCount]
other = "{{ .WordCount }} Words"
[tableOfContents]
other = "Table of Contents"
[newer]
other = "Newer"
[older]
other = "Older"
# partials/header.html
#
[menu]
other = "Menu"
[featuredImage]
other = "Featured Image"

View File

@@ -0,0 +1,38 @@
# Translations for French
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# 404.html
#
[notFound]
other = "Oh non! page non-trouvée…"
[home]
other = "Accueil"
[archives]
other = "Archives"
# posts/single.html
#
[seeAlso]
other = "Voir également"
[wordCount]
other = "{{ .WordCount }} mots"
[tableOfContents]
other = "Sommaire"
[newer]
other = "Suivant"
[older]
other = "Précédent"
# partials/header.html
#
[menu]
other = "Menu"
[featuredImage]
other = "Image sélectionnée"

View File

@@ -0,0 +1,35 @@
# Translations for Italian
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# 404.html
#
[notFound]
other = "Oops, pagina non trovata…"
[home]
other = "Home"
[archives]
other = "Archivi"
# posts/single.html
#
[wordCount]
other = "{{ .WordCount }} Parole"
[tableOfContents]
other = "Sommario"
[newer]
other = "Prossimo"
[older]
other = "Precedente"
# partials/header.html
#
[menu]
other = "Menu"
[featuredImage]
other = "Immagine in primo piano"

View File

@@ -0,0 +1,38 @@
# Translations for Simplified Chinese - 简体中文
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# 404.html
#
[notFound]
other = "糟糕,您要访问的页面不存在……"
[home]
other = "主页"
[archives]
other = "归档"
# posts/single.html
#
[seeAlso]
other = "相关推荐"
[wordCount]
other = "{{ .WordCount }} 字"
[tableOfContents]
other = "目录"
[newer]
other = "新"
[older]
other = "旧"
# partials/header.html
#
[menu]
other = "菜单"
[featuredImage]
other = "特色图片"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

BIN
themes/hermit/images/tn.png Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,15 @@
{{ define "main" }}
<div id="spotlight" class="error-404 animated fadeIn">
<p class="img-404">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 167.8 163.4" fill="currentColor"><title>404-lighthouse</title><path d="M83,27.5c.5-8.4,12.5-8.4,13,0,.2,3.2,5.2,3.2,5,0C100.7,21.3,96,16,89.5,16S78.3,21.3,78,27.5c-.2,3.2,4.8,3.2,5,0Z" transform="translate(-6.6 -6.6)"/><path d="M92,18V9c0-3.2-5-3.2-5,0v9c0,3.2,5,3.2,5,0Z" transform="translate(-6.6 -6.6)"/><path d="M78,44.5l-7.9,86.7L69,143.5c-.3,3.2,4.7,3.2,5,0l7.9-86.7L83,44.5c.3-3.2-4.7-3.2-5,0Z" transform="translate(-6.6 -6.6)"/><path d="M96,44.5l7.9,86.7,1.1,12.3c.3,3.2,5.3,3.2,5,0l-7.9-86.7L101,44.5c-.3-3.2-5.3-3.2-5,0Z" transform="translate(-6.6 -6.6)"/><path d="M88.5,26.5v18a1,1,0,0,0,2,0v-18a1,1,0,0,0-2,0Z" transform="translate(-6.6 -6.6)"/><path d="M79.1,69.6l21.2-12.2a1.5,1.5,0,0,0-1.5-2.6L77.6,67a1.5,1.5,0,0,0,1.5,2.6Z" transform="translate(-6.6 -6.6)"/><path d="M76.4,99.2,102.7,84a1.5,1.5,0,0,0-1.5-2.6L74.9,96.6a1.5,1.5,0,0,0,1.5,2.6Z" transform="translate(-6.6 -6.6)"/><path d="M73.7,128.7l31.4-18.1a1.5,1.5,0,0,0-1.5-2.6L72.2,126.1a1.5,1.5,0,0,0,1.5,2.6Z" transform="translate(-6.6 -6.6)"/><path d="M98.5,42h-18L83,44.5v-18L80.5,29h18L96,26.5v18c0,3.2,5,3.2,5,0v-18A2.5,2.5,0,0,0,98.5,24h-18A2.5,2.5,0,0,0,78,26.5v18A2.5,2.5,0,0,0,80.5,47h18C101.7,47,101.7,42,98.5,42Z" transform="translate(-6.6 -6.6)"/><path d="M172,165c-5.8-.3-9.5-4.7-15.8-3.8-2.6.4-4.4,1.6-6.7,2.7s-6.9,1.3-10.2-.5-9.5-3.2-14.3-1c-3.3,1.5-5.6,3.3-9.5,2.4-2.4-.5-4.3-2.3-6.7-3.1a15.5,15.5,0,0,0-8.3-.3c-2.5.6-4.3,2.2-6.7,3.1-6.2,2.2-10.8-3.5-16.9-3.5s-10.7,5.6-17,3.5c-2.3-.8-4.2-2.5-6.7-3.1a15.4,15.4,0,0,0-8.3.3c-3.1,1-5.4,3.3-8.9,3.3s-5.8-2.2-8.9-3.3a15.4,15.4,0,0,0-8.8-.2c-3.4,1-5.7,3.3-9.5,3.5s-3.2,5.2,0,5c6-.3,10.9-5.5,17-3.5,2.4.8,4.2,2.5,6.7,3.1a15.4,15.4,0,0,0,8.3-.3c2.3-.8,4.2-2.5,6.7-3.1s6.3.9,9.5,2.4c4.8,2.3,9.8,1.5,14.3-1s6.7-2.2,10.2-.5,4.1,2.3,6.7,2.7a14.9,14.9,0,0,0,7.9-1c2.7-1.2,4.8-2.9,7.9-2.9s5.2,1.7,7.9,2.9a14.9,14.9,0,0,0,7.9,1c2.6-.4,4.4-1.6,6.7-2.7s6.9-1.3,10.2.5a15.9,15.9,0,0,0,16.1,0c7.3-3.9,11.9,2,19.1,2.3,3.2.2,3.2-4.8,0-5Z" transform="translate(-6.6 -6.6)"/><path d="M46.3,165.8l9.6-9.3c4.9-4.6,9.7-11.1,17.2-9.2,4.9,1.2,9.2,5.5,13,8.5s8,6.5,12.1,9.7c2.6,2,5-2.4,2.5-4.3-5-3.8-9.7-7.9-14.7-11.7s-8.7-7-14.6-7.6-11.2,3.6-15.9,8S47,158,42.7,162.2c-2.3,2.3,1.2,5.8,3.5,3.5Z" transform="translate(-6.6 -6.6)"/><path d="M84.8,152.8c8.3-3.7,16.7-8.3,26.1-5.6s15.5,9,19.4,16.6c1.5,2.9,5.8.3,4.3-2.5-4.5-8.7-12.9-16.2-22.4-18.9s-20.3,1.7-29.9,6.1c-2.9,1.3-.4,5.6,2.5,4.3Z" transform="translate(-6.6 -6.6)"/><g class="animated flash infinite slower" ><path d="M62.5,34h-23a1.5,1.5,0,0,0,0,3h23a1.5,1.5,0,0,0,0-3Z" transform="translate(-6.6 -6.6)"/><path d="M63.3,25.2l-18-9c-1.7-.9-3.2,1.7-1.5,2.6l18,9c1.7.9,3.2-1.7,1.5-2.6Z" transform="translate(-6.6 -6.6)"/><path d="M61.7,43.2l-18,9c-1.7.9-.2,3.5,1.5,2.6l18-9c1.7-.9.2-3.5-1.5-2.6Z" transform="translate(-6.6 -6.6)"/><path d="M116.5,37h23a1.5,1.5,0,0,0,0-3h-23a1.5,1.5,0,0,0,0,3Z" transform="translate(-6.6 -6.6)"/><path d="M117.3,27.8l18-9c1.7-.9.2-3.5-1.5-2.6l-18,9c-1.7.9-.2,3.5,1.5,2.6Z" transform="translate(-6.6 -6.6)"/><path d="M115.7,45.8l18,9c1.7.9,3.2-1.7,1.5-2.6l-18-9c-1.7-.9-3.2,1.7-1.5,2.6Z" transform="translate(-6.6 -6.6)"/></g></svg>
</p>
<div class="banner-404">
<h1>404</h1>
<p>{{ i18n "notFound" }}</p>
<p class="btn-404">
<a href="{{.Site.BaseURL}}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>{{ i18n "home" }}</a>
<a href="{{ "posts" | absLangURL }}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-archive"><polyline points="21 8 21 21 3 21 3 8"></polyline><rect x="1" y="3" width="22" height="5"></rect><line x1="10" y1="12" x2="14" y2="12"></line></svg>{{ i18n "archives" }}</a>
</p>
</div>
</div>
{{ end }}

View File

@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="{{.Site.LanguageCode}}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
{{- with .Site.Params.themeColor }}
<meta name="theme-color" content="{{.}}">
<meta name="msapplication-TileColor" content="{{.}}">
{{- end }}
{{- partial "structured-data.html" . }}
{{- partial "favicons.html" }}
<title>{{.Title}}</title>
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Title | safeHTML }}
{{ end -}}
{{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}}
<link rel="stylesheet" href="{{ $style.Permalink }}" {{ printf "integrity=%q" $style.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous">
{{- block "head" . -}}{{- end }}
{{- range .Site.Params.customCSS }}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}
{{- if templates.Exists "partials/extra-head.html" -}}
{{ partial "extra-head.html" . }}
{{- end }}
</head>
<body id="page">
{{ block "header" . -}}{{ end -}}
{{ block "main" . -}}{{ end -}}
{{ block "footer" . -}}{{ end }}
{{ $main := resources.Get "js/main.js" -}}
{{ if .Site.Params.code_copy_button | default true -}}
{{ $codeCopy := resources.Get "js/code-copy.js" -}}
{{ $script := slice $main $codeCopy | resources.Concat "js/bundle.js" | minify | fingerprint -}}
<script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
{{ else -}}
{{ $script := $main | minify | fingerprint -}}
<script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
{{ end }}
{{- partial "analytics.html" . }}
{{- if templates.Exists "partials/extra-foot.html" -}}
{{ partial "extra-foot.html" . }}
{{- end }}
</body>
</html>

View File

@@ -0,0 +1,33 @@
{{ define "header" }}
{{ partialCached "header.html" . }}
{{ end }}
{{ define "main" }}
<main class="site-main section-inner thin animated fadeIn faster">
<h1>{{ .Title }}</h1>
{{- if .Content }}
<div class="content">
{{ .Content }}
</div>
{{- end }}
{{- range .Data.Pages.GroupByDate "2006" }}
<div class="posts-group">
<div class="post-year"><a href="#{{ .Key }}">{{ .Key }}</a></div>
<ul class="posts-list">
{{- range .Pages }}
<li class="post-item">
<a href="{{.Permalink}}">
<span class="post-title">{{.Title}}</span>
<span class="post-day">{{ .Date.Format .Site.Params.dateformShort }}</span>
</a>
</li>
{{- end }}
</ul>
</div>
{{- end }}
</main>
{{ end }}
{{ define "footer" }}
{{ partialCached "footer.html" . }}
{{ end }}

View File

@@ -0,0 +1,34 @@
{{ define "head" }}
{{ if .Params.featuredImg -}}
<style>.bg-img {background-image: url('{{.Params.featuredImg}}');}</style>
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
<style>.bg-img {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}}
{{ end }}
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
{{- if (or .Params.images .Params.featuredImg) }}
<div class="bg-img"></div>
{{- end }}
<main class="site-main section-inner thin animated fadeIn faster">
<h1>{{ .Title }}</h1>
<div class="content">
{{ .Content | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg></a>${3}` | safeHTML }}
</div>
{{- if .Params.comments }}
<div id="comments" class="thin">
{{ partial "comments.html" . }}
</div>
{{- end }}
</main>
{{ end }}
{{ define "footer" }}
{{ partialCached "footer.html" . }}
{{ end }}

View File

@@ -0,0 +1,37 @@
{{ define "head" }}
{{ if .Site.Params.bgImg -}}
<style>.bg-img {background-image: url('{{.Site.Params.bgImg}}');}</style>
{{- else if .Site.Params.images -}}
{{- range first 1 .Site.Params.images -}}
<style>.bg-img {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}}
{{ end }}
{{ define "main" }}
{{- if (or .Site.Params.images .Site.Params.bgImg) }}
<div class="bg-img"></div>
{{- end }}
<div id="spotlight" class="animated fadeIn">
<div id="home-center">
<h1 id="home-title">{{ .Site.Title }}</h1>
{{- with .Site.Params.homeSubtitle }}
<p id="home-subtitle">{{.}}</p>
{{- end }}
{{- with .Site.Params.social }}
<div id="home-social">
{{ partialCached "social-icons.html" . }}
</div>
{{- end }}
<nav id="home-nav" class="site-nav">
{{ partialCached "menu.html" . }}
</nav>
</div>
<div id="home-footer">
<p>
&copy; {{ now.Format "2006" }} <a href="{{ .Site.BaseURL }}">{{ .Site.Author.name }}</a>{{ .Site.Params.footerCopyright | safeHTML }}
{{- with (not (in (.Site.Language.Get "disableKinds") "RSS")) }} &#183; <a href="{{ "posts/index.xml" | absLangURL }}" target="_blank" title="rss"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a>{{ end }}
</p>
</div>
</div>
{{ end }}

View File

@@ -0,0 +1 @@
{{ template "_internal/google_analytics_async.html" . }}

View File

@@ -0,0 +1,3 @@
{{- if .Site.DisqusShortname }}
{{ template "_internal/disqus.html" . }}
{{- end }}

View File

@@ -0,0 +1,6 @@
<link rel="apple-touch-icon" sizes="180x180" href="{{"apple-touch-icon.png" | relURL}}">
<link rel="icon" type="image/png" sizes="32x32" href="{{"favicon-32x32.png" | relURL}}">
<link rel="icon" type="image/png" sizes="16x16" href="{{"favicon-16x16.png" | relURL}}">
<link rel="manifest" href="{{"site.webmanifest" | relURL}}">
<link rel="mask-icon" href="{{"safari-pinned-tab.svg" | relURL}}" color="{{.Site.Params.themeColor}}">
<link rel="shortcut icon" href="{{"favicon.ico" | relURL}}">

View File

@@ -0,0 +1,7 @@
<footer id="site-footer" class="section-inner thin animated fadeIn faster">
<p>&copy; {{ now.Format "2006" }} <a href="{{ .Site.BaseURL }}">{{ .Site.Author.name }}</a>{{ .Site.Params.footerCopyright | safeHTML }}</p>
<p>
Made with <a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a> &#183; Theme <a href="https://github.com/Track3/hermit" target="_blank" rel="noopener">Hermit</a>
{{- with (not (in (.Site.Language.Get "disableKinds") "RSS")) }} &#183; <a href="{{ "posts/index.xml" | absLangURL }}" target="_blank" title="rss"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a>{{ end }}
</p>
</footer>

View File

@@ -0,0 +1,31 @@
<header id="site-header">
<div class="hdr-wrapper section-inner">
<div class="hdr-left">
<div class="site-branding">
<a href="{{.Site.BaseURL}}">{{ .Site.Title }}</a>
</div>
<nav class="site-nav hide-in-mobile">
{{ partialCached "menu.html" . }}
</nav>
</div>
<div class="hdr-right hdr-icons">
{{ if (or .Params.images .Params.featuredImg) -}}
<button id="img-btn" class="hdr-btn" title="{{i18n "featuredImage"}}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-image"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg></button>
{{- end }}
{{- with .Params.toc -}}
<button id="toc-btn" class="hdr-btn desktop-only-ib" title="{{i18n "tableOfContents"}}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3" y2="6"></line><line x1="3" y1="12" x2="3" y2="12"></line><line x1="3" y1="18" x2="3" y2="18"></line></svg></button>
{{- end }}
{{- with .Site.Params.social -}}
<span class="hdr-social hide-in-mobile">{{ partialCached "social-icons.html" . }}</span>
{{- end -}}
<button id="menu-btn" class="hdr-btn" title="{{i18n "menu"}}"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button>
</div>
</div>
</header>
<div id="mobile-menu" class="animated fast">
<ul>
{{- range .Site.Menus.main }}
<li><a href="{{ .URL | absLangURL }}">{{ .Name }}</a></li>
{{- end }}
</ul>
</div>

View File

@@ -0,0 +1,12 @@
{{- range .Site.Menus.main }}
{{- if .HasChildren }}
<a href="{{ .URL | absLangURL }}" class="has-children">{{ .Name }}</a>
<span class="sub-menu">
{{- range .Children }}
<a href="{{ .URL | absLangURL }}">{{ .Name }}</a>
{{- end }}
</span>
{{- else }}
<a href="{{ .URL | absLangURL }}">{{ .Name }}</a>
{{- end }}
{{- end }}

View File

@@ -0,0 +1,11 @@
{{- $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<div class="related-posts thin">
<h2>{{ i18n "seeAlso" }}</h2>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
</div>
{{ end -}}

View File

@@ -0,0 +1,3 @@
{{ range . -}}
<a href="{{ .url | safeURL }}" target="_blank" rel="noopener me" title="{{ .name | humanize }}">{{ partial "svg.html" . }}</a>
{{- end -}}

View File

@@ -0,0 +1,6 @@
{{/* We use some Hugo built-in templates, you can find their source here: */}}
{{/* https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}}
{{- template "_internal/schema.html" . }}
{{- template "_internal/opengraph.html" . }}
{{- template "_internal/twitter_cards.html" . }}

View File

@@ -0,0 +1,45 @@
{{- if (eq .name "codepen") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2"></polygon><line x1="12" y1="22" x2="12" y2="15.5"></line><polyline points="22 8.5 12 15.5 2 8.5"></polyline><polyline points="2 15.5 12 8.5 22 15.5"></polyline><line x1="12" y1="2" x2="12" y2="8.5"></line></svg>
{{- else if (eq .name "facebook") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg>
{{- else if (eq .name "github") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>
{{- else if (eq .name "gitlab") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"></path></svg>
{{- else if (eq .name "instagram") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path><line x1="17.5" y1="6.5" x2="17.5" y2="6.5"></line></svg>
{{- else if (eq .name "linkedin") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"></path><rect x="2" y="9" width="4" height="12"></rect><circle cx="4" cy="4" r="2"></circle></svg>
{{- else if (eq .name "slack") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22.08 9C19.81 1.41 16.54-.35 9 1.92S-.35 7.46 1.92 15 7.46 24.35 15 22.08 24.35 16.54 22.08 9z"></path><line x1="12.57" y1="5.99" x2="16.15" y2="16.39"></line><line x1="7.85" y1="7.61" x2="11.43" y2="18.01"></line><line x1="16.39" y1="7.85" x2="5.99" y2="11.43"></line><line x1="18.01" y1="12.57" x2="7.61" y2="16.15"></line></svg>
{{- else if (eq .name "stackoverflow") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2.913 16.041v6.848h17.599v-6.848M7.16 18.696h8.925M7.65 13.937l8.675 1.8M9.214 9.124l8.058 3.758M12.086 4.65l6.849 5.66M15.774 1.111l5.313 7.162"/></svg>
{{- else if (eq .name "telegram") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.198 2.433a2.242 2.242 0 0 0-1.022.215l-8.609 3.33c-2.068.8-4.133 1.598-5.724 2.21a405.15 405.15 0 0 1-2.849 1.09c-.42.147-.99.332-1.473.901-.728.968.193 1.798.919 2.286 1.61.516 3.275 1.009 4.654 1.472.509 1.793.997 3.592 1.48 5.388.16.36.506.494.864.498l-.002.018s.281.028.555-.038a2.1 2.1 0 0 0 .933-.517c.345-.324 1.28-1.244 1.811-1.764l3.999 2.952.032.018s.442.311 1.09.355c.324.022.75-.04 1.116-.308.37-.27.613-.702.728-1.196.342-1.492 2.61-12.285 2.997-14.072l-.01.042c.27-1.006.17-1.928-.455-2.474a1.654 1.654 0 0 0-1.034-.407z"/></svg>
{{- else if (eq .name "twitch") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 2H3v16h5v4l4-4h5l4-4V2zm-10 9V7m5 4V7"></path></svg>
{{- else if (eq .name "twitter") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path></svg>
{{- else if (eq .name "youtube") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"></path><polygon points="9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"></polygon></svg>
{{- else if (eq .name "email") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>
{{- else if (eq .name "dribbble") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle style="font-variation-settings:normal" cx="12.004" cy="12" r="9.39" paint-order="stroke fill markers"/><path style="font-variation-settings:normal" d="M5.858 19.136s2.343-5.79 8.161-6.422c5.818-.633 7.442.479 7.442.479M2.68 10.839s4.91.752 10.112-1.11c5.202-1.863 5.887-4.601 5.887-4.601"/><path style="font-variation-settings:normal" d="M8.533 3.208s2.888 2.73 5.339 9.235c2.451 6.505 2.344 8.4 2.344 8.4"/></svg>
{{- else if (eq .name "behance") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path paint-order="stroke fill markers" stroke-linejoin="miter" stroke-width="2" style="font-variation-settings:normal" d="M1.774 18.063V5.466h5.51c1.978 0 3.116 1.326 3.055 2.806-.043 1.049-.711 2.988-2.643 2.988h-5.93H7.73c1.224 0 3.532 1.13 3.532 3.532 0 2.4-1.873 3.27-3.318 3.27zm12.57-4.459h7.89s.012-4.18-4.167-4.18c-5.237 0-5.277 9.11-.3 9.11 3.06 0 3.935-1.806 3.935-1.806M15.526 5.823h4.987"/></svg>
{{- else if (eq .name "freepik") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5.737 17.28s3.423.84 7.61.162c4.188-.676 6.862-2.57 6.862-2.57s.28 3.943-4.967 5.33c-5.248 1.388-8.543.657-9.506-2.923zm-.62-3.104s4.491 1.361 8.728.344c4.237-1.016 5.94-2.568 5.94-2.568s-1.81-6.448-7.405-5.648c-5.597.8-8.061 4.414-7.263 7.872z" style="font-variation-settings:normal" stroke-linejoin="round"/><path d="M1.265 12.607c.159-1.98.561-3.898 2.08-5.701m5.148-3.29c2.006-.66 3.968-1.157 6.446-.844m5.202 2.98c1.192 1.275 1.963 2.163 2.594 3.815" style="font-variation-settings:normal" stroke="currentColor" stroke-linejoin="round"/><circle r=".989" cy="10.404" cx="14.746" fill="currentColor" stroke="none"/><circle cx="9.637" cy="11.305" r="1.477" fill="currentColor" stroke="none"/></svg>
{{- else if (eq .name "adobestock") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path style="font-variation-settings:normal" d="M2.235 2.235h19.53v19.53H2.235z"/><path style="font-variation-settings:normal" d="M6.165 16.659s3.16 1.2 4.602-.17c1.37-1.3.787-3.163-.754-4.05-1.68-.969-3.284-1.788-3.036-3.536.446-3.138 4.386-1.851 4.386-1.851M15.792 7.794v7.774c0 1.023.635 1.766 2.043 1.624M17.826 10.04h-3.582"/></svg>
{{- else if (eq .name "shutterstock") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect ry="5" rx="5" height="20" width="20" y="2" x="2"/><path d="M7.728 11.725V9.032c0-1.025.824-1.85 1.849-1.85h2.815m3.88 5.093v2.693a1.845 1.845 0 0 1-1.849 1.85h-2.815" stroke-linecap="square" stroke-linejoin="miter"/></svg>
{{- else if (eq .name "123rf") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path style="font-variation-settings:normal" d="M7.48 3.826c-.702 0-1.345.388-1.675 1.008l-.711 1.334a4.214 4.214 0 0 1-1.614 1.67l-.388.224a2.207 2.207 0 0 0-1.104 1.913v8.607c0 .878.712 1.592 1.59 1.592h1.186c.468 0 .916-.19 1.244-.524l1.478-1.504c.266-.27.628-.421 1.006-.421h7.04c.378 0 .74.151 1.005.421l1.478 1.504c.329.334.778.524 1.247.524h1.183c.879 0 1.592-.714 1.592-1.592V9.975c0-.79-.422-1.518-1.106-1.912l-.388-.225a4.214 4.214 0 0 1-1.613-1.67l-.711-1.334a1.899 1.899 0 0 0-1.676-1.008z" stroke-linejoin="miter"/><circle cx="12" cy="12.467" r="2.723"/></svg>
{{- else if (eq .name "dreamstime") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19.834 20.994s4.824-4.08 2.044-12.03C19.252 1.456 6.822-1.223 2.508 7.566c-3.936 8.023 2.18 14.46 7.88 14.374 4.889-.075 8.475-3.226 7.813-8.604-.76-6.18-6.73-6.816-9.275-4.184-2.256 2.334-1.816 7.034.873 7.823 2.241.844 4.661-1.265 3.161-3.215" style="font-variation-settings:normal" stroke="currentColor" stroke-linejoin="bevel" paint-order="stroke fill markers"/></svg>
{{- else if (eq .name "paypal") -}}
<svg xmlns="http://www.w3.org/2000/svg" class="feather" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7.144 19.532l1.049-5.751c.11-.606.691-1.002 1.304-.948 2.155.192 6.877.1 8.818-4.002 2.554-5.397-.59-7.769-6.295-7.769H7.43a1.97 1.97 0 0 0-1.944 1.655L2.77 19.507a.857.857 0 0 0 .846.994h2.368a1.18 1.18 0 0 0 1.161-.969zM7.967 22.522a.74.74 0 0 0 .666.416h2.313c.492 0 .923-.351 1.003-.837l.759-4.601c.095-.523.597-.866 1.127-.819 1.86.166 5.567-.118 6.85-3.821.554-1.6.705-2.954.408-4.018" style="font-variation-settings:normal" stroke="currentColor" stroke-linejoin="miter"/></svg>
{{- else -}}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
{{- end -}}

View File

@@ -0,0 +1,27 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end -}}
{{ range .Pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | html }}</description>
<content type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content>
</item>
{{ end }}
</channel>
</rss>

View File

@@ -0,0 +1,77 @@
{{ define "head" }}
{{ if .Params.featuredImg -}}
<style>.bg-img {background-image: url('{{.Params.featuredImg}}');}</style>
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
<style>.bg-img {background-image: url('{{. | absURL}}');}</style>
{{- end -}}
{{- end -}}
{{ end }}
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
{{- if (or .Params.images .Params.featuredImg) }}
<div class="bg-img"></div>
{{- end }}
<main class="site-main section-inner animated fadeIn faster">
<article class="thin">
<header class="post-header">
<div class="post-meta"><span>{{ .Date.Format .Site.Params.dateform }}</span></div>
<h1>{{ .Title }}</h1>
</header>
<div class="content">
{{ .Content | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg></a>${3}` | safeHTML }}
</div>
{{- if .Site.Params.relatedPosts }}
{{- partial "related-posts.html" . -}}
{{- end }}
<hr class="post-end">
<footer class="post-info">
{{- with $.Param "author" }}
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-feather"><path d="M20.24 12.24a6 6 0 0 0-8.49-8.49L5 10.5V19h8.5z"></path><line x1="16" y1="8" x2="2" y2="22"></line><line x1="17.5" y1="15" x2="9" y2="15"></line></svg>{{ . }}</p>
{{- end }}
{{- with .Params.tags }}
<p>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag meta-icon"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg>
{{- range . -}}
<span class="tag"><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">{{.}}</a></span>
{{- end }}
</p>
{{- end }}
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>{{ i18n "wordCount" . }}</p>
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>{{ dateFormat .Site.Params.dateformNumTime .Date.Local }}</p>
{{- if and .GitInfo .Site.Params.gitUrl }}
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}</p>
{{- end }}
</footer>
</article>
{{- if .Params.toc }}
<aside id="toc">
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
{{ .TableOfContents }}
</aside>
{{- end }}
<div class="post-nav thin">
{{- with .NextInSection }}
<a class="next-post" href="{{ .Permalink }}">
<span class="post-nav-label"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>&nbsp;{{ i18n "newer" }}</span><br><span>{{ .Title }}</span>
</a>
{{- end }}
{{- with .PrevInSection }}
<a class="prev-post" href="{{ .Permalink }}">
<span class="post-nav-label">{{ i18n "older" }}&nbsp;<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg></span><br><span>{{ .Title }}</span>
</a>
{{- end }}
</div>
<div id="comments" class="thin">
{{- partial "comments.html" . -}}
</div>
</main>
{{ end }}
{{ define "footer" }}
{{ partialCached "footer.html" . }}
{{ end }}

View File

@@ -0,0 +1,13 @@
[build]
base = "exampleSite"
command = "hugo --gc --themesDir ../.. -b $URL"
publish = "exampleSite/public"
[build.environment]
HUGO_THEME = "repo"
[context.deploy-preview]
command = "hugo --gc --themesDir ../.. -b $DEPLOY_PRIME_URL"
[context.branch-deploy]
command = "hugo --gc --themesDir ../.. -b $DEPLOY_PRIME_URL"

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"Target":"css/style.min.657bcb7af31123e4156b1a3d2ff60a636717e54ead74f882136b5114cf72b55e.css","MediaType":"text/css","Data":{"Integrity":"sha256-ZXvLevMRI+QVaxo9L/YKY2cX5U6tdPiCE2tRFM9ytV4="}}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#00aba9</TileColor>
</tile>
</msapplication>
</browserconfig>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1 @@
<svg version="1" xmlns="http://www.w3.org/2000/svg" width="666.667" height="666.667" viewBox="0 0 500.000000 500.000000"><path d="M0 250v250h500V0H0v250zm203.2-55l-.5 43H297v-86h29.9l-.1 107.5V367H297V263h-94v104h-29V152h29.8l-.6 43z"/></svg>

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 242 B

View File

@@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-384x384.png",
"sizes": "384x384",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

18
themes/hermit/theme.toml Normal file
View File

@@ -0,0 +1,18 @@
name = "Hermit"
license = "MIT"
licenselink = "https://github.com/Track3/hermit/blob/master/LICENSE"
description = "A minimal and fast hugo theme for bloggers."
homepage = "https://github.com/Track3/hermit"
tags = ["blog", "minimal", "dark", "responsive"]
features = [
"single column",
"featured image",
"social icons",
"google analytics",
"disqus"
]
min_version = 0.43
[author]
name = "Track3"
homepage = "https://www.xxxlbox.com"