release: v1.0.0

This commit is contained in:
Jeffrey Tse 2019-09-11 12:19:34 +08:00
parent cd3a8163dd
commit 61eae5c5f9
67 changed files with 2690 additions and 11 deletions

14
.editorconfig Normal file
View file

@ -0,0 +1,14 @@
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

3
404.html Normal file
View file

@ -0,0 +1,3 @@
---
layout: 404
---

View file

@ -2,3 +2,11 @@
source "https://rubygems.org" source "https://rubygems.org"
gemspec gemspec
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-paginate"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?

64
_config.yml Normal file
View file

@ -0,0 +1,64 @@
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: Your awesome title
email: your-email@domain.com
author: GitHub User
copyright: Copyright © 1970-2010
description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
# Yat date format
# refer to https://shopify.github.io/liquid/filters/date/ if you want to customize this
yat:
date_format: "%b %-d, %Y"
# If you want more debug log, you can set true
# debug: true
# If you want to link only specific pages in your header, uncomment
# this and add the path to the pages in order as they should show up
# header_pages:
# - index.html
# - archives.html
# - categories.html
# - tags.html
# Page default value
# defaults:
# home:
# heading: "Your awesome heading"
# subheading: "Your awesome subheading"
# banner: "Your image url"
# Pagination setting
paginate: 5
# Disqus comments
# disqus:
# shortname: "Your Disqus username"
# Gitment comments
# gitment:
# username: "Your GitHub username"
# repo: "The repo to store comments"
# client_id: "Your client ID"
# client_secret: "Your client secret"
# redirect_uri: "Your redirect url" # If you use a custom domain name
# Build settings
markdown: kramdown
theme: jekyll-theme-yat
plugins:
- jekyll-feed
- jekyll-seo-tag
- jekyll-paginate

4
_data/defaults.yml Normal file
View file

@ -0,0 +1,4 @@
home:
heading: "Your awesome heading"
subheading: "Your awesome subheading"
banner: "Your image url"

27
_data/translate_langs.yml Normal file
View file

@ -0,0 +1,27 @@
- lang: en
img: https://www.countryflags.io/us/flat/64.png
text: English
- lang: fr
img: https://www.countryflags.io/fr/flat/64.png
text: Franch
- lang: zh-CN
img: https://www.countryflags.io/cn/flat/64.png
text: Chinese(Simple)
- lang: zh-TW
img: https://www.countryflags.io/tw/flat/64.png
text: Chinese(Traditional)
- lang: ja
img: https://www.countryflags.io/jp/flat/64.png
text: Japan
- lang: ko
img: https://www.countryflags.io/kr/flat/64.png
text: Korean
- lang: ru
img: https://www.countryflags.io/ru/flat/64.png
text: Russia

View file

@ -0,0 +1,18 @@
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = '{{ page.url | absolute_url }}';
this.page.identifier = '{{ page.url | absolute_url }}';
};
(function() {
var d = document, s = d.createElement('script');
// s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
s.src = 'https://jeffreytse.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>

View file

@ -0,0 +1,15 @@
<div id="gitment_thread"></div>
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
var gitment = new Gitment({
id: '{{ page.id }}',
owner: '{{ site.gitment.username }}',
repo: '{{ site.gitment.repo }}',
oauth: {
client_id: '{{ site.gitment.client_id }}',
client_secret: '{{ site.gitment.client_secret }}',
},
});
gitment.render('gitment_thread')
</script>

View file

@ -0,0 +1,21 @@
{% if include.selector %}
{% assign selector = include.selector %}
{% endif %}
{% if include.seed %}
{% assign seed = include.seed %}
{% endif %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/geopattern/1.2.3/js/geopattern.min.js"></script>
<script>
function setRandomBgImage(selector, seed) {
var pattern = GeoPattern.generate(seed);
var element = document.querySelector(selector)
if (element) {
element.style.backgroundImage = pattern.toDataUrl();
}
}
setRandomBgImage('{{ selector }}', '{{ seed }}');
</script>

View file

@ -0,0 +1,12 @@
<script>
if(!(window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1")) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
}
</script>

View file

@ -0,0 +1,98 @@
{% if include.translate_langs %}
{% assign translate_langs = include.translate_langs %}
{% endif %}
<div id="google_translate_element" style="display: none;">
</div>
<span class="ct-language">
<ul class="list-unstyled ct-language-dropdown">
{% for item in translate_langs %}
<li>
<a href="#" class="lang-select" data-lang="{{ item.lang }}">
{% if item.img %}
<img src="{{ item.img }}" title="{{ item.text }}">
{% else %}
{{ item.text }}
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</span>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: '',
autoDisplay: false,
layout: google.translate.TranslateElement.InlineLayout.VERTICAL
}, 'google_translate_element');
function restoreLang() {
var iframe = document.getElementsByClassName('goog-te-banner-frame')[0];
if (!iframe) return;
var innerDoc = iframe.contentDocument || iframe.contentWindow.document;
var restore_el = innerDoc.getElementsByTagName("button");
for (var i = 0; i < restore_el.length; i++) {
if (restore_el[i].id.indexOf("restore") >= 0) {
restore_el[i].click();
var close_el = innerDoc.getElementsByClassName("goog-close-link");
close_el[0].click();
return;
}
}
}
function triggerHtmlEvent(element, eventName) {
var event;
if (document.createEvent) {
event = document.createEvent('HTMLEvents');
event.initEvent(eventName, true, true);
element.dispatchEvent(event);
} else {
event = document.createEventObject();
event.eventType = eventName;
element.fireEvent('on' + event.eventType, event);
}
}
var googleCombo = document.querySelector("select.goog-te-combo");
var langSelect = document.querySelector('.ct-language');
langSelect.addEventListener('click', function(event) {
if (!event.target) {
return;
}
var selected = document.querySelector('.ct-language .ct-language-selected');
if (selected) {
selected.classList.remove('ct-language-selected');
}
var target = event.target;
while (target && target !== langSelect ) {
if (target.matches('.lang-select')) {
break;
}
target = target.parentElement;
}
if (target && target.matches('.lang-select')) {
var lang = target.getAttribute('data-lang');
if (googleCombo.value == lang) {
restoreLang();
} else {
target.parentElement.classList.add('ct-language-selected');
googleCombo.value = lang;
triggerHtmlEvent(googleCombo, 'change');
}
}
event.preventDefault();
});
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

View file

@ -0,0 +1,39 @@
<script>
function hashLocate(hashValue) {
hashValue = hashValue.replace(/^.*#h-/, '');
var element = document.getElementById(hashValue);
if (!element) {
return;
}
var headerHeight = 0;
var header = document.querySelector('header');
if (header) {
headerHeight = header.offsetHeight;
}
var supportPageOffset = window.pageXOffset !== undefined;
var isCSS1Compat = ((document.compatMode || "") === "CSS1Compat");
var x = supportPageOffset ? window.pageXOffset : isCSS1Compat ? document.documentElement.scrollLeft : document.body.scrollLeft;
var y = supportPageOffset ? window.pageYOffset : isCSS1Compat ? document.documentElement.scrollTop : document.body.scrollTop;
var offsetY = element.offsetTop - headerHeight - 12;
if (y === offsetY) {
return;
}
window.scrollTo(x, offsetY);
}
// The first event occurred
if (window.location.hash) {
hashLocate(window.location.hash);
}
window.addEventListener('click', function(event) {
if (event.target.matches('a')) {
hashLocate(event.target.getAttribute('href'));
}
});
</script>

View file

@ -0,0 +1,10 @@
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
inlineMath: [['$','$']]
}
});
</script>
<script
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML" type="text/javascript"></script>

View file

