🎉 Initial commit
This commit is contained in:
73
_layouts/home.html
Normal file
73
_layouts/home.html
Normal 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>
|
||||
Reference in New Issue
Block a user