🎉 Initial commit

This commit is contained in:
piharpi
2019-03-24 17:47:48 +07:00
parent 09ac49afec
commit 2c26100c06
50 changed files with 2213 additions and 37 deletions

24
_layouts/404.html Normal file
View File

@@ -0,0 +1,24 @@
---
layout: compress
---
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: " en " }}">
{% include head.html %}
<body>
<main aria-label="Content">
<div class="wrapper">
<div class="er-wrapper">
<div class="er-container">
<h1 class="er-header">404 — </h1>
<p class="er-paragraph">Hmm... Seems like you lost from my journey 🎒 .</p>
<p class="er-by">Don't worry you can back to trip <a href="{{ site.url }}">right now</a>.</p>
</div>
</div>
</div>
</main>
</body>
</html>

4
_layouts/compress.html Normal file
View File

@@ -0,0 +1,4 @@
---
---
{% if site.compress_html.ignore.envs contains jekyll.environment %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}</{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if site.compress_html.comments.size == 2 %}{% assign _comment_befores = _content | split: site.compress_html.comments.first %}{% for _comment_before in _comment_befores %}{% assign _comment_content = _comment_before | split: site.compress_html.comments.last | first %}{% if _comment_content %}{% capture _comment %}{{ site.compress_html.comments.first }}{{ _comment_content }}{{ site.compress_html.comments.last }}{% endcapture %}{% assign _content = _content | remove: _comment %}{% endif %}{% endfor %}{% endif %}{% assign _pre_befores = _content | split: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% case _pres.size %}{% when 2 %}{% capture _content %}{{ _content }}<pre{{ _pres.first }}</pre>{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% when 1 %}{% capture _content %}{{ _content }}{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% endcase %}{% endfor %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{{ _content }}{% endif %}

20
_layouts/default.html Normal file
View File

@@ -0,0 +1,20 @@
---
layout: compress
---
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: " en " }}">
{% include head.html %}
<body>
<div class="wrapper">
{% include cover.html %}
<main aria-label="Content">
{{ content }}
</main>
{% include footer.html %}
</div>
</body>
</html>

73
_layouts/home.html Normal file
View File

@@ -0,0 +1,73 @@
---
layout: default
home: true
---
<div class="home">
{% if site.projects %}
<h4 class="home-title"><span role="img" aria-label="icon-rocket">🚀</span>my works <span class="project-nav"><button id="prevProject" aria-label="arrow left"></button><button id="nextProject" aria-label="arrow right"></button></span></h4>
<div class="content">
<div class="projects">
<div class="projects-container" id="projectsContainer">
{% for project in site.data.projects %}
<div class="project-item">
<h4 class="project-item-title"><a target="_blank" href="{{ project.url }}" rel="noreferrer">{{ project.title | downcase }}</a></h4>
<p class="project-item-description">{{ project.description | downcase }}</p>
<p class="project-action">{{ project.action }}</p>
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
<script>
const projects = document.getElementById('projectsContainer'),
prev = document.getElementById('prevProject'),
next = document.getElementById('nextProject');
next.addEventListener('mousedown', () => projects.scrollLeft += 245);
prev.addEventListener('mousedown', () => projects.scrollLeft -= 245);
</script>
<h4 class="home-title"><span role="img" aria-label="icon-book">📘</span>blog posts</h4>
<div class="content">
{% for post in site.blog limit:3 %}
<article class="list-post blog">
<header class="list-post-header">
<h4 class="list-post-title">
<a href="{{ post.url | relative_url }}">{{ post.title | escape }}.</a>
</h4>
</header>
<section class="list-post-excerpt">
<p class="list-post-excerpt"> — {{ post.excerpt | strip_html | downcase | normalize_whitespace | truncatewords: 15, '...' }} </p>
</section>
</article>
{% endfor %}
<nav class="see-all-container">
<a class="button" href="{{ site.url }}/blog">See All</a>
</nav>
</div>
<h4 class="home-title"><span role="img" aria-label="icon-coffee">☕️</span>programming tips</h4>
<div class="content">
{% for post in site.tips reversed limit: 3 %}
<article class="list-post tips">
<header class="list-post-header tips">
<h4 class="list-post-title">
<a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
</h4>
</header>
<small class="list-meta">
{% if post.tags != empty %}
{% assign tags = post.tags %}
{% for tag in tags %}
<a class="tag" href="{{site.url}}/tags/#{{tag | downcase | slugify}}">{{tag | downcase }}</a>{% unless forloop.last %},{% endunless %}
{% endfor %}
{% endif %}
</small>
</article>
{% endfor %}
<nav class="see-all-container">
<a class="button" href="{{ site.url }}/tips">See All</a>
</nav>
</div>
</div>

28
_layouts/page.html Normal file
View File

@@ -0,0 +1,28 @@
---
layout: compress
file: page.url
---
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: " en " }}">
{% include head.html %}
<body>
<div class="wrapper">
{% include cover.html %}
<main aria-label="Content">
<div class="content">
{% include {{ page.url | remove: "/" }}.html %}
</div>
</main>
{% include footer.html %}
</div>
</body>
</html>

64
_layouts/post.html Normal file
View File

@@ -0,0 +1,64 @@
---
layout: compress
---
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
{% include head.html %}
<body>
<div class="wrapper">
<main class="page-content" aria-label="Content">
{% include cover.html %}
<article class="post" itemscope itemtype="https://schema.org/BlogPosting">
<header class="post-header">
<h1 class="post-title" itemprop="headline">{{ page.title | escape }}</h1>
</header>
{% if page.date or page.tags %}
<div class="post-meta">
<span itemprop="author" itemscope itemtype="https://schema.org/Person">
Posted by <span itemprop="name">{{ site.author.name }}</span> on
</span>
<time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
{{ page.date | date: "%b %d, %Y" }}
</time>
<time hidden datetime="{{ page.modified | date_to_xmlschema }}" itemprop="dateModified">
{{ page.date | date: "%b %d, %Y" }}
</time>
<span hidden itemprop="publisher" itemtype="Person">{{ site.author.name }}</span>
<span hidden itemprop="image">{{ page.image | absolute_url }}</span>
<span hidden itemprop="mainEntityOfPage">{{ page.excerpt }}</span>
{% if page.tags and page.tags != empty %}
<div class="tags">
{% assign tags = page.tags %}
🔥
<span itemprop="keywords">
{% for tag in tags %}
<a class="tag" href="{{site.url}}/tags/#{{tag | downcase | slugify}}">{{tag | downcase }}</a>{% unless forloop.last %},{% endunless %}
{% endfor %}
</span>
</div>
{% endif %}
</div>
{% endif %}
<div class="post-content" itemprop="articleBody">
{{ content }}
{% if page.tweet %}
<p>Comments this article on <a href="https://twitter.com/{{site.username}}/status/{{page.tweet}}">Twitter</a>.</p>
{% endif %}
</div>
</article>
{% if page.next or page.previous %}
{% include post-nav.html %}
{% endif %}
</main>
{% include footer.html %}
</div>
</body>
</html>