@ -0,0 +1,23 @@
{% if include.selector %}
{% assign selector = include.selector %}
{% endif %}
{% if include.seed %}
{% assign seed = include.seed %}
{% endif %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/trianglify/2.0.0/trianglify.min.js"></script>
<script>
function setRandomBgImage(selector, seed) {
var element = document.querySelector(selector);
if (!element) return;
var pattern = Trianglify({
width: screen.width,
height: element.offsetHeight,
seed: seed
});
element.appendChild(pattern.canvas());
}
setRandomBgImage('{{ selector }}', '{{ seed }}');
</script>

25
_includes/functions.html Normal file
View file

@ -0,0 +1,25 @@
{%- if include.func -%}
{%- assign func = include.func -%}
{%- endif -%}
{%- assign include_path = func -%}
{%- assign path_array = include_path | split: '.' -%}
{%- if path_array.size == 1 -%}
{%- assign include_path = include_path | append: '.html' -%}
{%- endif -%}
{%- if func == 'log' -%}
{%- include functions/log.html level=include.level msg=include.msg -%}
{%- else -%}
{%- assign include_path = 'functions/' | append: include_path -%}
{%- include {{ include_path }} -%}
{%- endif -%}
{%- if func != 'log' -%}
{%- assign msg = '[function]['
| append: {{func}}
| append: '] '
| append: {{return}}
-%}
{%- include functions.html func='log' level='info' -%}
{%- endif -%}

View file

@ -0,0 +1,12 @@
{% assign split_mark = '<|>' %}
{% assign categories = '' %}
{% for category in site.categories %}
{% assign name = category | first %}
{% assign categories = categories | append: split_mark | append: name %}
{% endfor %}
{% assign return = categories
| remove_first: split_mark
| split: split_mark
| sort: self %}

View file

@ -0,0 +1,18 @@
{% if include.filter %}
{% assign filter = include.filter %}
{% endif %}
{% assign split_mark = '<|>' %}
{% assign dates = '' %}
{% for post in site.posts %}
{% assign name = post.date | date: filter %}
{% assign dates = dates | append: split_mark | append: name %}
{% endfor %}
{% assign return = dates
| remove_first: split_mark
| split: split_mark
| sort: self
| uniq %}

View file

@ -0,0 +1,12 @@
{% assign split_mark = '<|>' %}
{% assign tags = '' %}
{% for tag in site.tags %}
{% assign name = tag | first %}
{% assign tags = tags | append: split_mark | append: name %}
{% endfor %}
{% assign return = tags
| remove_first: split_mark
| split: split_mark
| sort: self %}

View file

@ -0,0 +1,17 @@
{%- if include.name -%}
{%- assign name = include.name -%}
{%- endif -%}
{%- assign return = include.return -%}
{%- if page[name] -%}
{%- assign return = page[name] -%}
{%- elsif site.data[name] -%}
{%- assign return = site.data[name] -%}
{%- elsif site.defaults[page.layout][name] -%}
{%- assign return = site.defaults[page.layout][name] -%}
{%- elsif site.data.defaults[page.layout][name] -%}
{%- assign return = site.data.defaults[page.layout][name] -%}
{%- elsif layout[name] -%}
{%- assign return = layout[name] -%}
{%- endif -%}

View file

@ -0,0 +1,17 @@
{% if include.level %}
{% assign level = include.level %}
{% endif %}
{% if include.msg %}
{% assign msg = include.msg %}
{% endif %}
{% if site.debug == true %}
{% if level == 'debug' %}
{% if jekyll.environment == "development" %}
<!-- {{ msg }} -->
{% endif %}
{% else %}
<!-- {{ msg }} -->
{% endif %}
{% endif %}

13
_includes/head.html Normal file
View file

@ -0,0 +1,13 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="google-translate-customization" content="108d9124921d80c3-80e20d618ff053c8-g4f02ec6f3dba68b7-c"></meta>
{%- seo -%}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
{%- feed_meta -%}
{%- if jekyll.environment == 'production' and site.google_analytics -%}
{%- include google-analytics.html -%}
{%- endif -%}
</head>

View file

@ -0,0 +1,10 @@
{%- include functions.html func='log' level='debug' msg='Get datetimes value' -%}
{% assign filter = '%Y' %}
{% include functions.html func='get_datetimes' %}
{% assign datetimes = return %}
{% assign keys = datetimes %}
{% assign field = 'date' %}
{% assign url = '/archives.html' %}
{% include sidebar/common-list.html %}

View file

@ -0,0 +1,59 @@
<style type="text/css" media="screen">
.post-menu ul {
list-style: none;
padding: 0;
margin: 0;
}
</style>
<div class="post-menu">
<div class="post-menu-title">Contents</div>
<div class="post-menu-content"></div>
</div>
<script>
var menu = document.querySelector(".post-menu .post-menu-content");
var headings = document.querySelector(".post-content").querySelectorAll("h2, h3, h4, h5, h6");
// Generate post menu
var menuHTML = '';
headings.forEach(function (h) {
menuHTML += (
'<li class="h-' + h.tagName.toLowerCase() + '">'
+ '<a href="#h-' + h.getAttribute('id') + '">' + h.textContent + '</a></li>');
});
menu.innerHTML = '<ul>' + menuHTML + '</ul>';
// The anchor offsetHeight
var headerHeight = 0;
var header = document.querySelector('header');
if (header) {
offsetHeight = header.offsetHeight + 12;
}
// Active the menu item
window.addEventListener('scroll', function (event) {
var lastActive = menu.querySelector('.active');
var changed = true;
for (var i = headings.length - 1; i >= 0; i--) {
var h = headings[i];
var clientRect = h.getBoundingClientRect();
if (clientRect.top < offsetHeight) {
var id = 'h-' + h.getAttribute('id');
var curActive = menu.querySelector('a[href="#' + id + '"]');
if (curActive) {
curActive.classList.add('active');
}
if (lastActive == curActive) {
changed = false;
}
break;
}
}
if (lastActive && changed) {
lastActive.classList.remove('active');
}
event.preventDefault();
});
</script>

View file

@ -0,0 +1,9 @@
{%- include functions.html func='log' level='debug' msg='Get categories value' -%}
{%- include functions.html func='get_categories' -%}
{% assign categories = return %}
{% assign keys = categories %}
{% assign field = 'categories' %}
{% assign url = '/categories.html' %}
{% include sidebar/common-list.html %}

View file

@ -0,0 +1,25 @@
{%- if include.keys -%}
{%- assign keys = include.keys -%}
{%- endif -%}
{%- if include.field -%}
{%- assign field = include.field -%}
{%- endif -%}
<div class="common-list">
<ul>
<li>
<a href="/index.html">
All<span>{{ site.posts.size }}</span>
</a>
</li>
{% for key in keys %}
<li>
<a href="{{ url }}#h-{{ key }}">
{{ key }} <span>{{ site.posts | where: field, key | size }}</span>
</a>
</li>
{% endfor %}
</ul>
</div>

View file

@ -0,0 +1,3 @@
<div>
{%- include extensions/google-translate.html -%}
</div>

View file

@ -0,0 +1,9 @@
{%- include functions.html func='log' level='debug' msg='Get tags value' -%}
{%- include functions.html func='get_tags' -%}
{% assign tags = return %}
{% assign keys = tags %}
{% assign field = 'tags' %}
{% assign url = '/tags.html' %}
{%- include sidebar/common-list.html -%}

View file

@ -0,0 +1,11 @@
<article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting">
<div class="post-content e-content" itemprop="articleBody">
{{ content }}
</div>
<div>
</article>

View file

@ -0,0 +1,66 @@
{%- include functions.html func='log' level='debug' msg='Get banner_html value' -%}
{% assign name = 'banner_html' %}
{%- include functions.html func='get_value' -%}
{% assign banner_html = return %}
{%- include functions.html func='log' level='debug' msg='Get banner value' -%}
{% assign name = 'banner' %}
{%- include functions.html func='get_value' -%}
{% assign banner = return %}
{%- include functions.html func='log' level='debug' msg='Get heading value' -%}
{% assign name = 'heading' %}
{%- include functions.html func='get_value' -%}
{% assign heading = return %}
{%- include functions.html func='log' level='debug' msg='Get subheading value' -%}
{% assign name = 'subheading' %}
{%- include functions.html func='get_value' -%}
{% assign subheading = return %}
{% if banner %}
{% assign auto_banner = true %}
{% assign array = banner | split: '//' %}
{% assign protocol = array[0] %}
{% if array.size > 1 and (protocol == '' or protocol == 'http:' or protocol == 'https:') %}
{% assign auto_banner = false %}
{% endif %}
<section class="page-banner">
<div class="page-banner-img">
{%- if auto_banner == false -%}
<div style="background-image: url({{ banner }})"></div>
{%- endif -%}
</div>
<div class="wrapper">
<div class="page-banner-inner">
{%- if banner_html -%}
{%- assign banner_html = 'views/' | append: banner_html -%}
{%- include {{ banner_html }} -%}
{%- else -%}
<h1 class="page-banner-heading">
{{ heading | default: page.title | escape }}
</h1>
<h3 class="page-banner-subheading">
{{ subheading | default: page.subtitle | escape }}
</h3>
{%- endif -%}
</div>
</div>
</section>
{%- if auto_banner -%}
{%- assign selector = ".page-banner-img" -%}
{%- assign seed = page.id | append: '-seed-' | append: banner -%}
{%- include extensions/trianglify.html -%}
{%- endif -%}
{%- endif -%}

View file

@ -0,0 +1,13 @@
<footer class="site-footer h-card">
<data class="u-url" href="{{ "/" | relative_url }}"></data>
<div class="wrapper">
<span>
<div>{{ site.copyright }} @{{ site.author | escape }}</div>
<div>Powered by <a title="Jekyll is a simple, blog-aware, static site
generator." href="http://jekyllrb.com/">Jekyll</a> &amp; <a title="Yat, yet
another theme." href="https://github.com/jeffreytse/jekyll-theme-yat">Yat Theme</a>.</div>
</span>
<span class="footer-col rss-subscribe">Subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</a></span>
</div>
</footer>

View file

@ -0,0 +1,44 @@
<header class="site-header" role="banner">
<div class="wrapper">
{%- assign default_paths = site.pages | where: "dir", "/" | map: "path" -%}
{%- assign page_paths = site.header_pages | default: default_paths -%}
<span class="site-brand">
{%- include views/site-brand.html -%}
</span>
{%- if page_paths -%}
<nav class="site-nav">
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger">
<span class="menu-icon">
<svg viewBox="0 0 18 15" width="18px" height="15px">
<path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
</svg>
</span>
</label>
<div class="trigger">
{%- for path in page_paths -%}
{%- assign my_page = site.pages | where: "path", path | first -%}
{%- if my_page.title -%}
<a class="page-link" href="{{ my_page.url | relative_url }}">
{{ my_page.title | upcase | escape }}
</a>
{%- endif -%}
{%- endfor -%}
{%- assign name = 'translate_langs' -%}
{%- include functions.html func='get_value' -%}
{%- assign translate_langs = return -%}
{%- if translate_langs.size > 0 -%}
<span class="page-link">
{%- include extensions/google-translate.html -%}
</span>
{%- endif -%}
</div>
</nav>
{%- endif -%}
</div>
</header>

View file

@ -0,0 +1,33 @@
{%- if page.paginator -%}
{%- assign paginator = page.paginator -%}
{%- elsif paginator == nil -%}
{%- assign paginator = site -%}
{%- endif -%}
{%- if paginator.posts.size > 0 -%}
<div class="pagination">
<!-- Post list links -->
<ul class="post-list">
{%- for post in paginator.posts -%}
<li>
{%- assign date_format = site.yat.date_format | default: "%b %-d, %Y" -%}
<span class="post-meta">{{ post.date | date: date_format }}</span>
<h3>
{%- assign post_url = post.url | relative_url -%}
<a class="post-link" href="{{ post_url }}">
{{ post.title | escape }}
</a>
</h3>
<p class="post-excerpt">
{{ post.content | strip_html | truncatewords: 50 }}
</p>
</li>
{%- endfor -%}
</ul>
<!-- Pagination links -->
{%- if paginator.posts.size < site.posts.size -%}
{%- include views/paginator.html -%}
{%- endif -%}
</div>
{%- endif -%}

View file

@ -0,0 +1,21 @@
{% if include.paginator %}
{% assign paginator = include.paginator %}
{% endif %}
{% if paginator.posts.size > 0 %}
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}">&laquo; Prev</a>
{% else %}
<span>&laquo; Prev</span>
{% endif %}
<span> {{ paginator.page }}/{{ paginator.total_pages }}</span>
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}">Next &raquo;</a>
{% else %}
<span>Next &raquo;</span>
{% endif %}
</div>
{% endif %}

