Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

update: njk — moving and renaming files #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 60 additions & 60 deletions src/_includes/article.njk → src/_includes/layouts/article.njk
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
---
layout: 'layouts/secondary.njk'
style: 'article.css'
---
{% set previousPost = collections.post | getPreviousCollectionItem(page) %}
{% set nextPost = collections.post | getNextCollectionItem(page) %}
<header class="header header_article">
<img width="1920" height="1080" loading="lazy" src="{{ image }}" alt="{{ title }}">
</header>
<main class="main">
<div class="main-container">
<article class="article">
<header>
<span>
<a class="breadcrumb" href="/">Home</a> ›
<a class="breadcrumb" href="/blog">Blog</a> › {{ title }}
</span>
<h1 class="article-title" id="{{ title | slug }}">{{ title }}</h1>
<p class="article-summary">{{ description }}</p>
<div class="article-detail_list article-flex_list">
<div class="article-detail_item">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="article-detail_item_svg">
<path stroke-linecap="round" stroke-linejoin="round"
d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" />
</svg>
{{ author }}
</div>
<div class="article-detail_item">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="article-detail_item_svg">
<path stroke-linecap="round" stroke-linejoin="round"
d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5" />
</svg>
<time datetime="{{ date | htmlDateString }}">{{ date | postDate }}</time>
</div>
</div>
</header>
<main id="main">
{{ content | safe }}
</main>
<section class="more">
{% if nextPost %}
<div class="more-next">
← Next Post<br /> <a href="{{ nextPost.url }}">{{ nextPost.data.title }}
</a>
</div>
{% endif %}
{% if previousPost %}
<div class="more-previous">
Previous Post →<br /> <a href="{{ previousPost.url }}">{{ previousPost.data.title }}
</a>
</div>
{% endif %}
</section>
</article>
</div>
</main>
---
layout: 'layouts/secondary.njk'
style: 'article.css'
---
{% set previousPost = collections.post | getPreviousCollectionItem(page) %}
{% set nextPost = collections.post | getNextCollectionItem(page) %}

<header class="header header_article">
<img width="1920" height="1080" loading="lazy" src="{{ image }}" alt="{{ title }}">
</header>
<main class="main">
<div class="main-container">
<article class="article">
<header>
<span>
<a class="breadcrumb" href="/">Home</a> ›
<a class="breadcrumb" href="/blog">Blog</a> › {{ title }}
</span>
<h1 class="article-title" id="{{ title | slug }}">{{ title }}</h1>
<p class="article-summary">{{ description }}</p>
<div class="article-detail_list article-flex_list">
<div class="article-detail_item">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="article-detail_item_svg">
<path stroke-linecap="round" stroke-linejoin="round"
d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" />
</svg>
{{ author }}
</div>
<div class="article-detail_item">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="article-detail_item_svg">
<path stroke-linecap="round" stroke-linejoin="round"
d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5" />
</svg>
<time datetime="{{ date | htmlDateString }}">{{ date | postDate }}</time>
</div>
</div>
</header>
<main id="main">
{{ content | safe }}
</main>
<section class="more">
{% if nextPost %}
<div class="more-next">
← Next Post<br /> <a href="{{ nextPost.url }}">{{ nextPost.data.title }}
</a>
</div>
{% endif %}
{% if previousPost %}
<div class="more-previous">
Previous Post →<br /> <a href="{{ previousPost.url }}">{{ previousPost.data.title }}
</a>
</div>
{% endif %}
</section>
</article>
</div>
</main>

