submodule in own dir
|
@ -0,0 +1,28 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Steve Francia
|
||||
|
||||
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.
|
||||
|
||||
Staticman's reCAPTCHA support
|
||||
=================================================================================
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Original work Copyright (c) 2019 Praveen Lobo and Munif Tanjim
|
|
@ -0,0 +1,130 @@
|
|||
# Swift Theme
|
||||
|
||||
This theme is designed for blogging purposes. Feel free to extend it for other
|
||||
use cases though.
|
||||
|
||||
At its core, it's minimalistic; it doesn't rely on monolithic libraries such e.g
|
||||
jquery, bootstrap. Instead, it uses *grid css*, *flexbox* & *vanilla js* to
|
||||
facilitate the `features` outlined below:
|
||||
|
||||
![Hugo Swift Theme](https://github.com/onweru/hugo-swift-theme/blob/master/images/screenshot.png)
|
||||
|
||||
## Features
|
||||
|
||||
* Blog
|
||||
* Pagination
|
||||
* Responsive
|
||||
* Deeplinks
|
||||
* Dark Mode
|
||||
* Syntax Highlighting
|
||||
* [Staticman](#staticman-comments)
|
||||
* [reCAPTCHA](https://developers.google.com/recaptcha/docs/display)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
This theme uses `sass`. Ensure you have the [extended version of hugo](https://github.com/gohugoio/hugo/releases) installed or in your pipeline.
|
||||
|
||||
## Installation
|
||||
|
||||
Add this theme as a Git submodule inside your Hugo site folder:
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/onweru/hugo-swift-theme.git themes/hugo-swift-theme
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
You can configure the site using as follows:
|
||||
|
||||
1. ### General Information** and **Staticman config
|
||||
|
||||
Use the file `config.toml`.
|
||||
2. ### menu, footer
|
||||
|
||||
See the **data** files inside the `data/` directory.
|
||||
|
||||
> Follow the `exampleSite/`.
|
||||
3. Customize Theme colors
|
||||
You can do so easily in the [variables sass partial](https://github.com/onweru/hugo-swift-theme/blob/e5af8a1414cd8e1ec5a0817f8e5eb8c8c98e2676/assets/sass/_variables.sass#L13-L21). Use names (e.g red, blue, darkgoldenrod), rgb, rgba, hsla or hex values.
|
||||
|
||||
|
||||
## Staticman Comments
|
||||
|
||||
By default, [Staticman](https://staticman.net) comments are disabled.
|
||||
To enable them, you may refer to the
|
||||
[Staticman config Wiki](https://github.com/onweru/hugo-swift-theme/wiki/staticman-config).
|
||||
|
||||
## Written By Block
|
||||
|
||||
### How do I include a `written by` ?
|
||||
|
||||
1. Copy [this authors yaml file](https://github.com/onweru/hugo-swift-theme/blob/master/exampleSite/data/authors.yml) from the `exampleSite` to your data directory.
|
||||
|
||||
```yaml
|
||||
- name: "yourName" # if fullName 👇🏻 isn't set, name will be displayed on author card
|
||||
fullName: "John Doe" # optional. If set, it will display on author card
|
||||
photo: "myAvatar.jpg"
|
||||
url: "https://myURLofChoice.domain"
|
||||
bio: "It's time to flex. Write a short or not-so-short summary about yourself."
|
||||
```
|
||||
|
||||
2. Specify the name in your content files
|
||||
|
||||
```markdown
|
||||
...
|
||||
author: "yourName"
|
||||
...
|
||||
```
|
||||
### What if I want to exclude the `written by` from some articles?
|
||||
|
||||
Don't include an `author` in your article front matter.
|
||||
|
||||
The *authors.yml* file helps you:
|
||||
|
||||
1. Write all your author information in one place. This way, you only specify the author name on your content files (posts). The rest of the data i.e photo, url & bio are automatically pulled from the data file.
|
||||
|
||||
2. In certain situations, you may have different people publishing articles on your blog. For example, you could have someone guest blog. Or may be you have a blog co-author.
|
||||
|
||||
|
||||
## Deeplinks
|
||||
|
||||
For all content published using markdown, deeplinks will be added to the pages
|
||||
so that you can share with precision :smiley: Just hover on a heading and the
|
||||
link button will pop. Click it to copy.
|
||||
|
||||
## Dark Mode
|
||||
|
||||
Today most operating systems & browsers support dark mode. Like twitter, which
|
||||
automatically turns into dark mode when the user chooses darkmode, this theme
|
||||
does the same thing.
|
||||
|
||||
![Dark Mode](https://github.com/onweru/hugo-swift-theme/blob/master/images/darkmode.jpg)
|
||||
|
||||
## Custom Shortcodes
|
||||
|
||||
This theme ships with two custom shortcodes (they both use positional parameters):
|
||||
|
||||
1. __Video__
|
||||
This shortcode can be used to embed a youtube video with custom styling. It takes a solo positional parameter.
|
||||
|
||||
```
|
||||
...
|
||||
{{< video "youtubeVideoID" >}}
|
||||
...
|
||||
```
|
||||
|
||||
2. __Picture__
|
||||
You want to use darkmode images when darkmode is enabled on a device and a regular image on lightmode? It takes 3 positional parameter
|
||||
|
||||
Store these images in the `static/images` directory.
|
||||
|
||||
```
|
||||
...
|
||||
{{< picture "lightModeImage.png" "darkModeImage.png" "Image alt text" >}}
|
||||
...
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
The code is available under the
|
||||
[MIT license](https://github.com/onweru/hugo-swift-theme/blob/master/LICENSE.md).
|
|
@ -0,0 +1,636 @@
|
|||
function fileClosure(){
|
||||
// everything in this file should be declared within this closure (function).
|
||||
|
||||
// global variables
|
||||
let hidden;
|
||||
hidden = 'hidden';
|
||||
|
||||
const doc = document.documentElement;
|
||||
const parentURL = '{{ .Site.BaseURL }}';
|
||||
const staticman = Object.create(null);
|
||||
{{ with .Site.Params.staticman -}}
|
||||
const endpoint = '{{ .endpoint | default "https://staticman3.herokuapp.com" }}';
|
||||
const gitProvider = '{{ .gitprovider }}';
|
||||
const username = '{{ .username }}';
|
||||
const repository = '{{ .repository }}';
|
||||
const branch = '{{ .branch }}';
|
||||
|
||||
// store reCAPTCHA v2 site key and secret
|
||||
{{ with .recaptcha -}}
|
||||
staticman.siteKey = '{{ .sitekey }}';
|
||||
staticman.secret = '{{ .secret }}';
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
const translations = {
|
||||
success: {
|
||||
title: '{{ i18n "successTitle" }}',
|
||||
text: '{{ i18n "successMsg" }}',
|
||||
close: '{{ i18n "close" }}'
|
||||
},
|
||||
error: {
|
||||
title: '{{ i18n "errTitle" }}',
|
||||
text: '{{ i18n "errMsg" }}',
|
||||
close: '{{ i18n "close" }}'
|
||||
},
|
||||
discard: {
|
||||
title: '{{ i18n "discardComment" }}',
|
||||
button: '{{ i18n "discard" }}'
|
||||
},
|
||||
submit: '{{ i18n "btnSubmit" }}',
|
||||
submitted: '{{ i18n "btnSubmitted" }}'
|
||||
};
|
||||
|
||||
function isObj(obj) {
|
||||
return (obj && typeof obj === 'object' && obj !== null) ? true : false;
|
||||
}
|
||||
|
||||
function createEl(element = 'div') {
|
||||
return document.createElement(element);
|
||||
}
|
||||
|
||||
function elem(selector, parent = document){
|
||||
let elem = parent.querySelector(selector);
|
||||
return elem != false ? elem : false;
|
||||
}
|
||||
|
||||
function elems(selector, parent = document) {
|
||||
let elems = parent.querySelectorAll(selector);
|
||||
return elems.length ? elems : false;
|
||||
}
|
||||
|
||||
function pushClass(el, targetClass) {
|
||||
if (isObj(el) && targetClass) {
|
||||
elClass = el.classList;
|
||||
elClass.contains(targetClass) ? false : elClass.add(targetClass);
|
||||
}
|
||||
}
|
||||
|
||||
function deleteClass(el, targetClass) {
|
||||
if (isObj(el) && targetClass) {
|
||||
elClass = el.classList;
|
||||
elClass.contains(targetClass) ? elClass.remove(targetClass) : false;
|
||||
}
|
||||
}
|
||||
|
||||
function modifyClass(el, targetClass) {
|
||||
if (isObj(el) && targetClass) {
|
||||
elClass = el.classList;
|
||||
elClass.contains(targetClass) ? elClass.remove(targetClass) : elClass.add(targetClass);
|
||||
}
|
||||
}
|
||||
|
||||
function containsClass(el, targetClass) {
|
||||
if (isObj(el) && targetClass && el !== document ) {
|
||||
return el.classList.contains(targetClass) ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
function isChild(node, parentClass) {
|
||||
let objectsAreValid = isObj(node) && parentClass && typeof parentClass == 'string';
|
||||
return (objectsAreValid && node.closest(parentClass)) ? true : false;
|
||||
}
|
||||
|
||||
function elemAttribute(elem, attr, value = null) {
|
||||
if (value) {
|
||||
elem.setAttribute(attr, value);
|
||||
} else {
|
||||
value = elem.getAttribute(attr);
|
||||
return value ? value : false;
|
||||
}
|
||||
}
|
||||
|
||||
function deleteChars(str, subs) {
|
||||
let newStr = str;
|
||||
if (Array.isArray(subs)) {
|
||||
for (let i = 0; i < subs.length; i++) {
|
||||
newStr = newStr.replace(subs[i], '');
|
||||
}
|
||||
} else {
|
||||
newStr = newStr.replace(subs, '');
|
||||
}
|
||||
return newStr;
|
||||
}
|
||||
|
||||
function isBlank(str) {
|
||||
return (!str || str.trim().length === 0);
|
||||
}
|
||||
|
||||
function isMatch(element, selectors) {
|
||||
if(isObj(element)) {
|
||||
if(selectors.isArray) {
|
||||
let matching = selectors.map(function(selector){
|
||||
return element.matches(selector)
|
||||
})
|
||||
return matching.includes(true);
|
||||
}
|
||||
return element.matches(selectors)
|
||||
}
|
||||
}
|
||||
|
||||
(function updateDate() {
|
||||
var date = new Date();
|
||||
var year = date.getFullYear();
|
||||
elem('.year').innerHTML = year;
|
||||
})();
|
||||
|
||||
(function() {
|
||||
let bar = 'nav_bar-wrap';
|
||||
let navBar = elem(`.${bar}`);
|
||||
let nav = elem('.nav-body');
|
||||
let open = 'nav-open';
|
||||
let exit = 'nav-exit';
|
||||
let drop = 'nav-drop';
|
||||
let pop = 'nav-pop';
|
||||
let navDrop = elem(`.${drop}`);
|
||||
|
||||
function toggleMenu(){
|
||||
let menuOpen, menuPulled, status;
|
||||
modifyClass(navDrop, pop);
|
||||
modifyClass(navBar, hidden);
|
||||
menuOpen = containsClass(nav, open);
|
||||
menuPulled = containsClass(nav, exit);
|
||||
|
||||
status = menuOpen || menuPulled ? true : false;
|
||||
|
||||
status ? modifyClass(nav, exit) : modifyClass(nav, open);
|
||||
status ? modifyClass(nav, open) : modifyClass(nav, exit);
|
||||
}
|
||||
|
||||
navBar.addEventListener('click', function() {
|
||||
toggleMenu();
|
||||
});
|
||||
elem('.nav-close').addEventListener('click', function() {
|
||||
toggleMenu();
|
||||
});
|
||||
|
||||
elem('.nav-drop').addEventListener('click', function(e) {
|
||||
e.target === this ? toggleMenu() : false;
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
function convertToUnderScoreCase(str) {
|
||||
let char, newChar, newStr;
|
||||
newStr = '';
|
||||
if (typeof str == 'string') {
|
||||
for (let x = 0; x < str.length; x++) {
|
||||
char = str.charAt(x);
|
||||
if (char.match(/^[A-Z]*$/)) {
|
||||
char = char.toLowerCase();
|
||||
newChar = `_${char}`
|
||||
newStr += newChar;
|
||||
} else {
|
||||
newStr += char;
|
||||
}
|
||||
}
|
||||
return newStr;
|
||||
}
|
||||
}
|
||||
|
||||
function createModal(children, parent) {
|
||||
let body, modal, title;
|
||||
|
||||
modal = createEl();
|
||||
pushClass(modal, 'modal');
|
||||
body = createEl();
|
||||
pushClass(body, 'modal_inner');
|
||||
title = createEl('h3');
|
||||
pushClass(title, 'modal_title');
|
||||
body.appendChild(title);
|
||||
// add html specific to modal
|
||||
if (isObj(children)) {
|
||||
if (Array.isArray(children)) {
|
||||
children.map(function(child){
|
||||
body.appendChild(child);
|
||||
});
|
||||
} else {
|
||||
body.appendChild(children);
|
||||
}
|
||||
}
|
||||
modal.appendChild(body);
|
||||
parent.append(modal);
|
||||
pushClass(doc, 'modal_show');
|
||||
}
|
||||
|
||||
function fillModal(obj) {
|
||||
let el, targetClass, modal;
|
||||
modal = elem('.modal');
|
||||
const entries = Object.entries(obj)
|
||||
for (const [element, content] of entries) {
|
||||
targetClass = `.${convertToUnderScoreCase(element)}`;
|
||||
el = elem(targetClass, modal);
|
||||
el.innerHTML = content;
|
||||
}
|
||||
}
|
||||
|
||||
(function comments(){
|
||||
let comments, form, replyNotice, open;
|
||||
|
||||
comments = elem('.comments');
|
||||
form = elem('.form');
|
||||
button = elem('.form_toggle');
|
||||
replyNotice = elem('.reply_notice')
|
||||
open = 'form_open';
|
||||
|
||||
let successOutput, errorOutput;
|
||||
|
||||
successOutput = {
|
||||
modalTitle: translations.success.title,
|
||||
modalText: translations.success.text,
|
||||
modalClose: translations.success.close
|
||||
};
|
||||
errorOutput = {
|
||||
modalTitle: translations.error.title,
|
||||
modalText: translations.error.text,
|
||||
modalClose: translations.error.close
|
||||
};
|
||||
|
||||
function feedbackModal() {
|
||||
let body, button, children;
|
||||
body = createEl();
|
||||
pushClass(body, 'modal_text');
|
||||
button = createEl();
|
||||
pushClass(button, 'btn');
|
||||
pushClass(button, 'modal_close');
|
||||
children = [
|
||||
body,
|
||||
button
|
||||
];
|
||||
return children;
|
||||
}
|
||||
|
||||
function confirmModal() {
|
||||
// confirm if you want to exit form
|
||||
let group, button, cancel;
|
||||
group = createEl();
|
||||
pushClass(group, 'btn_group');
|
||||
button = createEl();
|
||||
pushClass(button, 'btn');
|
||||
pushClass(button, 'modal_close')
|
||||
pushClass(button, 'form_close')
|
||||
cancel = createEl();
|
||||
pushClass(cancel, 'modal_close')
|
||||
pushClass(cancel, 'btn_close');
|
||||
pushClass(cancel, 'icon');
|
||||
group.appendChild(button);
|
||||
group.appendChild(cancel);
|
||||
return group;
|
||||
}
|
||||
|
||||
function handleForm(form) {
|
||||
|
||||
function formValues() {
|
||||
// returns an object with form field values
|
||||
let deadWeight, fields, fieldAreas, obj;
|
||||
fieldAreas = elems('.form_input', form);
|
||||
fields = Array.from(fieldAreas);
|
||||
obj = Object.create(null);
|
||||
deadWeight = ['fields', 'options', '[' , ']', 'undefined'];
|
||||
|
||||
fields.map(function(field) {
|
||||
let key, value;
|
||||
key = deleteChars(field.name, deadWeight);
|
||||
key = convertToUnderScoreCase(key);
|
||||
value = field.value;
|
||||
obj[key] = value;
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
|
||||
(function submitForm() {
|
||||
form.addEventListener('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
let fields, recaptchaResponse, submit, url;
|
||||
url = [endpoint, 'v3/entry', gitProvider, username, repository, branch, 'comments'].join('/');
|
||||
fields = formValues();
|
||||
submit = elem('.form_submit', form);
|
||||
recaptchaResponse = elem('[name="g-recaptcha-response"]', form);
|
||||
|
||||
submit.value = translations.submitted;
|
||||
|
||||
function formActions(info) {
|
||||
showModal(info);
|
||||
submit.value = translations.submit;
|
||||
}
|
||||
|
||||
let data = {
|
||||
fields: {
|
||||
name: fields.name,
|
||||
email: fields.email,
|
||||
comment: fields.comment,
|
||||
replyID: fields.reply_id,
|
||||
replyName: fields.reply_name,
|
||||
replyThread: fields.reply_thread
|
||||
},
|
||||
options: {
|
||||
slug: fields.slug
|
||||
}
|
||||
};
|
||||
|
||||
if (staticman.secret){
|
||||
data.options.reCaptcha = {};
|
||||
data.options.reCaptcha.siteKey = staticman.siteKey;
|
||||
data.options.reCaptcha.secret = staticman.secret;
|
||||
data["g-recaptcha-response"] = recaptchaResponse.value;
|
||||
}
|
||||
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
}).then(function(res) {
|
||||
if(res.ok) {
|
||||
formActions(successOutput);
|
||||
} else {
|
||||
formActions(errorOutput);
|
||||
}
|
||||
}).catch(function(error) {
|
||||
formActions(errorOutput);
|
||||
console.error('Error:', error);
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
function getHiddenFields() {
|
||||
let reply_id, reply_name, reply_thread, reply_to, obj;
|
||||
|
||||
reply_id = elem('.reply_id', form);
|
||||
reply_name = elem('.reply_name', form);
|
||||
reply_thread = elem('.reply_thread', form);
|
||||
reply_to = elem('.reply_to', form);
|
||||
|
||||
obj = {
|
||||
id: reply_id,
|
||||
name: reply_name,
|
||||
thread: reply_thread,
|
||||
to: reply_to
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function setReplyValues(trigger) {
|
||||
let comment, id, name, thread;
|
||||
|
||||
let reply_fields = getHiddenFields();
|
||||
|
||||
comment = trigger.parentNode;
|
||||
id = comment.id;
|
||||
name = elem('.comment_name_span', comment);
|
||||
thread = elem('.comment_thread', comment);
|
||||
reply_fields.thread.value = thread.textContent;
|
||||
reply_fields.id.value = id;
|
||||
reply_fields.name.value = name.textContent;
|
||||
reply_fields.to.textContent = name.textContent;
|
||||
}
|
||||
|
||||
function resetReplyValues() {
|
||||
let reply_fields;
|
||||
reply_fields = getHiddenFields();
|
||||
const values = Object.entries(reply_fields);
|
||||
for (const [key, element] of values) {
|
||||
if (key == 'to') {
|
||||
element.textContent = '';
|
||||
} else {
|
||||
element.value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function toggleForm(action = true) {
|
||||
let reply_to, toggle_btn;
|
||||
action = action ? pushClass : deleteClass;
|
||||
toggle_btn = elem('.form_toggle');
|
||||
action(form, open);
|
||||
action(toggle_btn, hidden);
|
||||
reply_to = getHiddenFields().to.textContent;
|
||||
isBlank(reply_to) ? pushClass(replyNotice, hidden) : deleteClass(replyNotice, hidden) ;
|
||||
}
|
||||
|
||||
comments.addEventListener('click', function (event){
|
||||
let confirm, fields, modal, target, obj, formIsEmpty, hiddenValuesEmpty;
|
||||
|
||||
// buttons
|
||||
let isFormCloseBtn, isFormToggleBtn, isModalCloseBtn, isResetFormBtn, isReplyBt;
|
||||
|
||||
target = event.target;
|
||||
fields = formValues();
|
||||
formIsEmpty = isBlank(fields.name) && isBlank(fields.comment) && isBlank(fields.email) ? true : false;
|
||||
hiddenValuesEmpty = isBlank(fields.reply_id) ? true : false;
|
||||
|
||||
isFormCloseBtn = containsClass(target, 'form_close');
|
||||
isFormToggleBtn = containsClass(target, 'form_toggle');
|
||||
isModalCloseBtn = containsClass(target, 'modal_close');
|
||||
isResetFormBtn = containsClass(target, 'form_reset');
|
||||
isReplyBtn = containsClass(target, 'reply_btn');
|
||||
|
||||
isReplyBtn ? setReplyValues(target) : false;
|
||||
isReplyBtn || isFormToggleBtn ? toggleForm() : false;
|
||||
isFormCloseBtn ? toggleForm(false) : false;
|
||||
|
||||
if (isFormCloseBtn) {
|
||||
form.reset();
|
||||
}
|
||||
|
||||
if (isResetFormBtn) {
|
||||
if (formIsEmpty) {
|
||||
hiddenValuesEmpty ? false : resetReplyValues();
|
||||
toggleForm(false);
|
||||
} else {
|
||||
obj = {
|
||||
modalTitle: translations.discard.title,
|
||||
modalClose: translations.discard.button
|
||||
}
|
||||
confirm = confirmModal();
|
||||
createModal(confirm, comments);
|
||||
fillModal(obj);
|
||||
}
|
||||
}
|
||||
|
||||
if (isModalCloseBtn) {
|
||||
modal = target.closest('.modal');
|
||||
modal.remove();
|
||||
deleteClass(doc, 'modal_show');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
form ? handleForm(form) : false;
|
||||
|
||||
function showModal(obj) {
|
||||
let feedbackBody;
|
||||
feedback = feedbackModal();
|
||||
createModal(feedback, comments);
|
||||
fillModal(obj);
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
(function makeExternalLinks(){
|
||||
let links = elems('a');
|
||||
if(links) {
|
||||
Array.from(links).forEach(function(link){
|
||||
let target, rel, blank, noopener, attr1, attr2, url, isExternal;
|
||||
url = elemAttribute(link, 'href');
|
||||
isExternal = (url && typeof url == 'string' && url.startsWith('http')) && !url.startsWith(parentURL) ? true : false;
|
||||
if(isExternal) {
|
||||
target = 'target';
|
||||
rel = 'rel';
|
||||
blank = '_blank';
|
||||
noopener = 'noopener';
|
||||
attr1 = elemAttribute(link, target);
|
||||
attr2 = elemAttribute(link, noopener);
|
||||
|
||||
attr1 ? false : elemAttribute(link, target, blank);
|
||||
attr2 ? false : elemAttribute(link, rel, noopener);
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
let headingNodes = [], results, link, icon, current, id,
|
||||
tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
||||
|
||||
current = document.URL;
|
||||
|
||||
tags.forEach(function(tag){
|
||||
results = document.getElementsByTagName(tag);
|
||||
Array.prototype.push.apply(headingNodes, results);
|
||||
});
|
||||
|
||||
headingNodes.forEach(function(node){
|
||||
link = createEl('a');
|
||||
icon = createEl('img');
|
||||
icon.src = '{{ absURL "images/icons/link.svg" }}';
|
||||
link.className = 'link';
|
||||
link.appendChild(icon);
|
||||
id = node.getAttribute('id');
|
||||
if(id) {
|
||||
link.href = `${current}#${id}`;
|
||||
node.appendChild(link);
|
||||
pushClass(node, 'link_owner');
|
||||
}
|
||||
});
|
||||
|
||||
let inlineListItems = elems('ol li');
|
||||
if(inlineListItems) {
|
||||
inlineListItems.forEach(function(listItem){
|
||||
let firstChild = listItem.children[0]
|
||||
let containsHeading = isMatch(firstChild, tags);
|
||||
containsHeading ? pushClass(listItem, 'align') : false;
|
||||
})
|
||||
}
|
||||
|
||||
const copyToClipboard = str => {
|
||||
let copy, selection, selected;
|
||||
copy = createEl('textarea');
|
||||
copy.value = str;
|
||||
copy.setAttribute('readonly', '');
|
||||
copy.style.position = 'absolute';
|
||||
copy.style.left = '-9999px';
|
||||
selection = document.getSelection();
|
||||
doc.appendChild(copy);
|
||||
// check if there is any selected content
|
||||
selected = selection.rangeCount > 0 ? selection.getRangeAt(0) : false;
|
||||
copy.select();
|
||||
document.execCommand('copy');
|
||||
doc.removeChild(copy);
|
||||
if (selected) { // if a selection existed before copying
|
||||
selection.removeAllRanges(); // unselect existing selection
|
||||
selection.addRange(selected); // restore the original selection
|
||||
}
|
||||
}
|
||||
|
||||
(function copyHeadingLink() {
|
||||
let deeplink, deeplinks, newLink, parent, target;
|
||||
deeplink = 'link';
|
||||
deeplinks = elems(`.${deeplink}`);
|
||||
if(deeplinks) {
|
||||
document.addEventListener('click', function(event)
|
||||
{
|
||||
target = event.target;
|
||||
parent = target.parentNode;
|
||||
if (target && containsClass(target, deeplink) || containsClass(parent, deeplink)) {
|
||||
event.preventDefault();
|
||||
newLink = target.href != undefined ? target.href : target.parentNode.href;
|
||||
copyToClipboard(newLink);
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
(function copyLinkToShare() {
|
||||
let copy, copied, excerpt, isCopyIcon, isInExcerpt, link, postCopy, postLink, target;
|
||||
copy = 'copy';
|
||||
copied = 'copy_done';
|
||||
excerpt = 'excerpt';
|
||||
postCopy = 'post_copy';
|
||||
postLink = 'post_card';
|
||||
|
||||
doc.addEventListener('click', function(event) {
|
||||
target = event.target;
|
||||
isCopyIcon = containsClass(target, copy);
|
||||
let isWithinCopyIcon = target.closest(`.${copy}`);
|
||||
if (isCopyIcon || isWithinCopyIcon) {
|
||||
let icon = isCopyIcon ? isCopyIcon : isWithinCopyIcon;
|
||||
isInExcerpt = containsClass(icon, postCopy);
|
||||
if (isInExcerpt) {
|
||||
link = target.closest(`.${excerpt}`).previousElementSibling;
|
||||
link = containsClass(link, postLink)? elemAttribute(link, 'href') : false;
|
||||
} else {
|
||||
link = window.location.href;
|
||||
}
|
||||
if(link) {
|
||||
copyToClipboard(link);
|
||||
pushClass(icon, copied);
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
(function hideAside(){
|
||||
let aside, title, posts;
|
||||
aside = elem('.aside');
|
||||
title = aside ? aside.previousElementSibling : null;
|
||||
if(aside && title.nodeName.toLowerCase() === 'h3') {
|
||||
posts = Array.from(aside.children);
|
||||
posts.length < 1 ? title.remove() : false;
|
||||
}
|
||||
})();
|
||||
|
||||
(function goBack() {
|
||||
let backBtn = elem('.btn_back');
|
||||
let history = window.history;
|
||||
if (backBtn) {
|
||||
backBtn.addEventListener('click', function(){
|
||||
history.back();
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
(function postsPager(){
|
||||
const pager = elem('.pagination');
|
||||
if (pager) {
|
||||
pushClass(pager, 'pager');
|
||||
const pagerItems = elems('li', pager);
|
||||
const pagerLinks = Array.from(pagerItems).map(function(item){
|
||||
return item.firstElementChild;
|
||||
});
|
||||
|
||||
pagerLinks.forEach(function(link){
|
||||
pushClass(link, 'pager_link')
|
||||
});
|
||||
|
||||
pagerItems.forEach(function(item){
|
||||
pushClass(item, 'pager_item')
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
// add new code above this line
|
||||
}
|
||||
window.addEventListener('load', fileClosure());
|
|
@ -0,0 +1,54 @@
|
|||
function calculateTimeSince(num){
|
||||
const currentTime = Math.floor(Date.now()/1000);
|
||||
const timestamp = parseInt(num);
|
||||
const timeSince = currentTime - timestamp;
|
||||
|
||||
var timeAgo;
|
||||
var timeTag;
|
||||
var minute = 60;
|
||||
var hour = 3600;
|
||||
var day = 86400;
|
||||
var week = 604800;
|
||||
var month = 2.628e+6;
|
||||
var year = 3.154e+7;
|
||||
|
||||
if (timeSince < minute ) {
|
||||
timeAgo = 1;
|
||||
timeTag = timeAgo < 2 ? '{{ i18n "oneMin" }}' : '{{ i18n "moreMin" }}';
|
||||
} else if (timeSince > minute && timeSince < hour ) {
|
||||
timeAgo = Math.ceil(timeSince / minute);
|
||||
timeTag = timeAgo < 2 ? '{{ i18n "oneMin" }}' : '{{ i18n "moreMin" }}';
|
||||
} else if (timeSince > hour && timeSince < day ) {
|
||||
timeAgo = Math.floor(timeSince / hour);
|
||||
timeTag = timeAgo < 2 ? '{{ i18n "oneHr" }}' : '{{ i18n "moreHr" }}';
|
||||
} else if (timeSince > day && timeSince < week) {
|
||||
timeAgo = Math.floor(timeSince / day);
|
||||
timeTag = timeAgo < 2 ? '{{ i18n "oneDay" }}' : '{{ i18n "moreDay" }}';
|
||||
} else if (timeSince > week && timeSince < month) {
|
||||
timeAgo = Math.floor(timeSince / week);
|
||||
timeTag = timeAgo < 2 ? '{{ i18n "oneWk" }}' : '{{ i18n "moreWk" }}';
|
||||
} else if (timeSince > month && timeSince < year) {
|
||||
timeAgo = Math.floor(timeSince / month);
|
||||
timeTag = timeAgo < 2 ? '{{ i18n "oneMonth" }}' : '{{ i18n "moreMonth" }}';
|
||||
} else if (timeSince > year) {
|
||||
timeAgo = Math.floor(timeSince / year);
|
||||
timeTag = timeAgo < 2 ? '{{ i18n "oneYr" }}' : '{{ i18n "moreYr" }}';
|
||||
}
|
||||
|
||||
return `{{ i18n "timeAgoStr" }}`;
|
||||
}
|
||||
|
||||
function populateCommentsTime(nodes) {
|
||||
if (nodes) {
|
||||
nodes.forEach(function(node) {
|
||||
let durationTime = node.dataset.time;
|
||||
let durationSeconds = Math.ceil(Date.parse(durationTime) / 1000) ;
|
||||
let durationSince = calculateTimeSince(durationSeconds);
|
||||
node.innerHTML = `${durationSince}`;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const durations = document.querySelectorAll('.comment_heading');
|
||||
|
||||
populateCommentsTime(durations);
|
|
@ -0,0 +1,11 @@
|
|||
.waves
|
||||
max-width: 320px
|
||||
height: 5px
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: center
|
||||
flex-direction: column
|
||||
margin: 30px auto
|
||||
&_inner
|
||||
min-width: 18rem
|
||||
min-height: 9rem
|
|
@ -0,0 +1,150 @@
|
|||
*
|
||||
box-sizing: border-box
|
||||
-webkit-appearance: none
|
||||
margin: 0
|
||||
padding: 0
|
||||
|
||||
body, html
|
||||
scroll-behavior: smooth
|
||||
|
||||
html
|
||||
font-size: 1.1rem
|
||||
|
||||
body
|
||||
font-family: var(--font)
|
||||
background-color: var(--bg)
|
||||
color: var(--text)
|
||||
text-align: justify
|
||||
line-height: 1.5
|
||||
max-width: 1440px
|
||||
margin: 0 auto
|
||||
position: relative
|
||||
font-kerning: normal
|
||||
display: flex
|
||||
flex-direction: column
|
||||
justify-content: space-between
|
||||
min-height: 100vh
|
||||
-webkit-font-smoothing: antialiased
|
||||
-moz-osx-font-smoothing: grayscale
|
||||
|
||||
a
|
||||
text-decoration: none
|
||||
color: inherit
|
||||
|
||||
blockquote
|
||||
opacity: 0.8
|
||||
padding: 1rem
|
||||
position: relative
|
||||
quotes: '\201C''\201D''\2018''\2019'
|
||||
margin: 0.75rem 0
|
||||
display: flex
|
||||
flex-flow: row wrap
|
||||
background-repeat: no-repeat
|
||||
background-size: 5rem
|
||||
background-position: 50% 50%
|
||||
position: relative
|
||||
&::before
|
||||
content: ""
|
||||
padding: 1px
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
background: var(--theme)
|
||||
|
||||
p
|
||||
padding-left: 0.5rem 0 !important
|
||||
font-size: 1.1rem !important
|
||||
width: 100%
|
||||
font-weight: 300
|
||||
font-style: italic
|
||||
|
||||
h1,h2,h3,h4,h5
|
||||
font-family: inherit
|
||||
font-weight: 500
|
||||
padding: 5px 0
|
||||
margin: 15px 0
|
||||
color: inherit
|
||||
line-height: 1.35
|
||||
|
||||
h1
|
||||
font-size: 200%
|
||||
h2
|
||||
font-size: 175%
|
||||
h3
|
||||
font-size: 150%
|
||||
h4
|
||||
font-size: 125%
|
||||
h5
|
||||
font-size: 120%
|
||||
h6
|
||||
font-size: 100%
|
||||
|
||||
img, svg, video
|
||||
max-width: 100%
|
||||
vertical-align: middle
|
||||
img
|
||||
height: auto
|
||||
margin: 1rem auto
|
||||
padding: 0
|
||||
|
||||
main
|
||||
padding-bottom: 45px
|
||||
flex: 1
|
||||
|
||||
ul
|
||||
list-style: none
|
||||
-webkit-padding-start: 0
|
||||
-moz-padding-start: 0
|
||||
|
||||
b, strong, em
|
||||
font-weight: 500
|
||||
|
||||
hr
|
||||
border: none
|
||||
padding: 0.5px
|
||||
background: var(--theme)
|
||||
opacity: 0.5
|
||||
margin: 1rem 0
|
||||
|
||||
aside
|
||||
margin-top: 4rem
|
||||
h3
|
||||
position: relative
|
||||
margin: 0 !important
|
||||
|
||||
span
|
||||
&.pager_link
|
||||
opacity: 0.5
|
||||
|
||||
ol
|
||||
counter-reset: my-awesome-counter
|
||||
list-style: none !important
|
||||
padding-left: 3rem
|
||||
margin-left: 0.5rem
|
||||
@media screen and (min-width: 667px)
|
||||
// margin-left: 1rem
|
||||
li
|
||||
margin: 0 0 0.5rem 0
|
||||
counter-increment: my-awesome-counter
|
||||
position: relative
|
||||
padding-left: 0.5rem !important
|
||||
&::before
|
||||
content: counter(my-awesome-counter)
|
||||
font-size: 1.15rem
|
||||
display: inline-grid
|
||||
align-items: center
|
||||
font-weight: 500
|
||||
position: absolute
|
||||
--size: 1.8rem
|
||||
left: -2rem
|
||||
line-height: var(--size)
|
||||
width: var(--size)
|
||||
height: var(--size)
|
||||
color: var(--theme)
|
||||
border-radius: 50%
|
||||
text-align: center
|
||||
top: 0.25rem
|
||||
border-right: 2px solid var(--theme)
|
||||
&.align::before
|
||||
top: 1rem
|
|
@ -0,0 +1,78 @@
|
|||
.comment
|
||||
&s
|
||||
position: relative
|
||||
|
||||
&_reply
|
||||
margin-left: 2rem
|
||||
|
||||
.form
|
||||
display: flex
|
||||
flex-direction: column
|
||||
width: 100%
|
||||
background: transparent
|
||||
height: 0
|
||||
opacity: 0
|
||||
margin: 0 0 1rem
|
||||
transform: translateY(250px)
|
||||
transition: opacity 0.3s ease-in , transform 0.3s ease-in
|
||||
border-radius: 0.67rem
|
||||
&_open
|
||||
height: initial
|
||||
transform: translateY(0)
|
||||
opacity: 1
|
||||
|
||||
&_input
|
||||
margin: $padding 0
|
||||
font-size: 1rem !important
|
||||
padding: $padding $padding*1.5 !important
|
||||
-webkit-appearance: none
|
||||
border-radius: 25px
|
||||
outline: none
|
||||
transition: all 0.3s ease-out
|
||||
width: 100%
|
||||
max-width: 480px
|
||||
box-shadow: 0 5px 15px 0 rgba(158, 174, 221, 0.2)
|
||||
border: 1px solid #eee
|
||||
&:focus,
|
||||
&:hover
|
||||
border: 1px solid var(--theme)
|
||||
|
||||
&_comment
|
||||
resize: none
|
||||
border-radius: 15px
|
||||
min-height: 2.5rem !important
|
||||
|
||||
&_label
|
||||
display: none
|
||||
|
||||
&_submit
|
||||
margin: 0
|
||||
|
||||
.reply
|
||||
&_btn
|
||||
width: 1.75rem
|
||||
height: 1.75rem
|
||||
background-image: url($reply-icon-path)
|
||||
cursor: pointer
|
||||
margin-top: 1rem
|
||||
|
||||
&_to::before
|
||||
content: '↷ @'
|
||||
|
||||
.g-recaptcha
|
||||
display: grid
|
||||
width: 100%
|
||||
background: transparent
|
||||
border: none
|
||||
border-radius: 0.25rem
|
||||
margin: 1.25rem 0 1.5rem
|
||||
> div,
|
||||
iframe
|
||||
display: grid
|
||||
width: 100% !important
|
||||
height: 6rem !important
|
||||
|
||||
iframe
|
||||
transform: scale(1.03)
|
||||
padding: 0 0.75rem
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
|
||||
.smaller
|
||||
font-size: 0.8rem
|
||||
color: grey
|
||||
|
||||
.pages
|
||||
color: lightgrey
|
||||
|
||||
button
|
||||
background-color: var(--theme)
|
||||
color: white
|
||||
margin: 0.5em
|
||||
padding-left: 2em
|
||||
padding-right: 2em
|
||||
padding-top: 1em
|
||||
padding-bottom: 1em
|
||||
font-size: 1rem
|
||||
font-family: inherit
|
||||
cursor: pointer
|
||||
border-radius: 5px
|
||||
transition: 0.5s
|
||||
|
||||
&:hover
|
||||
background-color: black
|
||||
color: white
|
||||
|
||||
.index-title
|
||||
h1
|
||||
@media (min-width: 960px)
|
||||
margin-left: 2em
|
||||
font-size: 5em
|
||||
|
||||
margin-left: 0.5em
|
||||
font-size: 4em
|
||||
font-family: 'Signika', sans-serif
|
||||
text-transform: uppercase
|
||||
margin-top: 0.5em
|
||||
color: #4f2c16
|
||||
text-shadow: 1px 1px 2px lightgrey
|
||||
width: 30%
|
||||
|
||||
|
||||
@media screen and (min-width: 769px)
|
||||
.nav-menu a
|
||||
display: inline-block
|
||||
height: initial
|
||||
text-align: left
|
||||
|
||||
.mobile
|
||||
display:none
|
||||
|
||||
.video
|
||||
overflow: hidden
|
||||
padding-bottom: 56.25%
|
||||
position: relative
|
||||
height: 0
|
||||
margin: 1.5rem 0
|
||||
border-radius: 1rem
|
||||
background-color: var(--bg)
|
||||
box-shadow: 0 1rem 4rem rgba(0,0,0,0.17)
|
||||
iframe
|
||||
left: 0
|
||||
top: 0
|
||||
height: 100%
|
||||
width: 100%
|
||||
position: absolute
|
||||
transform: scale(1.03)
|
||||
|
||||
.copy
|
||||
position: relative
|
||||
cursor: pointer
|
||||
height: 1.5rem
|
||||
width: 1.5rem
|
||||
svg
|
||||
fill: var(--theme)
|
||||
width: 100%
|
||||
height: 100%
|
||||
&::before, &::after
|
||||
content: ""
|
||||
position: absolute
|
||||
background: var(--theme)
|
||||
color: var(--light)
|
||||
opacity: 0
|
||||
transition: opacity 0.25s ease-in
|
||||
|
||||
&::before
|
||||
content: attr(data-share);
|
||||
font-size: 0.8rem
|
||||
width: 5.4rem
|
||||
padding: 0.25rem
|
||||
border-radius: 0.25rem
|
||||
text-align: center
|
||||
top: -2rem
|
||||
right: 0
|
||||
|
||||
&_done::before
|
||||
content: attr(data-copied)
|
||||
|
||||
&:hover::before,
|
||||
&:hover::after
|
||||
opacity: 1
|
||||
|
||||
.author,
|
||||
.comment
|
||||
display: grid
|
||||
grid-template-columns: 4rem 1fr
|
||||
grid-gap: 0 0.75rem
|
||||
padding: 1rem
|
||||
margin: 1.5rem 0
|
||||
background-color: var(--accent)
|
||||
border-radius: 0.5rem
|
||||
box-shadow: 0 0.5rem 2rem rgba(0,0,0,0.12)
|
||||
&_name
|
||||
color: var(--text) !important
|
||||
font-size: 1.25rem
|
||||
text-transform: capitalize
|
||||
|
||||
&_name, &_pic
|
||||
border: none !important
|
||||
|
||||
&_pic
|
||||
padding: 0 0.33rem
|
||||
overflow: hidden
|
||||
img
|
||||
border-radius: 50%
|
||||
margin: 0
|
||||
|
||||
&_bio
|
||||
padding: 0 !important
|
||||
line-height: 1.33
|
||||
|
||||
&_heading
|
||||
font-size: 0.7rem
|
||||
|
||||
&_meta
|
||||
display: flex
|
||||
flex-flow: column
|
||||
justify-content: center
|
||||
|
||||
.modal
|
||||
display: none
|
||||
position: fixed
|
||||
bottom: 0
|
||||
top: 0
|
||||
left: 0
|
||||
right: 0
|
||||
z-index: 9999
|
||||
&_close
|
||||
margin: 25px 0
|
||||
color: var(--light)
|
||||
border: 0
|
||||
cursor: pointer
|
||||
padding:$padding/2 $padding*1.5
|
||||
|
||||
&_inner
|
||||
display: inline-flex
|
||||
flex-direction: column
|
||||
align-items: center
|
||||
background: var(--accent)
|
||||
max-width: 540px
|
||||
padding: 1.5rem
|
||||
box-shadow: 0 1.5rem 6rem rgba(0,0,0,0.12)
|
||||
border-radius: 1rem
|
||||
|
||||
&_show
|
||||
overflow: hidden
|
||||
position: relative
|
||||
&::before
|
||||
position: absolute
|
||||
content: ''
|
||||
top: 0
|
||||
left: 0
|
||||
width: 100%
|
||||
height: 100%
|
||||
z-index: 999
|
||||
background-color: rgba(0,0,0,0.6)
|
||||
|
||||
&_show &
|
||||
display: flex
|
||||
flex-direction: column
|
||||
align-items: center
|
||||
justify-content: center
|
||||
|
||||
&_title
|
||||
margin: 0 !important
|
||||
|
||||
&::before
|
||||
position: absolute
|
||||
top: 0
|
||||
left: 0
|
||||
width: 100%
|
||||
height: 100%
|
||||
background-color: rgba(255,255,255,0.7)
|
||||
z-index: 10
|
||||
|
||||
.btn
|
||||
font-size: 1rem
|
||||
margin: 1rem 0 1.5rem
|
||||
padding: 0.5rem 2rem
|
||||
background: var(--theme)
|
||||
box-shadow: 0 1rem 4rem rgba(0,0,0,0.5)
|
||||
cursor: pointer
|
||||
text-align: center
|
||||
text-transform: uppercase
|
||||
border-radius: 3rem
|
||||
border: none
|
||||
outline: none
|
||||
&, &_group
|
||||
width: 12rem
|
||||
display: inline-block
|
||||
color: var(--light)
|
||||
|
||||
&_group
|
||||
position: relative
|
||||
margin: 1rem 0
|
||||
|
||||
&_group &
|
||||
margin: 0
|
||||
|
||||
&_close
|
||||
content: "X"
|
||||
width: 2.5rem
|
||||
position: absolute
|
||||
right: 0
|
||||
top: 0
|
||||
bottom: 0
|
||||
display: grid
|
||||
align-items: center
|
||||
text-align: center
|
||||
font-size: 1rem
|
||||
background-image: url($close-icon-path)
|
||||
background-size: 36% !important
|
||||
border-left: 1px solid var(--bg)
|
||||
z-index: 2
|
||||
cursor: pointer
|
||||
margin: 0
|
||||
|
||||
.icon
|
||||
background-size: 75%
|
||||
background-position: center
|
||||
background-repeat: no-repeat
|
|
@ -0,0 +1,35 @@
|
|||
@font-face
|
||||
font-family: 'Metropolis'
|
||||
font-style: normal
|
||||
font-weight: 400
|
||||
src: local('Metropolis Regular'), local('Metropolis-Regular'), url('#{$font-path}/Metropolis-Regular.woff2') format('woff2'), url('#{$font-path}/Metropolis-Regular.woff') format('woff')
|
||||
|
||||
@font-face
|
||||
font-family: 'Metropolis'
|
||||
font-style: normal
|
||||
font-weight: 300
|
||||
src: local('Metropolis Light'), local('Metropolis-Light'), url('#{$font-path}/Metropolis-Light.woff2') format('woff2'), url('#{$font-path}/Metropolis-Light.woff') format('woff')
|
||||
|
||||
@font-face
|
||||
font-family: 'Metropolis'
|
||||
font-style: italic
|
||||
font-weight: 300
|
||||
src: local('Metropolis Light Italic'), local('Metropolis-LightItalic'), url('#{$font-path}/Metropolis-LightItalic.woff2') format('woff2'), url('#{$font-path}/Metropolis-LightItalic.woff') format('woff')
|
||||
|
||||
@font-face
|
||||
font-family: 'Metropolis'
|
||||
font-style: normal
|
||||
font-weight: 500
|
||||
src: local('Metropolis Medium'), local('Metropolis-Medium'), url('#{$font-path}/Metropolis-Medium.woff2') format('woff2'), url('#{$font-path}/Metropolis-Medium.woff') format('woff')
|
||||
|
||||
@font-face
|
||||
font-family: 'Metropolis'
|
||||
font-style: italic
|
||||
font-weight: 500
|
||||
src: local('Metropolis Medium Italic'), local('Metropolis-MediumItalic'), url('#{$font-path}/Metropolis-MediumItalic.woff2') format('woff2'), url('#{$font-path}/Metropolis-MediumItalic.woff') format('woff')
|
||||
|
||||
@font-face
|
||||
font-family: 'Cookie'
|
||||
font-style: normal
|
||||
font-weight: 400
|
||||
src: local('Cookie-Regular'), url('#{$font-path}/cookie-v10-latin-regular.woff2') format('woff2'), url('#{$font-path}/cookie-v10-latin-regular.woff') format('woff')
|
|
@ -0,0 +1,25 @@
|
|||
.footer
|
||||
padding: 0
|
||||
color: var(--light)
|
||||
margin: 0
|
||||
background: var(--dark)
|
||||
width: 100%
|
||||
font-size: 1.05rem
|
||||
min-height: 75px
|
||||
position: relative
|
||||
z-index: 1001
|
||||
a
|
||||
color: var(--theme)
|
||||
opacity: 0.8
|
||||
transition: opacity 0.3s ease-in-out
|
||||
&:hover
|
||||
text-decoration: underline
|
||||
opacity: 1
|
||||
|
||||
&_inner
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
padding: 1.5rem
|
||||
@media screen and (max-width: 567px)
|
||||
flex-direction: column
|
||||
|
|
@ -0,0 +1,159 @@
|
|||
#logo
|
||||
position: absolute
|
||||
@media (min-width: 960px)
|
||||
position: fixed
|
||||
|
||||
width: calc(1rem + 9vw)
|
||||
left: 10px
|
||||
top: -0.5rem
|
||||
|
||||
.nav
|
||||
position: absolute
|
||||
top: 0
|
||||
width: 100%
|
||||
transition: height 0.4s cubic-bezier(0.52, 0.16, 0.24, 1)
|
||||
z-index: 999
|
||||
|
||||
&_main_item
|
||||
display: none !important
|
||||
@media (min-width: 960px)
|
||||
display: inline !important
|
||||
|
||||
&_bar
|
||||
width: 100%
|
||||
position: relative
|
||||
display: block
|
||||
@media (min-width: 960px)
|
||||
display: none
|
||||
|
||||
&-wrap
|
||||
width: 1.8rem
|
||||
height: 1.8rem
|
||||
display: grid
|
||||
align-items: center
|
||||
cursor: pointer
|
||||
z-index: 99
|
||||
min-height: 1.5rem
|
||||
|
||||
&,
|
||||
&::after,
|
||||
&::before
|
||||
padding: 1px
|
||||
border-radius: 2px
|
||||
background-color: var(--text)
|
||||
|
||||
&::after,
|
||||
&::before
|
||||
content: ""
|
||||
position: absolute
|
||||
width: 1.2rem
|
||||
|
||||
&::before
|
||||
top: -0.5rem
|
||||
|
||||
&::after
|
||||
top: 0.5rem
|
||||
right: 0
|
||||
|
||||
|
||||
&-body
|
||||
box-shadow: 0 1.5rem 6rem rgba(0,0,0,0.17)
|
||||
position: fixed
|
||||
right: 10px
|
||||
z-index: 1
|
||||
top: 100%
|
||||
opacity: 0
|
||||
overflow: hidden
|
||||
transition:top 0.33s linear
|
||||
background: transparent
|
||||
background-color: var(--accent)
|
||||
width: 16rem
|
||||
padding: 100px 0
|
||||
min-height: 100vh
|
||||
z-index: 1
|
||||
&:hover
|
||||
box-shadow: 0 1.5rem 6rem rgba(0,0,0,0.27)
|
||||
|
||||
a
|
||||
display: block
|
||||
padding: 12.5px 25px
|
||||
margin-bottom: 2px
|
||||
border-bottom: 1px solid var(--accent)
|
||||
transition:color 0.25s ease-in-out
|
||||
&:hover
|
||||
color: var(--theme)
|
||||
|
||||
|
||||
|
||||
&-brand
|
||||
font-family: 'Signika', sans-serif
|
||||
font-size: 1.5em !important
|
||||
padding-top: 0 !important
|
||||
padding-bottom: 0 !important
|
||||
color: #4f2c16 !important
|
||||
|
||||
&-close
|
||||
display: flex
|
||||
justify-content: flex-start
|
||||
align-items: center
|
||||
position: absolute
|
||||
top: 0
|
||||
right: 0
|
||||
width: 100%
|
||||
cursor:pointer
|
||||
padding: 25px
|
||||
&:after,
|
||||
&:before
|
||||
content: ''
|
||||
width: 18px
|
||||
border-radius 50%
|
||||
padding: 1.5px
|
||||
background: var(--text)
|
||||
opacity: 0.7
|
||||
position: relative
|
||||
|
||||
&:before
|
||||
transform: rotate(20deg) translateX(1.5px)
|
||||
|
||||
&:after
|
||||
transform: rotate(-20deg) translateX(-1.5px)
|
||||
|
||||
|
||||
&-drop
|
||||
cursor: pointer
|
||||
top: 0
|
||||
bottom: 0
|
||||
z-index: 1000
|
||||
|
||||
&-exit
|
||||
animation: hideMenu 0.5s cubic-bezier(0.52, 0.16, 0.24, 1) forwards
|
||||
|
||||
&-menu
|
||||
position: relative
|
||||
padding: 10px 25px 10px 0
|
||||
padding-left: 15vw
|
||||
@media (min-width: 1150px)
|
||||
padding-left: 3vw
|
||||
|
||||
height: 100%
|
||||
max-width: 1024px
|
||||
margin: 0 auto
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
a
|
||||
color: inherit
|
||||
display: block
|
||||
font-size: 105%
|
||||
|
||||
&-pop
|
||||
position: fixed
|
||||
width: 100vw
|
||||
background: rgba(0,0,0,0.05)
|
||||
|
||||
&-open
|
||||
animation: showMenu 0.5s cubic-bezier(0.52, 0.16, 0.24, 1) forwards
|
||||
|
||||
&_item
|
||||
text-transform: capitalize
|
||||
|
|
@ -0,0 +1,217 @@
|
|||
.post_metadata
|
||||
|
||||
h1, h3
|
||||
text-align: center !important
|
||||
|
||||
h3
|
||||
color: gray
|
||||
font-size: 1.2rem
|
||||
width: 100%
|
||||
|
||||
svg
|
||||
width: 1rem
|
||||
height: 1rem
|
||||
fill: var(--theme)
|
||||
|
||||
hr
|
||||
width: 100%
|
||||
background-color: var(--theme)
|
||||
|
||||
.post
|
||||
@extend %narrow
|
||||
padding: 1rem 1.5rem
|
||||
margin-top: 1.5rem
|
||||
h1,h2,h3,h4,h5,h6
|
||||
margin: 1rem auto
|
||||
text-align: left
|
||||
text-transform: initial
|
||||
padding: 0.25rem 0 0 0
|
||||
|
||||
p
|
||||
padding-bottom: 0.5rem
|
||||
padding-top: 0.5rem
|
||||
font-size: 1.05rem
|
||||
|
||||
&s
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
flex-flow: row wrap
|
||||
width: 100%
|
||||
align-items: stretch
|
||||
|
||||
&s:not(.aside)
|
||||
padding: 0 30px
|
||||
|
||||
&_content
|
||||
h4
|
||||
margin: 5px 0
|
||||
text-align: left
|
||||
p
|
||||
line-height: 1.65
|
||||
&:first-child
|
||||
margin-top: 0
|
||||
padding-top: 0
|
||||
a:not(.link)
|
||||
border-bottom: 2px solid var(--theme)
|
||||
&:hover
|
||||
opacity: 0.7
|
||||
|
||||
ol, ul
|
||||
padding: 0.5rem 0 0.5rem 1.2rem
|
||||
// list-style-type: initial
|
||||
li
|
||||
padding: 0.33rem 0
|
||||
&_header
|
||||
background-size: cover
|
||||
background-repeat: no-repeat
|
||||
background-position: center
|
||||
|
||||
background-attachment: fixed;
|
||||
|
||||
position: relative
|
||||
height: 48vh
|
||||
min-height: 360px
|
||||
margin-top: 60px
|
||||
padding: 30px
|
||||
|
||||
&_copy
|
||||
opacity: 0
|
||||
transition: opacity 0.3s ease-out
|
||||
|
||||
&_item
|
||||
@include shadow
|
||||
margin: 1.25rem 0
|
||||
border-radius: 10px
|
||||
overflow: hidden
|
||||
width: 100%
|
||||
@media screen and (min-width:667px)
|
||||
width: 47%
|
||||
|
||||
&_item:hover &_copy
|
||||
opacity: 1
|
||||
|
||||
&_link
|
||||
padding: 2.5px 0
|
||||
font-size: 1.25em
|
||||
margin: 2.5px 0
|
||||
text-align: left
|
||||
|
||||
&_meta
|
||||
overflow: hidden
|
||||
opacity: 0.8
|
||||
font-size: 0.84rem
|
||||
font-weight: 500
|
||||
display: inline-grid
|
||||
grid-template-columns: auto 1fr
|
||||
background-color: var(--light)
|
||||
padding: 0
|
||||
align-items: center
|
||||
border-radius: 0.3rem
|
||||
color: var(--dark)
|
||||
text-transform: capitalize
|
||||
a
|
||||
&:hover
|
||||
color: var(--theme)
|
||||
text-decoration: underline
|
||||
opacity: 0.9
|
||||
|
||||
&_extra
|
||||
display: flex
|
||||
justify-content: flex-end
|
||||
|
||||
&_tag
|
||||
font-size: 0.75rem !important
|
||||
font-weight: 500
|
||||
background: var(--theme)
|
||||
color: var(--light)
|
||||
padding: 0.25rem 0.67rem !important
|
||||
text-transform: uppercase
|
||||
display: inline-flex
|
||||
border-radius: 5px
|
||||
|
||||
&_title
|
||||
text-align: center
|
||||
font-size: 2.5rem
|
||||
@extend %narrow
|
||||
|
||||
&_author
|
||||
padding: 0.2rem 0.75rem
|
||||
a
|
||||
color: var(--theme)
|
||||
text-decoration: underline
|
||||
|
||||
&_time
|
||||
background: var(--theme)
|
||||
display: inline-grid
|
||||
padding: 0.2rem 0.75rem
|
||||
color: var(--light)
|
||||
|
||||
&_card
|
||||
display: block
|
||||
position: relative
|
||||
background-color: var(--dark)
|
||||
border-radius: 0.5rem 0.5rem 0 0
|
||||
background-size: cover
|
||||
background-position: center
|
||||
overflow: hidden
|
||||
height: 10rem
|
||||
&::after
|
||||
content: ''
|
||||
position: absolute
|
||||
left: 0
|
||||
right: 0
|
||||
bottom: 0
|
||||
top: 0
|
||||
z-index: 1
|
||||
|
||||
&:hover::after
|
||||
background-color:rgba(0,0,0,0.3)
|
||||
|
||||
&_thumbnail
|
||||
width: 100%
|
||||
margin: 0
|
||||
|
||||
.pager
|
||||
display: flex
|
||||
justify-content: center
|
||||
align-content: center
|
||||
margin: 30px auto 0 auto
|
||||
padding: 0 1.5rem
|
||||
overflow: scroll
|
||||
&, &_link
|
||||
justify-content: center
|
||||
align-items: center
|
||||
|
||||
&_link
|
||||
display: flex
|
||||
background-color: var(--theme)
|
||||
color: var(--light)
|
||||
&:hover
|
||||
opacity: 0.5
|
||||
&_item, &_link
|
||||
height: 36px
|
||||
width: 36px
|
||||
border-radius: 50%
|
||||
&_item
|
||||
margin-left: 5px
|
||||
margin-right: 5px
|
||||
margin-bottom: 30px
|
||||
// overflow: hidden
|
||||
&:first-child, &:last-child
|
||||
display: none
|
||||
|
||||
&.active, &.disabled
|
||||
opacity: 0.5
|
||||
|
||||
.excerpt
|
||||
padding: 0 10px 1.5rem 10px
|
||||
position: relative
|
||||
z-index: 1
|
||||
&_meta
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
align-items: center
|
||||
transform: translateY(-2.5rem)
|
||||
position: relative
|
||||
z-index: 5
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
code
|
||||
min-width: 100%
|
||||
max-width: 100%
|
||||
.highlight
|
||||
display: grid
|
||||
margin: 1.25rem 0
|
||||
& &
|
||||
margin: 0
|
||||
pre
|
||||
padding: 1rem
|
||||
margin: 1.5rem 0
|
||||
background: var(--bubble) !important
|
||||
box-shadow: 0 0 2.5rem rgba(0,0,0,0.12)
|
||||
border-radius: 4px
|
||||
overflow-x: auto
|
|
@ -0,0 +1,65 @@
|
|||
.pale
|
||||
opacity: 0.7
|
||||
|
||||
.hidden
|
||||
display: none
|
||||
|
||||
.center
|
||||
text-align: center
|
||||
margin: 5px auto
|
||||
|
||||
.wrap
|
||||
padding: 10px 0
|
||||
max-width: 1024px
|
||||
margin: 0 auto
|
||||
|
||||
.mt
|
||||
margin-top: 7rem
|
||||
|
||||
.link
|
||||
display: inline-block
|
||||
width: 2.5rem
|
||||
margin: 0 0.25rem
|
||||
padding: 0 0.25rem
|
||||
opacity: 0
|
||||
transition: opacity 0.3s cubic-bezier(0.39, 0.575, 0.565, 1)
|
||||
&_owner:hover &
|
||||
opacity: 0.9
|
||||
img
|
||||
margin: 0
|
||||
|
||||
.solo
|
||||
grid-column: 1/-1
|
||||
|
||||
.never
|
||||
min-height: 60vh
|
||||
background-image: url($never-icon-path)
|
||||
background-position: right bottom
|
||||
background-repeat: no-repeat
|
||||
background-size: contain
|
||||
padding: 0 1.5rem
|
||||
margin-top: 6rem
|
||||
&_title
|
||||
text-align: left
|
||||
|
||||
@keyframes showMenu
|
||||
0%
|
||||
top: 100%
|
||||
opacity: 0
|
||||
|
||||
100%
|
||||
top: 0
|
||||
opacity: 1
|
||||
|
||||
@keyframes hideMenu
|
||||
0%
|
||||
top: 0
|
||||
opacity: 1
|
||||
|
||||
100%
|
||||
top: 100%
|
||||
opacity: 0
|
||||
|
||||
.align
|
||||
h2, h3, h4, h5, h6
|
||||
margin: 0.33rem 0 !important
|
|
@ -0,0 +1,44 @@
|
|||
$padding: 10px
|
||||
$margin: 25px
|
||||
$font-path: '../fonts'
|
||||
$icons: '../images/icons/'
|
||||
$copy-icon-path: '#{$icons}copy.svg'
|
||||
$next-icon-path: '#{$icons}next.svg'
|
||||
$reply-icon-path: '#{$icons}reply.svg'
|
||||
$close-icon-path: '#{$icons}close.svg'
|
||||
$never-icon-path: '#{$icons}sitting.svg'
|
||||
|
||||
// #161d21; // #1F2A2F; // #132433; // #24292e;
|
||||
html
|
||||
--light: #fff
|
||||
--dark: #010101
|
||||
--gray: #f5f5f5
|
||||
--bubble: #111
|
||||
--accent: var(--gray)
|
||||
--bg: var(--light)
|
||||
--text: var(--dark)
|
||||
--theme: #ef7f1a
|
||||
--font: 'Metropolis', sans-serif
|
||||
|
||||
@media (prefers-color-scheme: dark)
|
||||
*
|
||||
box-shadow: none !important
|
||||
html
|
||||
--bg: var(--dark)
|
||||
--text: var(--light)
|
||||
--accent: var(--bubble)
|
||||
|
||||
%narrow
|
||||
max-width: 750px
|
||||
margin: 0 auto
|
||||
|
||||
@mixin viewport($width: 1024px, $margin: 25px)
|
||||
max-width: $width
|
||||
margin: $margin auto
|
||||
@content
|
||||
|
||||
@mixin shadow($opacity: 0.17)
|
||||
box-shadow: 0 0 3rem rgba(0,0,0,$opacity)
|
||||
&:hover
|
||||
box-shadow: 0 0 5rem rgba(0,0,0, (1.5 * $opacity))
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
@import 'variables'
|
||||
@import 'fonts'
|
||||
@import 'base'
|
||||
@import 'components'
|
||||
@import 'utils'
|
||||
@import 'nav'
|
||||
@import 'posts'
|
||||
@import 'audio'
|
||||
@import 'footer'
|
||||
@import 'comments'
|
||||
@import 'syntax'
|
|
@ -0,0 +1,14 @@
|
|||
image: monachus/hugo
|
||||
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
|
||||
pages:
|
||||
script:
|
||||
- cd exampleSite
|
||||
- hugo --themesDir=../.. -d ../public
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
|
@ -0,0 +1,32 @@
|
|||
baseurl = "https://example.com/" # Include trailing slash
|
||||
title = "Hugo Themes"
|
||||
theme = "hugo-swift-theme"
|
||||
author = "Steve Francia"
|
||||
copyright = "Copyright © 2008–2018, Steve Francia and the Hugo Authors; all rights reserved."
|
||||
canonifyurls = true
|
||||
paginate = 4
|
||||
# Enable syntax highlighting
|
||||
# comment on delete the following lines 11 ~ 13
|
||||
pygmentsCodefences = true
|
||||
pygmentsCodefencesGuessSyntax = true
|
||||
|
||||
[params]
|
||||
# ga_analytics = "" # google analytics ID e.g UA-116386578-1
|
||||
|
||||
# ga_verify = "" # google verification code e.g 5jb-rxeBfITeJQKOuUss3ud6FPGTxXkCho-ZN5qlrZg
|
||||
# twitter = "" # twitter handle e.g @weru
|
||||
# logo = "logo.png"
|
||||
# author = "Weru" # default author
|
||||
# image = "placeholder-image.png" # used whenever a page image is not set
|
||||
# blogDir = "blogFolderName" # uncomment and edit to exclude normal pages ... see issue #57
|
||||
# [params.staticman]
|
||||
# endpoint = "" # URL of your own API deployment (without trailing slash), default: "https://staticman-frama.herokuapp.com"
|
||||
# gitProvider = "github" # Either "github" or "gitlab"
|
||||
# username = "username" # GitHub/GitLab user name
|
||||
# repository = "repo" # GitHub/GitLab user name
|
||||
# branch = "master" # Branch holding the source code for your site, should match the `branch` parameter in `staticman.yml`
|
||||
#
|
||||
# # If you use reCAPTCHA v2, you must also set these parameters in staticman.yml
|
||||
# [Params.staticman.reCaptcha]
|
||||
# siteKey = "" # Use your own site key, you need to apply for one on Google
|
||||
# secret = "" # ENCRYPT your password by going to https://<staticman-endpoint>/v3/encrypt/<your-site-secret>
|
|
@ -0,0 +1,18 @@
|
|||
+++
|
||||
title = "About Hugo"
|
||||
date = "2014-04-09"
|
||||
image = 'read.jpg'
|
||||
+++
|
||||
|
||||
Hugo is the **world’s 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).
|
||||
|
|
@ -0,0 +1,344 @@
|
|||
+++
|
||||
title = "(Hu)go Template Primer"
|
||||
description = ""
|
||||
tags = [
|
||||
"go",
|
||||
"golang",
|
||||
"templates",
|
||||
"themes",
|
||||
"development",
|
||||
]
|
||||
date = "2014-04-02"
|
||||
categories = [
|
||||
"Development",
|
||||
"golang",
|
||||
]
|
||||
image = "fast-lane.jpg"
|
||||
+++
|
||||
|
||||
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 © 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/
|
|
@ -0,0 +1,89 @@
|
|||
+++
|
||||
title = "Getting Started with Hugo"
|
||||
description = ""
|
||||
tags = [
|
||||
"go",
|
||||
"golang",
|
||||
"hugo",
|
||||
"development",
|
||||
]
|
||||
date = "2014-04-02"
|
||||
categories = [
|
||||
"Development",
|
||||
"golang",
|
||||
]
|
||||
image = "stuck.jpg"
|
||||
+++
|
||||
|
||||
## 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.
|
|
@ -0,0 +1,151 @@
|
|||
---
|
||||
date: 2014-03-10
|
||||
title: Migrate to Hugo from Jekyll
|
||||
image: 'speakers.jpg'
|
||||
---
|
||||
|
||||
## 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).
|
|
@ -0,0 +1,4 @@
|
|||
- name: "yourName"
|
||||
photo: "myAvatar.jpg"
|
||||
url: "https://myURLofChoice.domain"
|
||||
bio: "It's time to flex. Write a short or not-so-short summary about yourself."
|
|
@ -0,0 +1,2 @@
|
|||
name: Weru
|
||||
url: https://www.linkedin.com/in/dan-weru-profile/
|
|
@ -0,0 +1,10 @@
|
|||
- item: About
|
||||
url: about/
|
||||
- item: Blog
|
||||
url: ""
|
||||
- item: Category A
|
||||
url: categories/development/
|
||||
- item: Category B
|
||||
url: categories/golang/
|
||||
- item: Tag B
|
||||
url: tags/go/
|
|
@ -0,0 +1 @@
|
|||
{"Target":"css/styles.bf17aa32e654a5aa2f07d98bd607a95ff5e36b1f2ea241df0e352fa1cf427067f76b5d01fceacecc8e434805edeedc29099c0132e224fd6ba8148b7f0cbde26f.css","MediaType":"text/css","Data":{"Integrity":"sha512-vxeqMuZUpaovB9mL1gepX/Xjax8uokHfDjUvoc9CcGf3a10B/OrOzI5DSAXt7twpCZwBMuIk/WuoFIt/DL3ibw=="}}
|
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 272 KiB |
|
@ -0,0 +1,31 @@
|
|||
# Edit accordingly
|
||||
comments:
|
||||
allowedFields: ["name", "email", "comment", "replyID", "replyName", "replyThread"]
|
||||
allowedOrigins: ["localhost", "example.com"]
|
||||
branch: "master" # should match your config.toml
|
||||
filename: "comment-{@date:YYYY-MM-DDTHH-mm-ss.SSS}"
|
||||
format: "yaml"
|
||||
commitMessage: "New Staticman comment in {options.slug}"
|
||||
generatedFields:
|
||||
date:
|
||||
type: date
|
||||
options:
|
||||
format: "iso8601"
|
||||
moderation: false
|
||||
name: "Fancy Site Title"
|
||||
path: "data/comments/{options.slug}"
|
||||
requiredFields: ["name", "email", "comment"]
|
||||
transforms:
|
||||
email: md5
|
||||
|
||||
# reCAPTCHA (OPTIONAL)
|
||||
# Register your domain at https://www.google.com/recaptcha/ and choose reCAPTCHA V2
|
||||
# Use your OWN siteKey and secret.
|
||||
reCaptcha:
|
||||
enabled: false
|
||||
# siteKey and secret should match your config.toml
|
||||
#siteKey: "6Lcv8G8UAAAAAEqV1Y-XEPum00C_DxhD6O--qkFo"
|
||||
# (!) ENCRYPT reCaptcha secret key using Staticman /encrypt endpoint
|
||||
# i.e. https://{staticman-endpoint}/v3/encrypt/{your-site-secret}
|
||||
# For more information, https://staticman.net/docs/encryption
|
||||
#secret: "p5uHlH9hCqpMJaGKXdt5MEWFo7K6fX8hoYUwR3aIafOI6rtItLauaDCkGOucysJtrVZy+sHffioGzMsOU64JFDSyPQgrXujegcOHFRXHhD4fOUuBXSvV+OZ8JhSPTGWaRcQcoiGX4pT5hlebLddOl59b6sn6kU1ODQcEbhP83xVLZlaTWOrNrF5Wvy3TMXpH5gyl1tZEORxADAShMYyUbNR7XZYLEg1DfgIBHfIg3cKwdFt7KVLejFGKIiBYRAZDE2JuHItNmzJ2x9JgSK3E+XnShV5tuWpncnyFonJVHGEky/zRfUVLHobDMcJ/u9nlZqE8u47W+833F1WaIYuwNw=="
|
|
@ -0,0 +1,66 @@
|
|||
[designed_by]
|
||||
other = "Designed by <a href = '{{ .url }}' title = 'Linkedin Profile'>{{ .name }}</a>"
|
||||
[share_story]
|
||||
other = "Share Story"
|
||||
[link_copied]
|
||||
other = "Link Copied"
|
||||
[written_by]
|
||||
other = "Written by"
|
||||
[btnReset]
|
||||
other = "Reset"
|
||||
[btnSubmit]
|
||||
other = "Submit"
|
||||
[btnSubmitted]
|
||||
other = "Submitted"
|
||||
[comment]
|
||||
other = "Comment"
|
||||
[noComment]
|
||||
other = "No comment"
|
||||
[email]
|
||||
other = "Email"
|
||||
[name]
|
||||
other = "Name"
|
||||
[typeInComment]
|
||||
other = "Type in a comment..."
|
||||
[moreDay]
|
||||
other = "DAYS"
|
||||
[moreHr]
|
||||
other = "HRS"
|
||||
[moreMin]
|
||||
other = "MINS"
|
||||
[moreMonth]
|
||||
other = "MONTHS"
|
||||
[moreWk]
|
||||
other = "WKS"
|
||||
[moreYr]
|
||||
other = "YRS"
|
||||
[oneDay]
|
||||
other = "DAY"
|
||||
[oneHr]
|
||||
other = "HR"
|
||||
[oneMin]
|
||||
other = "MIN"
|
||||
[oneMonth]
|
||||
other = "MONTH"
|
||||
[oneWk]
|
||||
other = "WK"
|
||||
[oneYr]
|
||||
other = "YR"
|
||||
[timeAgoStr]
|
||||
other = "${timeAgo} ${timeTag} AGO"
|
||||
[close]
|
||||
other = "Close"
|
||||
[successTitle]
|
||||
other = "Review submitted"
|
||||
[successMsg]
|
||||
other = "Thanks for your review! It will be shown on the site once it has been approved."
|
||||
[errTitle]
|
||||
other = "Error"
|
||||
[errMsg]
|
||||
other = "Sorry, there was an error with the submission!"
|
||||
[moreFrom]
|
||||
other = "More from {{ .Count }}"
|
||||
[discard]
|
||||
other = "discard"
|
||||
[discardComment]
|
||||
other = "Discard Comment"
|
|
@ -0,0 +1,66 @@
|
|||
[designed_by]
|
||||
other = "Conçu par <a href = '{{ .url }}' title = 'Profil Linkedin'>{{ .name }}</a>"
|
||||
[share_story]
|
||||
other = "Partager l'histoire"
|
||||
[link_copied]
|
||||
other = "Lien copié"
|
||||
[written_by]
|
||||
other = "Ecrit par"
|
||||
[btnReset]
|
||||
other = "Effacer"
|
||||
[btnSubmit]
|
||||
other = "Envoyer"
|
||||
[btnSubmitted]
|
||||
other = "Envoyé"
|
||||
[comment]
|
||||
other = "Commentaire"
|
||||
[noComment]
|
||||
other = "Pas de commentaire"
|
||||
[email]
|
||||
other = "Email"
|
||||
[name]
|
||||
other = "Nom"
|
||||
[typeInComment]
|
||||
other = "Saisir un commentaire..."
|
||||
[moreDay]
|
||||
other = "JRS"
|
||||
[moreHr]
|
||||
other = "HRS"
|
||||
[moreMin]
|
||||
other = "MINS"
|
||||
[moreMonth]
|
||||
other = "MOIS"
|
||||
[moreWk]
|
||||
other = "SEMS"
|
||||
[moreYr]
|
||||
other = "ANS"
|
||||
[oneDay]
|
||||
other = "JR"
|
||||
[oneHr]
|
||||
other = "HR"
|
||||
[oneMin]
|
||||
other = "MIN"
|
||||
[oneMonth]
|
||||
other = "MOIS"
|
||||
[oneWk]
|
||||
other = "SEM"
|
||||
[oneYr]
|
||||
other = "YR"
|
||||
[timeAgoStr]
|
||||
other = "IL Y A ${timeAgo} ${timeTag}"
|
||||
[close]
|
||||
other = "Fermer"
|
||||
[successTitle]
|
||||
other = "Commentaire envoyé"
|
||||
[successMsg]
|
||||
other = "Merci de votre commentaire ! Il s'affichera sur le site une fois approuvé."
|
||||
[errTitle]
|
||||
other = "Erreur"
|
||||
[errMsg]
|
||||
other = "Désolé, une erreur s'est produite lors de l'envoi du commentaire !"
|
||||
[moreFrom]
|
||||
other = "Plus de billets sur {{ .Count }}"
|
||||
[discard]
|
||||
other = "effacer"
|
||||
[discardComment]
|
||||
other = "Effacer commentaire"
|
|
@ -0,0 +1,66 @@
|
|||
[designed_by]
|
||||
other = "Ontworpen door <a href = '{{ .url }}' title = 'Linkedin Profile'>{{ .name }}</a>"
|
||||
[share_story]
|
||||
other = "Deel artikel"
|
||||
[link_copied]
|
||||
other = "Link gekopieerd!"
|
||||
[written_by]
|
||||
other = "Geschreven door"
|
||||
[btnReset]
|
||||
other = "Reset"
|
||||
[btnSubmit]
|
||||
other = "Verzend"
|
||||
[btnSubmitted]
|
||||
other = "Verzonden"
|
||||
[comment]
|
||||
other = "Commentaar"
|
||||
[noComment]
|
||||
other = "Geen commentaar"
|
||||
[email]
|
||||
other = "Email"
|
||||
[name]
|
||||
other = "Naam"
|
||||
[typeInComment]
|
||||
other = "Schrijf hier je commentaar..."
|
||||
[moreDay]
|
||||
other = "DAGEN"
|
||||
[moreHr]
|
||||
other = "UREN"
|
||||
[moreMin]
|
||||
other = "MINS"
|
||||
[moreMonth]
|
||||
other = "MAANDEN"
|
||||
[moreWk]
|
||||
other = "WEKEN"
|
||||
[moreYr]
|
||||
other = "JAREN"
|
||||
[oneDay]
|
||||
other = "DAG"
|
||||
[oneHr]
|
||||
other = "UUR"
|
||||
[oneMin]
|
||||
other = "MIN"
|
||||
[oneMonth]
|
||||
other = "MAAND"
|
||||
[oneWk]
|
||||
other = "WEEK"
|
||||
[oneYr]
|
||||
other = "JAAR"
|
||||
[timeAgoStr]
|
||||
other = "${timeAgo} ${timeTag} GELEDEN"
|
||||
[close]
|
||||
other = "Sluiten"
|
||||
[successTitle]
|
||||
other = "Review submitted"
|
||||
[successMsg]
|
||||
other = "Thanks for your review! It will be shown on the site once it has been approved."
|
||||
[errTitle]
|
||||
other = "Error"
|
||||
[errMsg]
|
||||
other = "Sorry, there was an error with the submission!"
|
||||
[moreFrom]
|
||||
other = "Meer lezen:"
|
||||
[discard]
|
||||
other = "discard"
|
||||
[discardComment]
|
||||
other = "Discard Comment"
|
|
@ -0,0 +1,66 @@
|
|||
[designed_by]
|
||||
other = "由 <a href = '{{ .url }}' title = '领英个人档案'>{{ .name }}</a> 设计"
|
||||
[share_story]
|
||||
other = "分享故事"
|
||||
[link_copied]
|
||||
other = "已复制"
|
||||
[written_by]
|
||||
other = "作者:"
|
||||
[btnReset]
|
||||
other = "重设"
|
||||
[btnSubmit]
|
||||
other = "提交"
|
||||
[btnSubmitted]
|
||||
other = "已提交"
|
||||
[comment]
|
||||
other = "留言"
|
||||
[noComment]
|
||||
other = "没有留言"
|
||||
[email]
|
||||
other = "电邮"
|
||||
[name]
|
||||
other = "名字"
|
||||
[typeInComment]
|
||||
other = "输入留言"
|
||||
[moreDay]
|
||||
other = "日"
|
||||
[moreHr]
|
||||
other = "小时"
|
||||
[moreMin]
|
||||
other = "分钟"
|
||||
[moreMonth]
|
||||
other = "个月"
|
||||
[moreWk]
|
||||
other = "星期"
|
||||
[moreYr]
|
||||
other = "年"
|
||||
[oneDay]
|
||||
other = "日"
|
||||
[oneHr]
|
||||
other = "小时"
|
||||
[oneMin]
|
||||
other = "分钟"
|
||||
[oneMonth]
|
||||
other = "个月"
|
||||
[oneWk]
|
||||
other = "星期"
|
||||
[oneYr]
|
||||
other = "年"
|
||||
[timeAgoStr]
|
||||
other = "发表于 ${timeAgo} ${timeTag} 前"
|
||||
[close]
|
||||
other = "关闭"
|
||||
[successTitle]
|
||||
other = "留言已提交"
|
||||
[successMsg]
|
||||
other = "谢谢您的留言!经审核后,它将会显示在站上。"
|
||||
[errTitle]
|
||||
other = "错误"
|
||||
[errMsg]
|
||||
other = "抱歉,提交留言出错!"
|
||||
[moreFrom]
|
||||
other = "更多 {{ .Count }} 文章"
|
||||
[discard]
|
||||
other = "清除"
|
||||
[discardComment]
|
||||
other = "清除留言"
|
|
@ -0,0 +1,66 @@
|
|||
[designed_by]
|
||||
other = "由 <a href = '{{ .url }}' title = '領英個人檔案'>{{ .name }}</a> 設計"
|
||||
[share_story]
|
||||
other = "分享故事"
|
||||
[link_copied]
|
||||
other = "已複製"
|
||||
[written_by]
|
||||
other = "作者:"
|
||||
[btnReset]
|
||||
other = "重設"
|
||||
[btnSubmit]
|
||||
other = "提交"
|
||||
[btnSubmitted]
|
||||
other = "已提交"
|
||||
[comment]
|
||||
other = "留言"
|
||||
[noComment]
|
||||
other = "沒有留言"
|
||||
[email]
|
||||
other = "電郵"
|
||||
[name]
|
||||
other = "名字"
|
||||
[typeInComment]
|
||||
other = "輸入留言"
|
||||
[moreDay]
|
||||
other = "日"
|
||||
[moreHr]
|
||||
other = "小時"
|
||||
[moreMin]
|
||||
other = "分鐘"
|
||||
[moreMonth]
|
||||
other = "個月"
|
||||
[moreWk]
|
||||
other = "星期"
|
||||
[moreYr]
|
||||
other = "年"
|
||||
[oneDay]
|
||||
other = "日"
|
||||
[oneHr]
|
||||
other = "小時"
|
||||
[oneMin]
|
||||
other = "分鐘"
|
||||
[oneMonth]
|
||||
other = "個月"
|
||||
[oneWk]
|
||||
other = "星期"
|
||||
[oneYr]
|
||||
other = "年"
|
||||
[timeAgoStr]
|
||||
other = "發表於 ${timeAgo} ${timeTag} 前"
|
||||
[close]
|
||||
other = "關閉"
|
||||
[successTitle]
|
||||
other = "留言已提交"
|
||||
[successMsg]
|
||||
other = "謝謝您的留言!經審核後,它將會顯示在站上。"
|
||||
[errTitle]
|
||||
other = "錯誤"
|
||||
[errMsg]
|
||||
other = "抱歉,提交留言出錯!"
|
||||
[moreFrom]
|
||||
other = "更多 {{ .Count }} 文章"
|
||||
[discard]
|
||||
other = "清除"
|
||||
[discardComment]
|
||||
other = "清除留言"
|
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 272 KiB |
|
@ -0,0 +1,7 @@
|
|||
{{ define "main" }}
|
||||
<div class = 'never wrap'>
|
||||
<h1 class = 'never_title'>Uh Ohhh!</h1>
|
||||
<p class = 'pale'>We couldn't find the page you're looking for</p>
|
||||
<div class = 'btn btn_back'>Go Back</div>
|
||||
</div>
|
||||
{{ end }}
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang='{{ .Lang }}'>
|
||||
{{- partial "head" . }}
|
||||
<body>
|
||||
{{- partial "nav" . }}
|
||||
<main>
|
||||
{{- block "main" . }}{{ end }}
|
||||
</main>
|
||||
{{- partial "icons" }}
|
||||
{{- partial "footer" . }}
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,3 @@
|
|||
{{- define "main" }}
|
||||
{{- partial "archive" . }}
|
||||
{{- end }}
|
|
@ -0,0 +1,45 @@
|
|||
{{- define "main" }}
|
||||
{{- $scratch := newScratch }}
|
||||
{{- if isset .Params "image" }}
|
||||
{{- $scratch.Set "image" .Params.image }}
|
||||
{{- else }}
|
||||
{{- if isset .Params "featured_image" }}
|
||||
{{- $scratch.Set "image" .Params.featured_image }}
|
||||
{{- else }}
|
||||
{{ $scratch.Set "image" "thumbnail.svg" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $image := $scratch.Get "image" }}
|
||||
{{- $bg := ( $image | absLangURL) }}
|
||||
<section class = 'post_header' style = 'background-image:url({{ $bg }});'>
|
||||
</section>
|
||||
<div class = 'post'>
|
||||
<div class='post_metadata'>
|
||||
<hr/>
|
||||
<h1 class='post_title'>{{ .Title }}</h1>
|
||||
<h3>
|
||||
<svg>
|
||||
<use xlink:href="#calendar"></use>
|
||||
</svg>
|
||||
{{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }}
|
||||
</h3>
|
||||
<hr/>
|
||||
</div>
|
||||
<article class='post_content'>
|
||||
{{- .Content }}
|
||||
<div class = 'post_extra'>
|
||||
{{- partial "copy" . }}
|
||||
</div>
|
||||
{{- partial "author" . }}
|
||||
</article>
|
||||
{{- if .Site.Params.Staticman }}
|
||||
{{- partial "comments" . }}
|
||||
{{- end }}
|
||||
<aside>
|
||||
{{- partial "aside" . }}
|
||||
</aside>
|
||||
</div>
|
||||
<script src = '{{ absURL "js/autosize.min.js" }}'></script>
|
||||
{{- $timeagoScr := resources.Get "js/timeago.js" | resources.ExecuteAsTemplate "js/timeago.js" . }}
|
||||
<script src = '{{ $timeagoScr.Permalink }}'></script>
|
||||
{{- end }}
|
|
@ -0,0 +1,3 @@
|
|||
{{ define "main" }}
|
||||
{{- partial "archive" }}
|
||||
{{ end }}
|
|
@ -0,0 +1,9 @@
|
|||
{{- with .Site.Params.ga_analytics }}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ . }}');
|
||||
</script>
|
||||
{{- end -}}
|
|
@ -0,0 +1,40 @@
|
|||
|
||||
{{- if isset .Params "image" }}
|
||||
{{- $bg := ( .Params.image | absLangURL) }}
|
||||
<section class = 'post_header' style = 'background-image:url({{ $bg }});'>
|
||||
</section>
|
||||
{{- else }}
|
||||
<section style='padding: 2rem'></section>
|
||||
{{- end}}
|
||||
|
||||
{{ if eq .Paginator.PageNumber 1 }}
|
||||
<div class = 'post'>
|
||||
<article class='post_content'>
|
||||
{{- .Content }}
|
||||
</article>
|
||||
</div>
|
||||
<hr/>
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Paginator.TotalPages 0 }}
|
||||
<section style='padding: 2rem'></section>
|
||||
{{ else }}
|
||||
<div class = 'post'>
|
||||
<h1>
|
||||
{{- if isset .Params "posttitle" }}
|
||||
{{ .Params.posttitle }}
|
||||
{{- else }}
|
||||
{{ i18n "moreFrom" .Site.Title }}
|
||||
{{- end }}
|
||||
<span class='pages'>({{ .Paginator.PageNumber }}/{{ .Paginator.TotalPages }})</span> »
|
||||
</h1>
|
||||
</div>
|
||||
<ul class='posts wrap' id = 'posts'>
|
||||
{{- range (.Paginate .Pages).Pages }}
|
||||
{{ partial "excerpt" . }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{- template "_internal/pagination.html" . }}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<h3>{{ i18n "moreFrom" .Site.Title }}</h3>
|
||||
<ul class='posts aside'>
|
||||
{{- $kin := (where .Site.RegularPages ".Params.tags" "intersect" .Params.tags) }}
|
||||
{{- $siblings := (where $kin ".Title" "!=" .Title) }}
|
||||
{{- with $siblings }}
|
||||
{{- range first 2 . }}
|
||||
{{- partial "excerpt" . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $kin := (where .Site.RegularPages "Section" .Section) }}
|
||||
{{- $siblings := (where $kin ".Title" "!=" .Title) }}
|
||||
{{- range first 2 $siblings }}
|
||||
{{- partial "excerpt" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</ul>
|
|
@ -0,0 +1,16 @@
|
|||
{{- $authors := .Site.Data.authors }}
|
||||
{{- $pageAuthor := lower .Params.author }}
|
||||
{{- with $authors }}
|
||||
{{- $author := index (where . (lower "name") $pageAuthor) 0 }}
|
||||
{{ with $author }}
|
||||
<div class = 'author'>
|
||||
<a href = '{{ .url }}' target = "{{ .name }}'s profile" class = 'author_pic'>
|
||||
<img src = '{{ absURL (printf "images/%s" .photo) }}' alt = ''>
|
||||
</a>
|
||||
<div class = 'author_meta'>
|
||||
<a class = 'author_name' href = '{{ .url }}'>{{ with .fullName }}{{ . }}{{ else }}{{ .name }}{{ end }}</a>
|
||||
<p class = 'pale author_bio solo'>{{ .bio }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end }}
|
|
@ -0,0 +1,40 @@
|
|||
{{- $vs := .Site.Params.staticman }}
|
||||
<span class = 'form_toggle btn'>{{ i18n "comment" }}</span>
|
||||
<form class = 'form' method = 'POST'>
|
||||
<!-- Start comment form display reply target -->
|
||||
<p class='reply_notice'>
|
||||
<span class='reply_to'></span>
|
||||
</p>
|
||||
<!-- End comment form display reply target -->
|
||||
|
||||
<input type = 'hidden' class = 'form_input form_slug' name = 'options[slug]' value = '{{ md5 .File.Path }}'>
|
||||
<input type='hidden' class='form_input reply_thread' name='fields[replyThread]'>
|
||||
<input type='hidden' class='form_input reply_id' name='fields[replyId]'>
|
||||
<input type='hidden' class='form_input reply_name' name='fields[replyName]'>
|
||||
{{- with $vs.reCaptcha -}}
|
||||
<input name = 'options[reCaptcha][siteKey]' type = 'hidden' value = '{{ .sitekey }}'>
|
||||
<input name = 'options[reCaptcha][secret]' type = 'hidden' value = '{{ .secret }}'>
|
||||
{{- end -}}
|
||||
|
||||
<label class = 'form_label'>{{ i18n "name" }}</label>
|
||||
<input name = 'fields[name]' type = 'text' placeholder = '{{ i18n "name" }}' class = 'form_input form_name' required>
|
||||
<label class = 'form_label'>{{ i18n "email" }}</label>
|
||||
<input name = 'fields[email]' type = 'email' placeholder = '{{ i18n "email" }}' class = 'form_input form_email' required>
|
||||
<label class = 'form_label'>{{ i18n "comment" }}</label>
|
||||
<textarea name = 'fields[comment]' placeholder = '{{ i18n "typeInComment" }}' class = 'form_input form_comment' required></textarea>
|
||||
|
||||
{{- with $vs.reCaptcha -}}
|
||||
<div class = 'g-recaptcha' data-sitekey = '{{ .sitekey }}' data-callback='enableSubmitComment'></div>
|
||||
<script type="text/javascript">
|
||||
function enableSubmitComment(){
|
||||
document.getElementById('submitComment').disabled = false;
|
||||
}
|
||||
</script>
|
||||
<script async src = 'https://www.google.com/recaptcha/api.js'></script>
|
||||
{{- end -}}
|
||||
|
||||
<div class = 'btn_group'>
|
||||
<input type = 'submit' id = 'submitComment' value = '{{ i18n "btnSubmit" }}' class = 'btn form_submit' {{- if $vs.reCaptcha }} disabled {{- end }}>
|
||||
<div class='form_reset btn_close icon'></div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,42 @@
|
|||
<h3>Comments</h3>
|
||||
<div class = 'comments'>
|
||||
{{- $entryId := md5 .File.Path -}}
|
||||
{{ if .Site.Data.comments }}
|
||||
{{- $comments := index $.Site.Data.comments $entryId -}}
|
||||
{{ if not $comments }}
|
||||
<p>{{ i18n "noComment" }}</p>
|
||||
{{ else }}
|
||||
{{ range $comments }}
|
||||
{{ if not .replyThread }}
|
||||
{{ $.Scratch.Set "threadID" ._id }}
|
||||
<div id = '{{ ._id }}' class = 'comment'>
|
||||
<img src = 'https://www.gravatar.com/avatar/{{ .email }}?s=100' alt = 'user icon' class = 'comment_pic'>
|
||||
<div class = 'comment_meta'>
|
||||
<a href='#{{ ._id }}'><div class = 'comment_heading pale' data-time = '{{ .date }}'></div></a>
|
||||
<div class = 'comment_author comment_name'><span class="comment_name_span">{{ .name }}</span></div>
|
||||
</div>
|
||||
<p class = 'solo comment_bio pale'>{{ .comment | markdownify }}</p>
|
||||
<div class = 'comment_thread hidden'>{{ ._id }}</div>
|
||||
<div class = 'reply_btn icon'></div>
|
||||
</div>
|
||||
|
||||
{{ range $comments }}
|
||||
{{ if eq .replyThread ($.Scratch.Get "threadID") }}
|
||||
<div id = '{{ ._id }}' class = 'comment comment_reply'>
|
||||
<img src = 'https://www.gravatar.com/avatar/{{ .email }}?s=100' alt = 'user icon' class = 'comment_pic'>
|
||||
<div class = 'comment_meta'>
|
||||
<a href='#{{ ._id }}'><div class = 'comment_heading pale' data-time = '{{ .date }}'></div></a>
|
||||
<div class = 'comment_author comment_name'><span class = 'comment_name_span'>{{ .name }}</span><span> ↷ </span><a href='#{{ .replyID }}' class='reply_target'>{{ .replyName }}</a></div>
|
||||
</div>
|
||||
<p class = 'solo comment_bio pale'>{{ .comment | markdownify }}</p>
|
||||
<div class = 'comment_thread hidden'>{{ .replyThread }}</div>
|
||||
<div class = 'reply_btn icon'></div>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- partial "comments-form" . }}
|
||||
</div>
|
|
@ -0,0 +1,5 @@
|
|||
<div class = 'copy' data-share = '{{ i18n "share_story" }}' data-copied = '{{ i18n "link_copied" }}'>
|
||||
<svg>
|
||||
<use xlink:href="#copy"></use>
|
||||
</svg>
|
||||
</div>
|
|
@ -0,0 +1,32 @@
|
|||
{{- $scratch := newScratch }}
|
||||
{{- if isset .Params "image" }}
|
||||
{{- $scratch.Set "image" .Params.image }}
|
||||
{{- else }}
|
||||
{{- if isset .Params "featured_image" }}
|
||||
{{- $scratch.Set "image" .Params.featured_image }}
|
||||
{{- else }}
|
||||
{{ $scratch.Set "image" "thumbnail.svg" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $image := $scratch.Get "image" }}
|
||||
{{- $bg := ( $image | absLangURL) }}
|
||||
<li class = 'post_item'>
|
||||
<a class = 'post_card' href='{{ .RelPermalink }}' title = '{{ .Title }}' style = 'background-image: url({{ $bg }});'>
|
||||
</a>
|
||||
<div class = 'excerpt'>
|
||||
<div class = 'excerpt_meta'>
|
||||
{{- with .Params.tags -}}
|
||||
{{- range first 1 . }}
|
||||
{{- $tag := . | urlize }}
|
||||
<a href = '{{ absURL (printf "tags/%s" $tag) }}' class = 'post_tag'>
|
||||
{{- . }}
|
||||
</a>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
<h3 class = 'post_link'>
|
||||
<a href='{{ .RelPermalink }}'>{{ .Title }}</a>
|
||||
</h3>
|
||||
<p class = 'pale'>{{ .Summary | truncate 90 }}</p>
|
||||
</div>
|
||||
</li>
|
|
@ -0,0 +1,9 @@
|
|||
<footer class = 'footer'>
|
||||
<div class = 'footer_inner wrap pale'>
|
||||
<p>© <span class = 'year'></span> {{ .Site.Title }}.
|
||||
{{ i18n "designed_by" .Site.Data.designer | safeHTML }}</p>
|
||||
</div>
|
||||
</footer>
|
||||
{{- $mainScriptPath := "js/index.js" }}
|
||||
{{- $scripts := resources.Get $mainScriptPath | resources.ExecuteAsTemplate $mainScriptPath . | resources.Minify | resources.Fingerprint "sha512" }}
|
||||
<script src = '{{ $scripts.Permalink }}'></script>
|
|
@ -0,0 +1,8 @@
|
|||
<!-- hugo doesn't provide extra settings like anonymizeIp ... -->
|
||||
<script>
|
||||
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
||||
ga('create', '{{ .Site.GoogleAnalytics}}', 'auto');
|
||||
ga('set', 'anonymizeIp', true);
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
<script async src='//www.google-analytics.com/analytics.js'></script>
|
|
@ -0,0 +1,35 @@
|
|||
<head>
|
||||
<title>{{ with .Title }}{{ humanize . }} | {{ end }}{{ .Site.Title }}</title>
|
||||
<meta charset='utf-8'>
|
||||
{{ hugo.Generator }}
|
||||
{{- with .Site.Params.ga_verify }}
|
||||
<meta name="google-site-verification" content="{{ . }}" />
|
||||
{{- end }}
|
||||
<meta name = 'viewport' content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no'>
|
||||
<meta http-equiv = 'X-UA-Compatible' content = 'IE=edge'>
|
||||
{{- if (ne hugo.Environment "development") }}
|
||||
{{ partial "google-analytics-anonymous.html" . }}
|
||||
{{- end }}
|
||||
|
||||
{{- partial "opengraph" . }}
|
||||
{{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "post") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
|
||||
|
||||
{{ if $related }}
|
||||
{{ range $related }}
|
||||
<meta property="og:see_also" content="{{ .Permalink }}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<meta property="article:published_time" content="{{ .PublishDate }}" />
|
||||
<meta property="article:modified_time" content="{{ .Date }}" />
|
||||
<meta property="article:section" content="{{ .Section }}" />
|
||||
{{ with .Params.tags }}{{ range first 6 . }}
|
||||
<meta property="article:tag" content="{{ . }}" />
|
||||
{{ end }}{{ end }}
|
||||
|
||||
<link rel="icon" href="/images/favicon.png" type="image/png">
|
||||
<link rel='canonical' href='{{ .Permalink }}'>
|
||||
{{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}}
|
||||
{{- $styles := resources.Get "sass/main.sass" | resources.ExecuteAsTemplate "main.sass" . | resources.ToCSS $options | resources.Fingerprint "sha512" }}
|
||||
<link rel = 'stylesheet' href = '{{ $styles.Permalink }}' integrity = '{{ $styles.Data.Integrity }}'>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Signika:wght@700&display=swap" rel="stylesheet">
|
||||
</head>
|
|
@ -0,0 +1,19 @@
|
|||
<header class = 'nav' >
|
||||
<a href='{{ absURL "" }}'>
|
||||
<img src="{{ .Site.Params.logo }}" id="logo" />
|
||||
</a>
|
||||
<nav class = 'nav-menu'>
|
||||
<a href='{{ absURL "" }}' class = 'nav-brand nav_item'>
|
||||
{{ .Site.Title }}
|
||||
</a>
|
||||
|
||||
{{- range .Site.Data.menu }}
|
||||
<a href = '{{ absURL .url }}' class = 'nav_main_item nav_item'>{{ .item }}</a>
|
||||
{{- end }}
|
||||
|
||||
|
||||
<div class = 'nav_bar-wrap'>
|
||||
<div class = 'nav_bar'></div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
|
@ -0,0 +1,12 @@
|
|||
<svg width="0" height="0" class="hidden">
|
||||
<symbol viewBox="0 0 699.428 699.428" xmlns="http://www.w3.org/2000/svg" id="copy">
|
||||
<path d="M502.714 0H240.428C194.178 0 153 42.425 153 87.429l-25.267.59c-46.228 0-84.019 41.834-84.019 86.838V612c0 45.004 41.179 87.428 87.429 87.428H459c46.249 0 87.428-42.424 87.428-87.428h21.857c46.25 0 87.429-42.424 87.429-87.428v-349.19zM459 655.715H131.143c-22.95 0-43.714-21.441-43.714-43.715V174.857c0-22.272 18.688-42.993 41.638-42.993l23.933-.721v393.429C153 569.576 194.178 612 240.428 612h262.286c0 22.273-20.765 43.715-43.714 43.715zm153-131.143c0 22.271-20.765 43.713-43.715 43.713H240.428c-22.95 0-43.714-21.441-43.714-43.713V87.429c0-22.272 20.764-43.714 43.714-43.714H459c-.351 50.337 0 87.975 0 87.975 0 45.419 40.872 86.882 87.428 86.882H612zm-65.572-349.715c-23.277 0-43.714-42.293-43.714-64.981V44.348L612 174.857zm-43.714 131.537H306c-12.065 0-21.857 9.77-21.857 21.835s9.792 21.835 21.857 21.835h196.714c12.065 0 21.857-9.771 21.857-21.835 0-12.065-9.792-21.835-21.857-21.835zm0 109.176H306c-12.065 0-21.857 9.77-21.857 21.834 0 12.066 9.792 21.836 21.857 21.836h196.714c12.065 0 21.857-9.77 21.857-21.836 0-12.064-9.792-21.834-21.857-21.834z"
|
||||
></path>
|
||||
</symbol>
|
||||
<symbol id="calendar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
||||
<path fill="currentColor" d="M0 464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V192H0v272zm64-192c0-8.8 7.2-16 16-16h288c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16v-64zM400 64h-48V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H160V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H48C21.5 64 0 85.5 0 112v48h448v-48c0-26.5-21.5-48-48-48z"></path>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 60.015 60.015" xmlns="http://www.w3.org/2000/svg" id="reply">
|
||||
<path d="M42.007 0h-24c-9.925 0-18 8.075-18 18v14c0 9.59 7.538 17.452 17 17.973v8.344a1.694 1.694 0 0 0 1.699 1.698c.44 0 .873-.173 1.198-.498l1.876-1.876C26.708 52.713 33.259 50 40.227 50h1.78c9.925 0 18-8.075 18-18V18c0-9.925-8.075-18-18-18zm16 32c0 8.822-7.178 16-16 16h-1.78c-7.502 0-14.556 2.921-19.86 8.226l-1.359 1.359V44a1 1 0 1 0-2 0v3.949c-8.356-.52-15-7.465-15-15.949V18c0-8.822 7.178-16 16-16h24c8.822 0 16 7.178 16 16v14z"></path>
|
||||
</symbol>
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
|
@ -0,0 +1,9 @@
|
|||
<div class = 'nav-drop'>
|
||||
<div class = 'nav-body'>
|
||||
{{- range .Site.Data.menu }}
|
||||
<a href = '{{ absURL .url }}' class = 'nav_item'>{{ .item }}</a>
|
||||
{{- end }}
|
||||
<div class = 'nav-close'></div>
|
||||
</div>
|
||||
</div>
|
||||
{{- partial "header" . }}
|
|
@ -0,0 +1,67 @@
|
|||
{{- $summary := .Summary | truncate 160 }}
|
||||
{{- with .Params.description }}
|
||||
{{- $summary = (. | truncate 160) }}
|
||||
{{- end }}
|
||||
{{- $site := .Site.Title }}
|
||||
{{- $title := .Title }}
|
||||
{{- $params := .Site.Params }}
|
||||
{{- $permalink := .Permalink }}
|
||||
{{- $logo := absURL (printf "images/%s" $params.logo) }}
|
||||
{{- $image := absURL (printf "images/%s" $params.image) }}
|
||||
{{- $author := $params.author }}
|
||||
{{- with .Params.author }}
|
||||
{{ $author := . }}
|
||||
{{- end }}
|
||||
{{- with .Params.image }}
|
||||
{{- $image = absURL (printf "images/%s" .) }}
|
||||
{{- end }}
|
||||
<meta property = 'og:locale' content = 'en_US' />
|
||||
{{- if .IsHome }}
|
||||
<meta property="og:type" content="website">
|
||||
{{- else }}
|
||||
<meta property="og:type" content="article">
|
||||
{{- end }}
|
||||
<meta property = 'og:title' content = '{{ $title }}' />
|
||||
<meta name="description" content="{{ $summary }}">
|
||||
<meta property = 'og:description' content = '{{ $summary }}'>
|
||||
<meta property = 'og:url' content = '{{ $permalink }}' />
|
||||
<meta property = 'og:image' content = '{{ $image }}'/>
|
||||
<meta name = 'twitter:card' content = 'summary_large_image' />
|
||||
<meta name = 'twitter:creator' content = '{{ $params.twitter }}'>
|
||||
<meta name = 'twitter:title' content = '{{ .Title }}' />
|
||||
<meta property = 'twitter:description' content = '{{ $summary }}'/>
|
||||
<meta name = 'twitter:image' content = '{{ $image }}' />
|
||||
{{- if eq .Section "blog" -}}
|
||||
{{- $date := ( .Date.Format "2006-02-01") -}}
|
||||
{{- $date := (time .Date) }}
|
||||
{{- $lastMod := (time .Lastmod) }}
|
||||
<script type = "application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
"mainEntityOfPage":"{{ $permalink }}",
|
||||
"name": "{{ $site }}",
|
||||
"headline": {{ $title }},
|
||||
"description": {{ $summary }},
|
||||
"url": "{{ $permalink }}",
|
||||
"datePublished": {{ $date }},
|
||||
"dateModified": {{ $lastMod }},
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ $author }}"
|
||||
},
|
||||
"image":{
|
||||
"@type":"ImageObject",
|
||||
"url": "{{ $image }}"
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"logo": {
|
||||
"@type":"ImageObject",
|
||||
"url": "{{ $logo }}"
|
||||
},
|
||||
"name": "{{ $site }}"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{{- end }}
|
|
@ -0,0 +1,19 @@
|
|||
{{- $imageBase := absURL "images/icons/" }}
|
||||
{{- $paginator := .Paginator }}
|
||||
{{- if gt $paginator.TotalPages 1 }}
|
||||
<div class = 'pager' id = 'pager'>
|
||||
{{- if $paginator.HasPrev }}
|
||||
<a href='{{ $paginator.Prev.URL }}#pager' class = ' pager_item pager_prev'></a>
|
||||
{{- else }}
|
||||
<span class = ' pager_item pager_active pager_prev'></span>
|
||||
{{- end }}
|
||||
{{- range first 4 $paginator.Pagers }}
|
||||
<a href="{{ .URL }}#pager" class = 'pager_item{{ if eq . $paginator }} pager_active{{ end }}'>{{ .PageNumber }}</a>
|
||||
{{- end }}
|
||||
{{- if $paginator.HasNext -}}
|
||||
<a href='{{ $paginator.Next.URL }}#pager' class = ' pager_item pager_next'></a>
|
||||
{{- else -}}
|
||||
<span class = ' pager_item pager_active pager_next'></span>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- end }}
|
|
@ -0,0 +1,9 @@
|
|||
{{- $normal := .Get 0 }}
|
||||
{{- $dark := .Get 1 }}
|
||||
{{- $alt := .Get 2 }}
|
||||
{{- $normalPath := absURL (printf "images/%s" $normal) }}
|
||||
{{- $darkPath := absURL (printf "images/%s" $dark) }}
|
||||
<picture class = 'nav_logo'>
|
||||
<source srcset = '{{ $darkPath }}' media="(prefers-color-scheme: dark)">
|
||||
<img srcset = '{{ $normalPath }}' alt = '{{ $alt }}'>
|
||||
</picture>
|
|
@ -0,0 +1,4 @@
|
|||
{{ $url := .Get 0 }}
|
||||
<div class = 'video'>
|
||||
<iframe src='https://www.youtube.com/embed/{{ $url }}?controls=1&rel=0'></iframe>
|
||||
</div>
|
After Width: | Height: | Size: 160 KiB |
After Width: | Height: | Size: 159 KiB |
After Width: | Height: | Size: 223 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 19 KiB |
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square150x150logo src="/assets/favicons/mstile-150x150.png"/>
|
||||
<TileColor>#ffc40d</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
</browserconfig>
|
|
@ -0,0 +1 @@
|
|||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="calendar-week" class="svg-inline--fa fa-calendar-week fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M0 464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V192H0v272zm64-192c0-8.8 7.2-16 16-16h288c8.8 0 16 7.2 16 16v64c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16v-64zM400 64h-48V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H160V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H48C21.5 64 0 85.5 0 112v48h448v-48c0-26.5-21.5-48-48-48z"></path></svg>
|
After Width: | Height: | Size: 578 B |
|
@ -0,0 +1 @@
|
|||
<svg enable-background="new 0 0 15.642 15.642" viewBox="0 0 15.642 15.642" xmlns="http://www.w3.org/2000/svg"><path fill="#fff" d="m8.882 7.821 6.541-6.541c.293-.293.293-.768 0-1.061s-.768-.293-1.061 0l-6.541 6.541-6.541-6.54c-.293-.293-.768-.293-1.061 0s-.293.768 0 1.061l6.541 6.541-6.54 6.54c-.293.293-.293.768 0 1.061.147.146.338.22.53.22s.384-.073.53-.22l6.541-6.541 6.541 6.541c.147.146.338.22.53.22s.384-.073.53-.22c.293-.293.293-.768 0-1.061z"/></svg>
|
After Width: | Height: | Size: 460 B |
|
@ -0,0 +1 @@
|
|||
<svg enable-background="new 0 0 699.428 699.428" height="699.428" viewBox="0 0 699.428 699.428" width="699.428" xmlns="http://www.w3.org/2000/svg"><path d="m502.714 0c-2.71 0-262.286 0-262.286 0-46.25 0-87.428 42.425-87.428 87.429l-25.267.59c-46.228 0-84.019 41.834-84.019 86.838v437.143c0 45.004 41.179 87.428 87.429 87.428h327.857c46.249 0 87.428-42.424 87.428-87.428h21.857c46.25 0 87.429-42.424 87.429-87.428v-349.19zm-43.714 655.715h-327.857c-22.95 0-43.714-21.441-43.714-43.715v-437.143c0-22.272 18.688-42.993 41.638-42.993l23.933-.721v393.429c0 45.004 41.178 87.428 87.428 87.428h262.286c0 22.273-20.765 43.715-43.714 43.715zm153-131.143c0 22.271-20.765 43.713-43.715 43.713h-327.857c-22.95 0-43.714-21.441-43.714-43.713v-437.143c0-22.272 20.764-43.714 43.714-43.714h218.572c-.351 50.337 0 87.975 0 87.975 0 45.419 40.872 86.882 87.428 86.882h65.572zm-65.572-349.715c-23.277 0-43.714-42.293-43.714-64.981 0 0 0-22.994 0-65.484v-.044l109.286 130.509zm-43.714 131.537h-196.714c-12.065 0-21.857 9.77-21.857 21.835s9.792 21.835 21.857 21.835h196.714c12.065 0 21.857-9.771 21.857-21.835 0-12.065-9.792-21.835-21.857-21.835zm0 109.176h-196.714c-12.065 0-21.857 9.77-21.857 21.834 0 12.066 9.792 21.836 21.857 21.836h196.714c12.065 0 21.857-9.77 21.857-21.836 0-12.064-9.792-21.834-21.857-21.834z" fill="#04a763"/></svg>
|
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 859 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 15 KiB |
|
@ -0,0 +1 @@
|
|||
<svg enable-background="new 0 0 64 64" height="512" viewBox="0 0 64 64" width="512" xmlns="http://www.w3.org/2000/svg"><g fill="#04a763"><path d="m19 40c1.104 0 2-.896 2-2s-.896-2-2-2c-3.86 0-7-3.14-7-7 0-1.873.728-3.628 2.059-4.95 1.313-1.322 3.068-2.05 4.941-2.05h10c3.86 0 7 3.14 7 7 0 .258-.015.509-.048.78-.174 1.574-.885 3.052-2.017 4.176-.532.54-1.137.974-1.797 1.289-.997.476-1.419 1.669-.944 2.666.476.996 1.669 1.419 2.667.943 1.08-.516 2.063-1.219 2.908-2.075 1.763-1.75 2.885-4.08 3.156-6.539.051-.413.075-.819.075-1.24 0-6.065-4.935-11-11-11h-10c-2.947 0-5.709 1.147-7.77 3.221-2.083 2.07-3.23 4.832-3.23 7.779 0 6.065 4.935 11 11 11z"/><path d="m45 28c-1.104 0-2 .896-2 2s.896 2 2 2c3.86 0 7 3.141 7 7 0 1.873-.728 3.628-2.059 4.95-1.313 1.322-3.068 2.05-4.941 2.05h-10c-3.86 0-7-3.141-7-7 0-.258.015-.509.048-.78.174-1.574.885-3.052 2.017-4.176.532-.54 1.136-.974 1.796-1.289.997-.476 1.419-1.67.944-2.667s-1.669-1.418-2.667-.944c-1.081.516-2.064 1.22-2.908 2.076-1.763 1.75-2.885 4.08-3.156 6.538-.05.415-.074.821-.074 1.242 0 6.065 4.935 11 11 11h10c2.946 0 5.709-1.147 7.77-3.221 2.083-2.07 3.23-4.833 3.23-7.779 0-6.065-4.935-11-11-11z"/></g></svg>
|
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1,6 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 129 129" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 129 129">
|
||||
<g>
|
||||
<path fill="#FFFFFF" d="m40.4,121.3c-0.8,0.8-1.8,1.2-2.9,1.2s-2.1-0.4-2.9-1.2c-1.6-1.6-1.6-4.2 0-5.8l51-51-51-51c-1.6-1.6-1.6-4.2 0-5.8 1.6-1.6 4.2-1.6 5.8,0l53.9,53.9c1.6,1.6 1.6,4.2 0,5.8l-53.9,53.9z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 424 B |
|
@ -0,0 +1 @@
|
|||
<svg enable-background="new 0 0 60.015 60.015" viewBox="0 0 60.015 60.015" xmlns="http://www.w3.org/2000/svg"><path fill="#04a763" d="m42.007 0h-24c-9.925 0-18 8.075-18 18v14c0 9.59 7.538 17.452 17 17.973v8.344c0 .688.411 1.304 1.047 1.568.212.087.433.13.652.13.44 0 .873-.173 1.198-.498l1.876-1.876c4.928-4.928 11.479-7.641 18.447-7.641h1.78c9.925 0 18-8.075 18-18v-14c0-9.925-8.075-18-18-18zm16 32c0 8.822-7.178 16-16 16h-1.78c-7.502 0-14.556 2.921-19.86 8.226l-1.359 1.359v-8.585-1-4c0-.552-.447-1-1-1s-1 .448-1 1v3.949c-8.356-.52-15-7.465-15-15.949v-14c0-8.822 7.178-16 16-16h24c8.822 0 16 7.178 16 16v14z" /></svg>
|
After Width: | Height: | Size: 620 B |
|
@ -0,0 +1 @@
|
|||
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|
|
@ -0,0 +1 @@
|
|||
<svg fill="none" height="585" viewBox="0 0 557 585" width="557" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m325.738 138.49c4.608-5.408 7.727-12.037 7.206-19.464-1.502-21.4008-31.292-16.693-37.087-5.892s-5.106 38.199 2.383 40.13c2.987.77 9.35-1.116 15.825-5.02l-4.064 28.756h24z" fill="#b28b67"/><path d="m327.582 143.308c3.013-13.401 11.594-22.536 10.283-28.526-.873-3.993-3.202-6.476-6.986-7.45-1.957-7.9163-8.268-11.2836-18.934-10.1014-15.999 1.7732-25.764 8.4174-21.547 23.0374 3.877 0 8.556-1.402 15.027 1 2.053.762 3.522 3.126 4.406 7.09h2.924c2.838-4.705 5.636-6.434 8.395-5.187 2.758 1.247 3.386 4.277 1.881 9.088l1.441 11.049z" fill="#0a0a0d"/><path d="m401.001 302h-115c-8.837 0-16 7.164-16 16v92c0 8.837 7.163 16 16 16h115c8.836 0 16-7.163 16-16v-92c0-8.836-7.164-16-16-16zm-16 28c2.209 0 4 1.791 4 4v60c0 2.209-1.791 4-4 4h-83c-2.21 0-4-1.791-4-4v-60c0-2.209 1.79-4 4-4z" fill="#333"/><path d="m170.842 421c19.716-24.076 33.056-41.924 40.02-53.546 11.925-19.899 21.685-37.606 24.766-44.369 7.344-16.13-16.909-23.682-22.398-16.159-8.308 11.387-26.051 47.217-53.229 107.492z" fill="#b28b67"/><path d="m211.243 414 36.692-92.363c7.848-16.837-30.05-27.905-35.818-20.069-13.094 17.789-44.215 87.966-48.116 93.266z" fill="#333"/><path d="m308.968 395.477c-7.148-10.426-33.146-45.502-47.306-60.016-4.07-4.17-8.04-8.173-11.795-11.903-11.162-11.088-33.39 7.548-22.249 17.647 27.747 25.15 68.232 59.102 71.614 62.129 4.741 4.243 14.228-1.304 9.736-7.857z" fill="#b28b67"/><path d="m307.296 390.767c2.462 2.027 4.064 3.683 4.805 4.967.902 1.562 1.957 3.991 3.167 7.287-1.812 1.046-18.094 10.447-48.846 28.201-3.692-3.463-4.267-6.152-1.725-8.065 2.541-1.914 4.639-3.528 6.292-4.842l16.859-23.228c.325-.447.95-.546 1.397-.222.008.006.015.011.023.017l3.503 2.697c3.214-.28 5.612-.877 7.195-1.791 1.286-.743 2.762-2.287 4.428-4.634.639-.901 1.888-1.113 2.789-.473.038.027.076.056.113.086z" fill="#666464"/><path d="m179.322 417.402c1.119 2.987 1.679 5.221 1.679 6.704 0 1.803-.301 4.435-.902 7.894-2.092 0-20.892 0-56.401 0-1.466-4.845-.62-7.461 2.538-7.848 3.158-.386 5.781-.735 7.87-1.046l26.215-11.687c.504-.225 1.095.002 1.32.506.004.009.008.018.011.026l1.685 4.088c2.924 1.364 5.299 2.046 7.127 2.046 1.485 0 3.536-.6 6.152-1.799 1.004-.461 2.191-.02 2.652.984.019.044.038.088.054.132z" fill="#666464"/><path d="m261.139 326.25c30.496-4.968 50.924-8.365 61.281-10.192 29.523-5.205 38.132-21.092 33.042-55.756h-54.396c-7.198 2.079-37.276 14.936-90.233 38.57-9.528 4.73-7.753 18.676-6.012 23.27.071.188 16.134 27.711 48.187 82.571l44.498-28.347-36.451-46.775c-.963-1.939-.935-3.053.084-3.341z" fill="#333"/><path d="m257.219 247.212-31.898 23.423c-8.651 2.335-15.879 5.239-21.684 8.714-1.371 1.249-3.028 3.779 2.658 3.342 5.687-.437 11.688-.641 12.472 1.298.785 1.94-2.656 4.259-1.07 6.876 1.057 1.745 6.053-2.63 14.986-13.124l31.588-13.098zm122.474.808-20.898.082c12.903 41.654 19.869 63.755 20.898 66.304 2.314 5.734-2.583 14.468-4.677 19.161 6.82 3.052 6.093-8.25 14.697-4.247 7.852 3.653 13.826 10.273 22.899 4.675 1.115-.689 2.337-3.28-.616-5.305-7.358-5.045-17.961-13.875-19.393-16.782-1.954-3.963-6.257-25.259-12.91-63.888z" fill="#b28b67"/><path d="m320.306 160.332-8.648-1.483c-32.083 27.715-45.261 80.96-84.587 109.166l9.466 11.733c68.223-8.447 85.133-73.393 83.769-119.416z" fill="#333"/><path d="m358.001 269c-34.672 0-60.176 0-76.512 0-3.496 0-2.837-5.048-2.332-7.596 5.833-29.4 28.602-61.092 28.602-102.943l22.07-3.461c18.254 29.359 24.567 65.505 28.172 114z" fill="#fff"/><path d="m357.386 183.858c3.205-.921 5.743-3.07 7.615-6.447 8.066-14.555 5.153-22.568-3.468-25.203-8.62-2.634-16.308 2.792-30.042 2.792-.747 0-1.432.047-2.053.141l-6.909.394c-19.822 67.18-25.289 112.002-16.401 134.465h60.221c3.568 8.32 6.982 15.32 10.243 21h16.409c1.544-49.933-10.328-92.313-35.615-127.142z" fill="#333"/><path d="m353.235 255.498c-1.894 15.846-4.972 27.347-9.234 34.502h22.348c-4.162-9.705-8.533-21.205-13.114-34.502z" fill="#000" fill-opacity=".1"/></g><path d="m531.247 449.47c120.961 121.393-299.759 49.458-391.269 19.334-91.5107-30.125-149.33622-229.091-42.2482-256.06 85.0202-21.411 145.9942-25.418 148.5652-124.1872 3.954-151.9044 297.609 22.8832 231.421 127.9412-66.188 105.059-67.43 111.578 53.531 232.972z" fill="#27ae60" fill-opacity=".03"/></svg>
|
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 137 KiB |