View file

@ -0,0 +1,11 @@
<header class="post-header">
<h1 class="post-title p-name" itemprop="name headline">{{ heading | default: page.title | escape }}</h1>
<h3>{{ subheading | default: page.subtitle | escape }}</h3>
<p class="post-meta">
<time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
{%- assign date_format = site.yat.date_format | default: "%b %-d, %Y" -%}
{{ page.date | date: date_format }}
</time>
</p>
</header>

View file

@ -0,0 +1,13 @@
{%- if include.item -%}
{%- assign item = include.item -%}
{%- endif -%}
{%- assign post = item -%}
{% assign date_format = site.yat.date_format | default: "%b %-d, %Y" %}
<span class="post-meta">{{ post.date | date: date_format }}</span>
<span>
<a class="post-link" href="{{ post.url | relative_url }}">
{{ post.title | escape }}
</a>
</span>

View file

@ -0,0 +1,21 @@
{%- if include.keys -%}
{%- assign keys = include.keys -%}
{%- endif -%}
{%- if include.field -%}
{%- assign field = include.field -%}
{%- endif -%}
<div class="page-segments">
<ul class="page-segments-list">
{% for key in keys %}
<h2 id="{{ key }}" class="segment-name">{{ key }}</h2>
{% assign items = site.posts | where: field, key %}
{% for item in items %}
{% if item != nil %}
<li> {% include views/post-item.html %} </li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</div>

View file

@ -0,0 +1 @@
<a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>

25
_layouts/404.html Normal file
View file

@ -0,0 +1,25 @@
---
layout: default
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
color: #3c3c3c;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>Try to check other pages through the menu. </p>
</div>

18
_layouts/archives.html Normal file
View file

@ -0,0 +1,18 @@
---
layout: framework
sidebar: archive-list
---
{%- if site.posts.size > 0 -%}
{% include functions.html func='log' level='debug' msg='Get datetimes value' %}
{% assign filter = '%Y' %}
{% include functions.html func='get_datetimes' %}
{% assign datetimes = return %}
{% assign keys = datetimes | reverse %}
{% assign field = 'date' %}
{% include views/segments.html %}
{%- endif -%}

14
_layouts/articles.html Normal file
View file

@ -0,0 +1,14 @@
---
layout: framework
sidebar: category-list
---
<div class="articles">
{% if page.banner == nil %}
{% assign banner = page.title %}
{% endif %}
{{ content }}
{% include views/pagination.html %}
<div>

16
_layouts/categories.html Normal file
View file

@ -0,0 +1,16 @@
---
layout: framework
sidebar: category-list
---
{%- if site.posts.size > 0 -%}
{%- include functions.html func='log' level='debug' msg='Get value' -%}
{%- include functions.html func='get_categories' -%}
{% assign categories = return %}
{% assign keys = categories %}
{% assign field = 'categories' %}
{%- include views/segments.html -%}
{%- endif -%}

View file

@ -1 +1,23 @@
{{ content }} <!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
{%- include head.html -%}
<body>
{%- include views/header.html -%}
{%- include views/banner.html -%}
{%- include extensions/hashlocate.html -%}
<main class="page-content" aria-label="Content">
<div class="wrapper">
{{ content }}
</div>
</main>
{%- include views/footer.html -%}
</body>
</html>

35
_layouts/framework.html Normal file
View file

@ -0,0 +1,35 @@
---
layout: default
---
<div class="framework">
<section class="main">
{{ content }}
</section>
<section class="sidebar" style="margin-left: 15px;">
<!-- Get sidebar items -->
{%- if page.sidebar -%}
{%- assign sidebar = page.sidebar -%}
{%- elsif site.defaults[page.layout].sidebar -%}
{%- assign sidebar = site.defaults[page.layout].sidebar -%}
{%- elsif layout.sidebar -%}
{%- assign sidebar = layout.sidebar -%}
{%- endif -%}
{%- for item in sidebar -%}
{%- assign file = item -%}
{%- assign array = file | split: '.' -%}
{%- if array.size == 1 -%}
{%- assign file = file | append: '.html' -%}
{%- endif -%}
{%- assign file = 'sidebar/' | append: file -%}
{%- include {{ file }} %}
{%- endfor -%}
</section>
<div>