<script src="/js/blog.js"></script>
70 changes: 35 additions & 35 deletions src/_includes/sections/prototypes.njk
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<section aria-labelledby="prototypes" class="prototype">
<svg class="prototype-svg_top"
id="svg-prototype-top"
viewBox="0 0 1440 400"
xmlns="http://www.w3.org/2000/svg">
<path d="M 0,400 C 0,400 0,133 0,133 C 284.5,111.5 569,90 809,90 C 1049,90 1244.5,111.5 1440,133 C 1440,133 1440,400 1440,400 Z" stroke="none" stroke-width="0" fill="currentColor" fill-opacity="0.53" class="transition-all duration-300 ease-in-out delay-150 path-0" transform="rotate(-180 720 200)">
</path>
<path d="M 0,400 C 0,400 0,266 0,266 C 241.5,270 483,274 723,274 C 963,274 1201.5,270 1440,266 C 1440,266 1440,400 1440,400 Z" stroke="none" stroke-width="0" fill="currentColor" fill-opacity="1" class="transition-all duration-300 ease-in-out delay-150 path-1" transform="rotate(-180 720 200)">
</path>
</svg>
<div class="main-container">
<header class="section-header" data-animation="fade-in">
<div class="header-title">
<a class="header-title__link" href="#prototypes">
<span aria-hidden="true">#</span>
<span class="sr-only">Link to heading "prototype"</span>
</a>
<h2 id="prototypes">Prototype</h2>
</div>
<span class="header-desc">Prototypes that I do while learning new thing.</span>
</header>
<ul class="prototypes">
{%- for post in collections.prototype | reverse -%}
{% include "components/snippets/prototype.njk" %}
{%- endfor -%}
</ul>
</div>
<svg class="prototype-svg_bottom"
id="svg-prototype-bottom"
viewBox="0 0 1440 400"
xmlns="http://www.w3.org/2000/svg">
<path d="M 0,400 C 0,400 0,200 0,200 C 257,219.5 514,239 754,239 C 994,239 1217,219.5 1440,200 C 1440,200 1440,400 1440,400 Z" stroke="none" stroke-width="0" fill="currentColor" fill-opacity="1" class="transition-all duration-300 ease-in-out delay-150 path-0">
</path>
</svg>
</section>
<section aria-labelledby="prototypes" class="prototype">
<svg class="prototype-svg_top"
id="svg-prototype-top"
viewBox="0 0 1440 400"
xmlns="http://www.w3.org/2000/svg">
<path d="M 0,400 C 0,400 0,133 0,133 C 284.5,111.5 569,90 809,90 C 1049,90 1244.5,111.5 1440,133 C 1440,133 1440,400 1440,400 Z" stroke="none" stroke-width="0" fill="currentColor" fill-opacity="0.53" class="transition-all duration-300 ease-in-out delay-150 path-0" transform="rotate(-180 720 200)">
</path>
<path d="M 0,400 C 0,400 0,266 0,266 C 241.5,270 483,274 723,274 C 963,274 1201.5,270 1440,266 C 1440,266 1440,400 1440,400 Z" stroke="none" stroke-width="0" fill="currentColor" fill-opacity="1" class="transition-all duration-300 ease-in-out delay-150 path-1" transform="rotate(-180 720 200)">
</path>
</svg>
<div class="main-container">
<header class="section-header" data-animation="fade-in">
<div class="header-title">
<a class="header-title__link" href="#prototypes">
<span aria-hidden="true">#</span>
<span class="sr-only">Link to heading "prototype"</span>
</a>
<h2 id="prototypes">Prototype</h2>
</div>
<span class="header-desc">Prototypes that I do while learning new thing.</span>
</header>
<ul class="prototypes">
{%- for post in collections.prototype | reverse -%}
{% include "components/snippets/prototype-card.njk" %}
{%- endfor -%}
</ul>
</div>
<svg class="prototype-svg_bottom"
id="svg-prototype-bottom"
viewBox="0 0 1440 400"
xmlns="http://www.w3.org/2000/svg">
<path d="M 0,400 C 0,400 0,200 0,200 C 257,219.5 514,239 754,239 C 994,239 1217,219.5 1440,200 C 1440,200 1440,400 1440,400 Z" stroke="none" stroke-width="0" fill="currentColor" fill-opacity="1" class="transition-all duration-300 ease-in-out delay-150 path-0">
</path>
</svg>
</section>
82 changes: 40 additions & 42 deletions src/_includes/sections/work.njk
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
<section aria-labelledby="work" class="work">
<div class="main-container to-be-animate">
<header class="section-header" data-animation="right-show">
<div class="header-title">
<a class="header-title__link" href="#work">
<span aria-hidden="true">#</span>
<span class="sr-only">Link to heading "work"</span>
</a>
<h2 id="work">Work</h2>
</div>
<span class="header-desc">Projects that I participated on or worked on.</span>
</header>
{% set lengthProjects = collections.project | length %}
{% if lengthProjects > 2 %}
<ul class="cards cards-horizontal cards-more">
{% set reverseProjects = collections.project | reverse %}
{% set projects = reverseProjects | sliceRecent %}
{% else %}
<ul class="cards cards-horizontal">
{% set projects = collections.project | reverse %}
{% endif %}
{%- for project in projects -%}
{% include 'components/snippets/project.njk' %}
{%- endfor -%}
</ul>
{% if lengthProjects > 3 %}
<a href="{{ link.github }}?tab=repositories"
target="_blank"
rel="noopener noreferrer"
class="section-more"
data-animation="fade-in"
aria-label="See more of my works in Github">See more in Github...</a>
{% endif %}
</div>
<svg class="work-svg_bottom"
id="svg-work"
viewBox="0 0 1440 400"
xmlns="http://www.w3.org/2000/svg">
<path d="M 0,400 C 0,400 0,200 0,200 C 164.8,235.2 329.6,270.4 500,259 C 670.4,247.6 846.4000000000001,189.60000000000002 1004,172 C 1161.6,154.39999999999998 1300.8,177.2 1440,200 C 1440,200 1440,400 1440,400 Z" stroke="none" stroke-width="0" fill="currentColor" fill-opacity="1" class="transition-all duration-300 ease-in-out delay-150 path-0">
</path>
</svg>
</section>
<section aria-labelledby="work" class="work">
<div class="main-container to-be-animate">
<header class="section-header" data-animation="right-show">
<div class="header-title">
<a class="header-title__link" href="#work">
<span aria-hidden="true">#</span>
<span class="sr-only">Link to heading "work"</span>
</a>
<h2 id="work">Work</h2>
</div>
<span class="header-desc">Projects that I participated on or worked on.</span>
</header>
{% set lengthProjects = collections.project | length %}
{% set reverseProjects = collections.project | reverse %}
{% set projects = reverseProjects %}
<ul class="cards cards-horizontal{% if lengthProjects > 2 %} cards-more{% endif %}">
{% if lengthProjects > 2 %}
{% set projects = reverseProjects | sliceRecent %}
{% endif %}
{%- for project in projects -%}
{% include "components/snippets/project-card.njk" %}
{%- endfor -%}
</ul>
{% if lengthProjects > 3 %}
<a href="{{ link.github }}?tab=repositories"
target="_blank"
rel="noopener noreferrer"
class="section-more"
data-animation="fade-in"
aria-label="See more of my works in Github">See more in Github...</a>
{% endif %}
</div>
<svg class="work-svg_bottom"
id="svg-work"
viewBox="0 0 1440 400"
xmlns="http://www.w3.org/2000/svg">
<path d="M 0,400 C 0,400 0,200 0,200 C 164.8,235.2 329.6,270.4 500,259 C 670.4,247.6 846.4000000000001,189.60000000000002 1004,172 C 1161.6,154.39999999999998 1300.8,177.2 1440,200 C 1440,200 1440,400 1440,400 Z" stroke="none" stroke-width="0" fill="currentColor" fill-opacity="1" class="transition-all duration-300 ease-in-out delay-150 path-0">
</path>
</svg>
</section>
2 changes: 1 addition & 1 deletion src/articles/blog/blog.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"layout": "article.njk",
"layout": "layouts/article.njk",
"tags": "post",
"author": "EmptyWork",
"image": "/images/emptywork.my.id-default-post.jpg",
Expand Down
Loading