View file

@ -1,5 +1,5 @@
--- ---
layout: default layout: articles
--- ---
{{ content }} {{ content }}

View file

@ -1,5 +1,53 @@
--- ---
layout: default layout: framework
banner: 'default'
banner_html: post-header.html
sidebar:
- article-menu
--- ---
{{ content }} <div class="post">
<section>
{%- assign name = 'banner' -%}
{%- include functions.html func='get_value' -%}
{%- assign banner = return -%}
{%- if banner == nil -%}
{%- include views/post-header.html -%}
{%- endif -%}
{%- include views/article.html -%}
<div class="post-nav">
{%- if page.previous -%}
<a href="{{ page.previous.url }}" title="{{ page.previous.title | escape }}">&laquo; Prev</a>
{%- else -%}
<span></span>
{%- endif -%}
{%- if page.next -%}
<a href="{{ page.next.url }}" title="{{ page.next.title | escape }}">Next &raquo;</a>
{%- else -%}
<span></span>
{%- endif -%}
</div>
{%- if page.comments != false -%}
{%- if site.disqus.shortname -%}
{%- include extensions/comments/disqus.html -%}
{%- endif -%}
{%- if site.gitment.username -%}
{%- include extensions/comments/gitment.html -%}
{%- endif -%}
{%- endif -%}
</section>
{%- include extensions/mathjax.html -%}
</div>

16
_layouts/tags.html Normal file
View file

@ -0,0 +1,16 @@
---
layout: framework
sidebar: tag-list
---
{%- if site.posts.size > 0 -%}
{%- include functions.html func='log' level='debug' msg='Get tags value' -%}
{%- include functions.html func='get_tags' -%}
{% assign tags = return %}
{% assign keys = tags %}
{% assign field = 'tags' %}
{%- include views/segments.html -%}
{%- endif -%}

View file

@ -0,0 +1,76 @@
---
layout: post
title: Test markdown
subtitle: Each post also has a subtitle
categories: markdown
tags: [test]
---
You can write regular [markdown](http://markdowntutorial.com/) here and Jekyll will automatically convert it to a nice webpage. I strongly encourage you to [take 5 minutes to learn how to write in markdown](http://markdowntutorial.com/) - it'll teach you how to transform regular text into bold/italics/headings/tables/etc.
**Here is some bold text**
## Here is a secondary heading
Here's a useless table:
| Number | Next number | Previous number |
| :------ |:--- | :--- |
| Five | Six | Four |
| Ten | Eleven | Nine |
| Seven | Eight | Six |
| Two | Three | One |
How about a yummy crepe?
![Crepe](https://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg)
It can also be centered!
![Crepe](https://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg){: .center-block :}
Here's a code chunk:
~~~
var foo = function(x) {
return(x + 5);
}
foo(3)
~~~
And here is the same code with syntax highlighting:
```javascript
var foo = function(x) {
return(x + 5);
}
foo(3)
```
And here is the same code yet again but with line numbers:
{% highlight javascript linenos %}
var foo = function(x) {
return(x + 5);
}
foo(3)
{% endhighlight %}
## Boxes
You can add notification, warning and error boxes like this:
### Notification
{: .box-note}
**Note:** This is a notification box.
### Warning
{: .box-warning}
**Warning:** This is a warning box.
### Error
{: .box-error}
**Error:** This is an error box.

View file

@ -0,0 +1,7 @@
---
layout: post
title: "Some articles are just so short that we have to make the footer stick"
categories: misc
---
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

View file

@ -0,0 +1,11 @@
---
layout: post
title: "Some articles are just so long they deserve a really long title to see if things will break well"
categories: misc
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce bibendum neque eget nunc mattis eu sollicitudin enim tincidunt. Vestibulum lacus tortor, ultricies id dignissim ac, bibendum in velit. Proin convallis mi ac felis pharetra aliquam. Curabitur dignissim accumsan rutrum. In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris. Proin eget nibh a massa vestibulum pretium. Suspendisse eu nisl a ante aliquet bibendum quis a nunc. Praesent varius interdum vehicula. Aenean risus libero, placerat at vestibulum eget, ultricies eu enim. Praesent nulla tortor, malesuada adipiscing adipiscing sollicitudin, adipiscing eget est.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce bibendum neque eget nunc mattis eu sollicitudin enim tincidunt. Vestibulum lacus tortor, ultricies id dignissim ac, bibendum in velit. Proin convallis mi ac felis pharetra aliquam. Curabitur dignissim accumsan rutrum. In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris. Proin eget nibh a massa vestibulum pretium. Suspendisse eu nisl a ante aliquet bibendum quis a nunc. Praesent varius interdum vehicula. Aenean risus libero, placerat at vestibulum eget, ultricies eu enim. Praesent nulla tortor, malesuada adipiscing adipiscing sollicitudin, adipiscing eget est.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce bibendum neque eget nunc mattis eu sollicitudin enim tincidunt. Vestibulum lacus tortor, ultricies id dignissim ac, bibendum in velit. Proin convallis mi ac felis pharetra aliquam. Curabitur dignissim accumsan rutrum. In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris. Proin eget nibh a massa vestibulum pretium. Suspendisse eu nisl a ante aliquet bibendum quis a nunc. Praesent varius interdum vehicula. Aenean risus libero, placerat at vestibulum eget, ultricies eu enim. Praesent nulla tortor, malesuada adipiscing adipiscing sollicitudin, adipiscing eget est.

View file

@ -0,0 +1,13 @@
---
layout: post
categories: junk
---
Eos eu docendi tractatos sapientem, brute option menandri in vix, quando vivendo accommodare te ius. Nec melius fastidii constituam id, viderer theophrastus ad sit, hinc semper periculis cum id. Noluisse postulant assentior est in, no choro sadipscing repudiandae vix. Vis in euismod delenit dignissim. Ex quod nostrum sit, suas decore animal id ius, nobis solet detracto quo te.
{% comment %}
Might you have an include in your theme? Why not try it here!
{% include my-themes-great-include.html %}
{% endcomment %}
No laudem altera adolescens has, volumus lucilius eum no. Eam ei nulla audiam efficiantur. Suas affert per no, ei tale nibh sea. Sea ne magna harum, in denique scriptorem sea, cetero alienum tibique ei eos. Labores persequeris referrentur eos ei.

View file

@ -0,0 +1,100 @@
---
layout: post
title: "This post demonstrates post content styles"
categories: junk
author: "Bart Simpson"
meta: "Springfield"
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce bibendum neque eget nunc mattis eu sollicitudin enim tincidunt. Vestibulum lacus tortor, ultricies id dignissim ac, bibendum in velit.
## Some great heading (h2)
Proin convallis mi ac felis pharetra aliquam. Curabitur dignissim accumsan rutrum. In arcu magna, aliquet vel pretium et, molestie et arcu.
Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris. Proin eget nibh a massa vestibulum pretium. Suspendisse eu nisl a ante aliquet bibendum quis a nunc. Praesent varius interdum vehicula. Aenean risus libero, placerat at vestibulum eget, ultricies eu enim. Praesent nulla tortor, malesuada adipiscing adipiscing sollicitudin, adipiscing eget est.
## Another great heading (h2)
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce bibendum neque eget nunc mattis eu sollicitudin enim tincidunt. Vestibulum lacus tortor, ultricies id dignissim ac, bibendum in velit.
### Some great subheading (h3)
Proin convallis mi ac felis pharetra aliquam. Curabitur dignissim accumsan rutrum. In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum.
Phasellus et hendrerit mauris. Proin eget nibh a massa vestibulum pretium. Suspendisse eu nisl a ante aliquet bibendum quis a nunc.
### Some great subheading (h3)
Praesent varius interdum vehicula. Aenean risus libero, placerat at vestibulum eget, ultricies eu enim. Praesent nulla tortor, malesuada adipiscing adipiscing sollicitudin, adipiscing eget est.
> This quote will change your life. It will reveal the secrets of the universe, and all the wonders of humanity. Don't misuse it.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce bibendum neque eget nunc mattis eu sollicitudin enim tincidunt.
### Some great subheading (h3)
Vestibulum lacus tortor, ultricies id dignissim ac, bibendum in velit. Proin convallis mi ac felis pharetra aliquam. Curabitur dignissim accumsan rutrum.
```html
<html>
<head> </head>
<body>
<p>Hello, World!</p>
</body>
</html>
```
In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
#### You might want a sub-subheading (h4)
In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
#### But it's probably overkill (h4)
In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
### Oh hai, an unordered list!!
In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
- First item, yo
- Second item, dawg
- Third item, what what?!
- Fourth item, fo sheezy my neezy
### Oh hai, an ordered list!!
In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
1. First item, yo
2. Second item, dawg
3. Third item, what what?!
4. Fourth item, fo sheezy my neezy
## Headings are cool! (h2)
Proin eget nibh a massa vestibulum pretium. Suspendisse eu nisl a ante aliquet bibendum quis a nunc. Praesent varius interdum vehicula. Aenean risus libero, placerat at vestibulum eget, ultricies eu enim. Praesent nulla tortor, malesuada adipiscing adipiscing sollicitudin, adipiscing eget est.
Praesent nulla tortor, malesuada adipiscing adipiscing sollicitudin, adipiscing eget est.
Proin eget nibh a massa vestibulum pretium. Suspendisse eu nisl a ante aliquet bibendum quis a nunc.
### Tables
| Title 1 | Title 2 | Title 3 | Title 4 |
| --------------------- | --------------------- | --------------------- | --------------------- |
| lorem | lorem ipsum | lorem ipsum dolor | lorem ipsum dolor sit |
| lorem ipsum dolor sit | lorem ipsum dolor sit | lorem ipsum dolor sit | lorem ipsum dolor sit |
| lorem ipsum dolor sit | lorem ipsum dolor sit | lorem ipsum dolor sit | lorem ipsum dolor sit |
| lorem ipsum dolor sit | lorem ipsum dolor sit | lorem ipsum dolor sit | lorem ipsum dolor sit |
| Title 1 | Title 2 | Title 3 | Title 4 |
| -------------------------- | -------------------------------------- | -------------------------- | -------------------------------------- |
| lorem | lorem ipsum | lorem ipsum dolor | lorem ipsum dolor sit |
| lorem ipsum dolor sit amet | lorem ipsum dolor sit amet consectetur | lorem ipsum dolor sit amet | lorem ipsum dolor sit |
| lorem ipsum dolor | lorem ipsum | lorem | lorem ipsum |
| lorem ipsum dolor | lorem ipsum dolor sit | lorem ipsum dolor sit amet | lorem ipsum dolor sit amet consectetur |

View file

@ -0,0 +1,164 @@
---
layout: post
title: Quick markdown example
subtitle: This is a quick markdown example
categories: markdown
tags: [example]
---
Paragraphs are separated by a blank line.
2nd paragraph. *Italic*, **bold**, and `monospace`. Itemized lists
look like:
* this one
* that one
* the other one
Note that --- not considering the asterisk --- the actual text
content starts at 4-columns in.
> Block quotes are
> written like so.
>
> They can span multiple paragraphs,
> if you like.
Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all
in chapters 12--14"). Three dots ... will be converted to an ellipsis.
Unicode is supported. ☺
An h2 header
------------
Here's a numbered list:
1. first item
2. second item
3. third item
Note again how the actual text starts at 4 columns in (4 characters
from the left side). Here's a code sample:
# Let me re-iterate ...
for i in 1 .. 10 { do-something(i) }
As you probably guessed, indented 4 spaces. By the way, instead of
indenting the block, you can use delimited blocks, if you like:
~~~
define foobar() {
print "Welcome to flavor country!";
}
~~~
(which makes copying & pasting easier). You can optionally mark the
delimited block for Pandoc to syntax highlight it:
~~~python
import time
# Quick, count to ten!
for i in range(10):
# (but not *too* quick)
time.sleep(0.5)
print(i)
~~~
### An h3 header ###
Now a nested list:
1. First, get these ingredients:
* carrots
* celery
* lentils
2. Boil some water.
3. Dump everything in the pot and follow
this algorithm:
find wooden spoon
uncover pot
stir
cover pot
balance wooden spoon precariously on pot handle
wait 10 minutes
goto first step (or shut off burner when done)
Do not bump wooden spoon or it will fall.
Notice again how text always lines up on 4-space indents (including
that last line which continues item 3 above).
Here's a link to [a website](http://foo.bar), to a [local
doc](local-doc.html), and to a [section heading in the current
doc](#an-h2-header). Here's a footnote [^1].
[^1]: Some footnote text.
Tables can look like this:
Name Size Material Color
------------- ----- ------------ ------------
All Business 9 leather brown
Roundabout 10 hemp canvas natural
Cinderella 11 glass transparent
Table: Shoes sizes, materials, and colors.
(The above is the caption for the table.) Pandoc also supports
multi-line tables:
-------- -----------------------
Keyword Text
-------- -----------------------
red Sunsets, apples, and
other red or reddish
things.
green Leaves, grass, frogs
and other things it's
not easy being.
-------- -----------------------
A horizontal rule follows.
***
Here's a definition list:
apples
: Good for making applesauce.
oranges
: Citrus!
tomatoes
: There's no "e" in tomatoe.
Again, text is indented 4 spaces. (Put a blank line between each
term and its definition to spread things out more.)
Here's a "line block" (note how whitespace is honored):
| Line one
| Line too
| Line tree
and images can be specified like so:
![example image](http://www.unexpected-vortices.com/sw/rippledoc/example-image.jpg "An exemplary image")
Inline math equation: $\omega = d\phi / dt$. Display
math should get its own line like so:
$$I = \int \rho R^{2} dV$$
And note that you can backslash-escape any punctuation characters
which you wish to be displayed literally, ex.: \`foo\`, \*bar\*, etc.

View file

@ -0,0 +1,94 @@
---
layout: post
title: An exhibit of Markdown
subtitle: Each post also has a subtitle
categories: markdown
tags: [example, markdown]
---
This note demonstrates some of what [Markdown][1] is capable of doing.
## An exhibit of Markdown
*Note: Feel free to play with this page. Unlike regular notes, this doesn't automatically save itself.*
## Basic formatting
Paragraphs can be written like so. A paragraph is the basic block of Markdown. A paragraph is what text will turn into when there is no reason it should become anything else.
Paragraphs must be separated by a blank line. Basic formatting of *italics* and **bold** is supported. This *can be **nested** like* so.
## Lists
### Ordered list
1. Item 1
2. A second item
3. Number 3
4. Ⅳ
*Note: the fourth item uses the Unicode character for [Roman numeral four][2].*
### Unordered list
* An item
* Another item
* Yet another item
* And there's more...
## Paragraph modifiers
### Code block
Code blocks are very useful for developers and other people who look at code or other things that are written in plain text. As you can see, it uses a fixed-width font.
You can also make `inline code` to add code into other things.
### Quote
> Here is a quote. What this is should be self explanatory. Quotes are automatically indented when they are used.
## Headings
There are six levels of headings. They correspond with the six levels of HTML headings. You've probably noticed them already in the page. Each level down uses one more hash character.
### Headings *can* also contain **formatting**
### They can even contain `inline code`
Of course, demonstrating what headings look like messes up the structure of the page.
I don't recommend using more than three or four levels of headings here, because, when you're smallest heading isn't too small, and you're largest heading isn't too big, and you want each size up to look noticeably larger and more important, there there are only so many sizes that you can use.
## URLs
URLs can be made in a handful of ways:
* A named link to [MarkItDown][3]. The easiest way to do these is to select what you want to make a link and hit `Ctrl+L`.
* Another named link to [MarkItDown](http://www.markitdown.net/)
* Sometimes you just want a URL like <http://www.markitdown.net/>.
## Horizontal rule
A horizontal rule is a line that goes across the middle of the page.
---
It's sometimes handy for breaking things up.
## Images
Markdown can also contain images. I'll need to add something here sometime.
## Finally
There's actually a lot more to Markdown than this. See the official [introduction][4] and [syntax][5] for more information. However, be aware that this is not using the official implementation, and this might work subtly differently in some of the little things.
[1]: http://daringfireball.net/projects/markdown/
[2]: http://www.fileformat.info/info/unicode/char/2163/index.htm
[3]: http://www.markitdown.net/
[4]: http://daringfireball.net/projects/markdown/basics
[5]: http://daringfireball.net/projects/markdown/syntax

View file

@ -0,0 +1,74 @@
---
layout: post
title: Welcome to Jekyll!
author: Jeffrey
categories: jekyll
tags: jekyll theme yat
---
Youll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
## section 1
Jekyll also offers powerful support for code snippets:
{% highlight ruby %}
def print_hi(name)
puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
{% endhighlight %}
## section 2
### section 2.1
### section 2.2
#### section 2.2.1
##### section 2.2.1.1
#### section 2.2.2
##### section 2.2.2.1
123
## section 3
### section 3.1
### section 3.2
### section 3.3
## section 4
## section 5
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekylls GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
[jekyll-docs]: https://jekyllrb.com/docs/home
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/
$ a * b = c ^ b $
$ 2^{\frac{n-1}{3}} $
$ \int\_a^b f(x)\,dx. $
```cpp
#include <iostream>
using namespace std;
int main() {
cout << "Hello World!";
return 0;
}
// prints 'Hi, Tom' to STDOUT.
```
```python
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
p1 = Person("John", 36)
print(p1.name)
print(p1.age)
```

View file

@ -0,0 +1,47 @@
/*
* Post menu
*/
.post-menu {
padding: 0 20px;
max-width: 250px;
.post-menu-title {
font-size: $base-font-size * 1.35;
margin-bottom: 6px;
font-weight: 600;
color: #4e4e4e;
&:before {
content: '\f02e';
margin-right: 5px;
font-size: $base-font-size * 1.15;
}
}
.post-menu-content {
ul {
@for $i from 2 to 7 {
.h-h#{$i} {
padding-left: ($i - 2) * $base-font-size * 0.9;
font-size: (7 - $i) + $base-font-size * 0.9;
}
}
a {
display: flex;
padding: 0px 8px;
* {
pointer-events: none;
}
}
.active {
color: white;
background: mix(invert($theme-color), darkorange);
transition: background 0.5s;
}
}
}
}

View file

@ -0,0 +1,49 @@
/**
* Common list
*/
.common-list {
@include relative-font-size(1.0);
background: #eaeaea;
box-shadow: 0px 0px 3px 0px #a9a9a9;
border-radius: 3px;
min-width: 200px;
ul {
list-style: none;
margin: 0;
}
li {
border-bottom: 1px solid $background-color;
&:last-child {
border-bottom: none;
}
a {
display: flex;
justify-content: space-between;
padding: 8px 12px;
text-decoration: none;
font-weight: 600;
color: mix($theme-color, #666);
transition: background 0.2s;
&:hover {
background: mix($theme-color, #fff, 20%);
}
}
span {
@include relative-font-size(0.8);
display: inline-block;
border-radius: 10px;
align-self: center;
background: darken(invert($theme-color), 20%);
padding: 0px 8px;
margin-left: 20px;
color: $white-color;
}
}
}

View file

@ -0,0 +1,189 @@
/* OVERRIDE GOOGLE TRANSLATE WIDGET CSS BEGIN */
%goog-te-menu {
a.goog-te-menu-value {
vertical-align: top !important;
&:hover {
text-decoration: none;
}
span {
color: #aaa;
}
span:hover {
color: white;
}
/* Remove the down arrow */
/* when dropdown open */
span[style="color: rgb(213, 213, 213);"] {
display: none;
}
/* after clicked/touched */
span[style="color: rgb(118, 118, 118);"] {
display: none;
}
/* on page load (not yet touched or clicked) */
span[style="color: rgb(155, 155, 155);"] {
display: none;
}
/* Remove span with left border line | (next to the arrow) in Chrome & Firefox */
span[style="border-left: 1px solid rgb(187, 187, 187);"] {
display: none;
}
/* Remove span with left border line | (next to the arrow) in Edge & IE11 */
span[style="border-left-color: rgb(187, 187, 187); border-left-width: 1px; border-left-style: solid;"] {
display: none;
}
}
}
div#google_translate_element {
display: inline;
div.goog-te-gadget {
display: inline;
font-size: 0;
}
div[id=':0.targetLanguage'] {
display: inline;
}
div.goog-te-gadget-simple {
border: none;
background-color: transparent;
@extend %goog-te-menu;
}
a.goog-logo-link {
display: none;
}
.goog-te-gadget-icon {
display: none !important;
/*background: url("url for the icon") 0 0 no-repeat !important;*/
}
a.goog-te-menu-value {
margin: 0;
span:first-child {
display: none;
}
&:before {
content: "\f1ab \f0d7";
font-family: FontAwesome;
font-size: initial;
color: #fefefe;
border: 1px solid #fefefe85;
border-radius: 3px;
padding: 3px 6px;
}
}
}
.goog-te-menu-frame .goog-te-menu2 {
max-width: 100%;
overflow-x: auto;
box-sizing: border-box;
height: auto;
}
/* HIDE the google translate toolbar */
.goog-te-banner-frame.skiptranslate {
display: none !important;
border: none;
box-shadow: 0 0;
-webkit-box-shadow: 0 0;
}
body {
top: 0px !important;
}
/* OVERRIDE GOOGLE TRANSLATE WIDGET CSS END */
// Main look
.ct-language-selected {
background: lighten($theme-color, 10%) !important;
}
.ct-language-dropdown {
overflow: hidden;
max-height: 0;
position: absolute;
top: 110%;
right: -10px;
-webkit-transition: all 0.25s ease-in-out;
transition: all 0.25s ease-in-out;
width: 100px;
text-align: center;
padding-top: 0;
z-index: 200;
li {
background: lighten($theme-color, 5%);
padding: 5px;
a {
display: block;
img {
width: 24px;
max-height: 24px;
}
}
&:first-child {
padding-top: 10px;
border-radius: 3px 3px 0 0;
}
&:last-child {
padding-bottom: 10px;
border-radius: 0 0 3px 3px;
}
&:hover {
@extend .ct-language-selected;
}
}
}
.list-unstyled {
display: inline-block;
list-style: none;
margin-left: 0;
}
.ct-language {
display: inline-block;
position: relative;
background: #fefefe2b;
padding: 3px 10px;
border-radius: 3px;
&:hover {
cursor: pointer;
.ct-language-dropdown {
padding-top: 8px;
max-height: 10000px;
}
}
&:before {
content: "\f1ab \f0d7";
font-family: FontAwesome;
}
}

83
_sass/yat.scss Normal file
View file

@ -0,0 +1,83 @@
@charset "utf-8";
// Define defaults for each variable.
$base-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif, Oswald,
"Apple Color Emoji", "Open Sans", "FontAwesome", !default;
$base-font-size: 14px !default;
$base-font-weight: 400 !default;
$small-font-size: $base-font-size * 0.875 !default;
$base-line-height: 1.5 !default;
$spacing-unit: 30px !default;
$text-color: #333 !default;
$background-color: #fefefe !default;
$brand-color: #2a7ae2 !default;
$grey-color: #828282 !default;
$grey-color-light: lighten($grey-color, 40%) !default;
$grey-color-dark: darken($grey-color, 25%) !default;
// Themes
$theme-cool: #222 !default;
$theme-violet: #543581 !default;
$theme-aquablue: #00aaa0 !default;
$theme-azure: #2863b1 !default;
$theme-gracered: #a12a50 !default;
$theme-aloe: #3d9e56 !default;
$theme-brown: #795548 !default;
// Current theme
$theme: $theme-cool;
$white-color: #fdfdfd !default;
$theme-color: $theme;
$table-text-align: left !default;
$header-height: $base-line-height * $base-font-size * 2.85 !default;
$header-text-color: lighten($white-color, 10%) !default;
$header-background-color: $theme-color !default;
$footer-height: $header-height * 1.05 !default;
$footer-text-color: rgba(lighten(invert($theme-color), 30%), 50%) !default;
$footer-background-color: darken($theme-color, 5%) !default;
$banner-height: 350px !default;
$banner-text-color: lighten($white-color, 0%) !default;
$banner-background: darken(#333, 5%) !default;
// Width of the content area
$content-width: 920px !default;
$on-palm: 600px !default;
$on-laptop: 800px !default;
// Use media queries like this:
// @include media-query($on-palm) {
// .wrapper {
// padding-right: $spacing-unit / 2;
// padding-left: $spacing-unit / 2;
// }
// }
@mixin media-query($device) {
@media screen and (max-width: $device) {
@content;
}
}
@mixin relative-font-size($ratio) {
font-size: $base-font-size * $ratio;
}
// Import partials.
@import
"yat/base",
"yat/layout",
"yat/syntax-highlighting",
"misc/article-menu",
"misc/common-list",
"misc/google-translate"
;

258
_sass/yat/_base.scss Normal file
View file

@ -0,0 +1,258 @@
/**
* Reset some basic elements
*/
body, h1, h2, h3, h4, h5, h6,
p, blockquote, pre, hr,
dl, dd, ol, ul, figure {
margin: 0;
padding: 0;
}
/**
* Basic styling
*/
body {
font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family;
color: $text-color;
background-color: $background-color;
-webkit-text-size-adjust: 100%;
-webkit-font-feature-settings: "kern" 1;
-moz-font-feature-settings: "kern" 1;
-o-font-feature-settings: "kern" 1;
font-feature-settings: "kern" 1;
font-kerning: normal;
display: flex;
min-height: 100vh;
flex-direction: column;
}
/**
* Set `margin-bottom` to maintain vertical rhythm
*/
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
ul, ol, dl, figure,
%vertical-rhythm {
margin-bottom: $spacing-unit / 2;
}
/**
* `main` element
*/
main {
display: block; /* Default value of `display` of `main` element is 'inline' in IE 11. */
}
/**
* Images
*/
img {
max-width: 100%;
vertical-align: middle;
}
/**
* Figures
*/
figure > img {
display: block;
}
figcaption {
font-size: $small-font-size;
}
/**
* Lists
*/
ul, ol {
margin-left: $spacing-unit;
}
li {
> ul,
> ol {
margin-bottom: 0;
}
}
/**
* Headings
*/
h1, h2, h3, h4, h5, h6 {
font-weight: $base-font-weight * 1.5;
}
/**
* Links
*/
a {
color: $brand-color;
text-decoration: none;
&:visited {
color: darken($brand-color, 15%);
}
&:hover {
color: $text-color;
text-decoration: underline;
}
.social-media-list &:hover {
text-decoration: none;
.username {
text-decoration: underline;
}
}
}
/**
* Blockquotes
*/
blockquote {
color: $grey-color;
border-left: 4px solid $grey-color-light;
padding-left: $spacing-unit / 2;
@include relative-font-size(1.125);
letter-spacing: -1px;
font-style: italic;
> :last-child {
margin-bottom: 0;
}
}
/**
* Code formatting
*/
pre,
code {
@include relative-font-size(0.9375);
border-radius: 3px;
background-color: #3d3d3d;
}
code {
padding: 1px 5px;
}
pre {
padding: 8px 12px;
overflow-x: auto;
> code {
border: 0;
padding-right: 0;
padding-left: 0;
}
}
/**
* Wrapper
*/
.wrapper {
max-width: $content-width;
margin: auto;
padding-right: $spacing-unit;
padding-left: $spacing-unit;
@extend %clearfix;
@include media-query($on-laptop) {
padding-right: $spacing-unit / 2;
padding-left: $spacing-unit / 2;
}
}
/**
* Clearfix
*/
%clearfix:after {
content: "";
display: table;
clear: both;
}
/**
* Tables
*/
table {
margin-bottom: $spacing-unit;
width: 100%;
text-align: $table-text-align;
color: lighten($text-color, 18%);
border-collapse: collapse;
border: 1px solid $grey-color-light;
tr {
&:nth-child(even) {
background-color: lighten($grey-color-light, 6%);
}
}
th, td {
padding: ($spacing-unit / 3) ($spacing-unit / 2);
}
th {
background-color: lighten($grey-color-light, 3%);
border: 1px solid darken($grey-color-light, 4%);
border-bottom-color: darken($grey-color-light, 12%);
}
td {
border: 1px solid $grey-color-light;
}
}
/**
* Vertical center
*/
%vertical-center {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
/**
* Flex layout
*/
%flex-layout {
display: flex;
}
%flex-1 {
flex: 1;
min-width: 0; /* <-- fix flexbox width with pre tags */
}
/**
* Flex sticky
*/
@mixin flex-sticky($top) {
position: sticky;
align-self: flex-start; /* <-- fix the sticky not work issue */
transform: scale(0.9999); /* <-- fix the sticky x overflow issue */
top: $top;
}

371
_sass/yat/_layout.scss Normal file
View file

@ -0,0 +1,371 @@
/**
* Site header
*/
.site-header {
background: $header-background-color;
height: $header-height;
width: 100%;
// Positioning context for the mobile navigation icon
@include flex-sticky(0);
z-index: 1000;
a {
text-decoration: none;
}
}
.site-brand {
float: left;
margin-right: 50px;
.site-title {
@include relative-font-size(1.625);
font-weight: $base-font-weight;
line-height: $header-height;
letter-spacing: -1px;
&,
&:visited {
color: $header-text-color;
}
}
}
.site-nav {
@include relative-font-size(1.025);
float: right;
line-height: $header-height;
.nav-trigger {
display: none;
}
.menu-icon {
display: none;
}
.page-link {
color: $header-text-color;
line-height: $base-line-height;
// Gaps between nav items, but not on the last one
&:not(:last-child) {
margin-right: 20px;
}
}
@include media-query($on-palm) {
position: absolute;
right: $spacing-unit / 2;
text-align: left;
label[for="nav-trigger"] {
display: block;
float: right;
z-index: 2;
cursor: pointer;
}
.menu-icon {
display: block;
float: right;
text-align: center;
> svg {
fill: $white-color;
}
}
input ~ .trigger {
clear: both;
display: none;
}
input:checked ~ .trigger {
display: block;
background: $header-background-color;
}
.page-link {
display: block;
padding: 5px 10px;
color: rgba($header-text-color, 80%);
margin: 0 25px;
}
}
}
/**
* Site footer
*/
.site-footer {
@include relative-font-size(0.9);
color: $footer-text-color;
background: $footer-background-color;
padding: $spacing-unit * 0.8 0;
text-align: left;
a {
$a-color: invert(mix(invert($theme-color), #0030ae));
color: $a-color;
&:hover {
color: lighten($a-color, 10%);
}
}
}
/**
* Post header
*/
%post-header {
.post-header {
margin-bottom: $spacing-unit;
}
.post-title {
@include relative-font-size(2.625);
letter-spacing: -1px;
line-height: 1;
@include media-query($on-laptop) {
@include relative-font-size(2.25);
}
}
}
/**
* Page content
*/
.page-content {
@extend %flex-1; /* <-- Keep footer on the bottom */
padding: $spacing-unit 0;
}
.page-heading {
@include relative-font-size(2);
}
.post-list-heading {
@include relative-font-size(1.75);
}
/**
* Pagination page
*/
.pagination {
.post-list {
margin-left: 0;
list-style: none;
> li {
margin-bottom: $spacing-unit;
}
}
.post-meta {
font-size: $small-font-size;
color: $grey-color;
}
.post-link {
@include relative-font-size(1.5);
display: block;
font-weight: 600;
}
}
/**
* Posts
*/
.post {
@extend %post-header;
.post-content {
margin-bottom: $spacing-unit;
h2 {
@include relative-font-size(2);
@include media-query($on-laptop) {
@include relative-font-size(1.75);
}
}
h3 {
@include relative-font-size(1.625);
@include media-query($on-laptop) {
@include relative-font-size(1.375);
}
}
h4 {
@include relative-font-size(1.25);
@include media-query($on-laptop) {
@include relative-font-size(1.125);
}
}
}
}
/**
* Posts misc
*/
.post-nav {
display: flex;
justify-content: space-between;
a {
display: flex;
}
}
/**
* Archives page
*/
.page-archives {
.page-archives-list {
margin-left: 0;
list-style: none;
}
.archives-time {
@include relative-font-size(1.5);
&:not(:first-child) {
margin-top: 18px;
}
margin-bottom: 8px;
}
.post-meta {
font-size: $small-font-size;
color: $grey-color;
}
}
/**
* Page banner
*/
.page-banner {
display: block;
position: relative;
height: $banner-height;
background-color: $banner-background;
.page-banner-img {
position: absolute;
height: 100%;
overflow: hidden;
& > *:first-child {
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: 100%;
max-width: 1000%;
background-size: cover;
background-position: center center;
overflow: hidden;
}
}
.wrapper {
height: 100%;
}
.page-banner-inner {
@extend %vertical-center;
position: relative;
color: $banner-text-color;
padding: 10px 5px;
text-shadow: 1px 1px 2px #333;
.page-banner-heading {
@include relative-font-size(2.825);
letter-spacing: -1px;
line-height: 1;
margin-bottom: 10px;
@include media-query($on-palm) {
@include relative-font-size(2.425);
}
}
@extend %post-header;
.post-title {
@include relative-font-size(2.925);
}
}
}
/**
* Layout and sidebar
*/
.framework {
@extend %flex-layout;
.main {
@extend %flex-1;
}
.sidebar {
padding-left: 8px;
@include flex-sticky($header-height + 20px);
@include media-query($on-palm) {
display: none;
}
}
}
/**
* Segments page
*/
.page-segments {
.page-segments-list {
margin-left: 0;
list-style: none;
}
.segment-name {
font-weight: 600;
margin-bottom: 8px;
position: relative;
@include relative-font-size(1.6);
&:not(:first-child) {
margin-top: 28px;
}
&:hover:before {
content: '#';
left: -1em;
position: absolute;
}
}
.post-meta {
font-size: $small-font-size;
color: $grey-color;
}
}

View file

@ -0,0 +1,105 @@
/**
* Syntax highlighting styles
*/
.highlight {
color: #c7c7c7;
@extend %vertical-rhythm;
.c { color: #998; font-style: italic } // Comment
.err { color: #a61717; background-color: #e3d2d2 } // Error
.k { font-weight: bold } // Keyword
.o { font-weight: bold } // Operator
.cm { color: #998; font-style: italic } // Comment.Multiline
.cp { color: #999; font-weight: bold } // Comment.Preproc
.c1 { color: #998; font-style: italic } // Comment.Single
.cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special
.gd { color: #000; background-color: #fdd } // Generic.Deleted
.gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific
.ge { font-style: italic } // Generic.Emph
.gr { color: #a00 } // Generic.Error
.gh { color: #999 } // Generic.Heading
.gi { color: #000; background-color: #dfd } // Generic.Inserted
.gi .x { color: #000; background-color: #afa } // Generic.Inserted.Specific
.go { color: #888 } // Generic.Output
.gp { color: #555 } // Generic.Prompt
.gs { font-weight: bold } // Generic.Strong
.gu { color: #aaa } // Generic.Subheading
.gt { color: #a00 } // Generic.Traceback
.kc { font-weight: bold } // Keyword.Constant
.kd { color: #0fdcdc; font-weight: bold } // Keyword.Declaration
.kp { font-weight: bold } // Keyword.Pseudo
.kr { font-weight: bold } // Keyword.Reserved
.kt { color: #a7a7a7; font-weight: bold } // Keyword.Type
.m { color: #099 } // Literal.Number
.s { color: #d0c55c } // Literal.String
.na { color: #a6e22e } // Name.Attribute
.nb { color: #6cc117 } // Name.Builtin
.nc { color: #4682b4; font-weight: bold } // Name.Class
.no { color: #a6e22e } // Name.Constant
.ni { color: #800080 } // Name.Entity
.ne { color: #e04b9b; font-weight: bold } // Name.Exception
.nf { color: #e04b9b; font-weight: bold } // Name.Function
.nn { color: #a6e22e } // Name.Namespace
.nt { color: #4ec2e4 } // Name.Tag
.nv { color: #a6e22e } // Name.Variable
.ow { font-weight: bold } // Operator.Word
.w { color: #bbb } // Text.Whitespace
.mf { color: #099 } // Literal.Number.Float
.mh { color: #099 } // Literal.Number.Hex
.mi { color: #099 } // Literal.Number.Integer
.mo { color: #099 } // Literal.Number.Oct
.sb { color: #d0c55c } // Literal.String.Backtick
.sc { color: #d0c55c } // Literal.String.Char
.sd { color: #d0c55c } // Literal.String.Doc
.s2 { color: #d0c55c } // Literal.String.Double
.se { color: #d0c55c } // Literal.String.Escape
.sh { color: #d0c55c } // Literal.String.Heredoc
.si { color: #d0c55c } // Literal.String.Interpol
.sx { color: #d0c55c } // Literal.String.Other
.sr { color: #009926 } // Literal.String.Regex
.s1 { color: #d0c55c } // Literal.String.Single
.ss { color: #990073 } // Literal.String.Symbol
.bp { color: #999 } // Name.Builtin.Pseudo
.vc { color: #a6e22e } // Name.Variable.Class
.vg { color: #a6e22e } // Name.Variable.Global
.vi { color: #a6e22e } // Name.Variable.Instance
.il { color: #099 } // Literal.Number.Integer.Long
}
code .rouge-table {
@extend .highlight;
}
code.highlighter-rouge {
color: white;
background: #676767;
border: none;
padding: 2px 4px;
}
figure.highlight pre {
border-radius: 3px;
code table.rouge-table {
margin: 0;
td {
border: 1px solid #efefef86;
}
pre {
margin: 0;
padding: 0;
}
.gutter.gl {
padding: 0;
.lineno {
padding: 2px;
text-align: center;
}
}
}
}

4
archives.html Normal file
View file

@ -0,0 +1,4 @@
---
layout: archives
title: ARCHIVES
---

5
assets/main.scss Normal file
View file

@ -0,0 +1,5 @@
---
# Only the main Sass file needs front matter (the dashes are enough)
---
@import "yat";

4
categories.html Normal file
View file

@ -0,0 +1,4 @@
---
layout: categories
title: CATEGORIES
---

4
index.html Normal file
View file

@ -0,0 +1,4 @@
---
layout: home
title: home
---

View file

@ -2,18 +2,22 @@
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = "jekyll-theme-yat" spec.name = "jekyll-theme-yat"
spec.version = "0.1.0" spec.version = "1.0.0"
spec.authors = ["Jeffrey Tse"] spec.authors = ["jeffreytse"]
spec.email = ["jeffreytse.mail@gmail.com"] spec.email = ["jeffreytse.mail@gmail.com"]
spec.summary = "TODO: Write a short summary, because Rubygems requires one." spec.summary = "Yet another theme."
spec.homepage = "TODO: Put your gem's website or public repo URL here." spec.homepage = "https://github.com/jeffreytse/jekyll-theme-yat"
spec.license = "MIT" spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r!^(assets|_layouts|_includes|_sass|LICENSE|README)!i) } spec.files = `git ls-files -z`.split("\x0").select do |f|
f.match(%r!^(assets|_layouts|_includes|_sass|LICENSE|README)!i)
spec.add_runtime_dependency "jekyll", "~> 3.8" end
spec.add_development_dependency "bundler", "~> 1.16" spec.add_development_dependency "bundler", "~> 1.16"
spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rake", "~> 12.0"
spec.add_runtime_dependency "jekyll", "~> 3.8"
spec.add_runtime_dependency "jekyll-feed", "~> 0.9"
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.1"
end end

4
tags.html Normal file
View file

@ -0,0 +1,4 @@
---
layout: tags
title: TAGS
---