generated from cotes2020/chirpy-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update experience.md and add structure details
- Loading branch information
1 parent
6838196
commit d9c47b1
Showing
9 changed files
with
351 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
--- | ||
layout: default | ||
refactor: true | ||
--- | ||
|
||
{% include lang.html %} | ||
|
||
{% assign pinned = site.posts | where: 'pin', 'true' %} | ||
{% assign default = site.posts | where_exp: 'item', 'item.pin != true and item.hidden != true' %} | ||
|
||
{% assign posts = '' | split: '' %} | ||
|
||
<!-- Get pinned posts --> | ||
|
||
{% assign offset = paginator.page | minus: 1 | times: paginator.per_page %} | ||
{% assign pinned_num = pinned.size | minus: offset %} | ||
|
||
{% if pinned_num > 0 %} | ||
{% for i in (offset..pinned.size) limit: pinned_num %} | ||
{% assign posts = posts | push: pinned[i] %} | ||
{% endfor %} | ||
{% else %} | ||
{% assign pinned_num = 0 %} | ||
{% endif %} | ||
|
||
<!-- Get default posts --> | ||
|
||
<style> | ||
.alert-box { | ||
background-color: #FFF5CC; /* Light yellow background */ | ||
/*border: 1px solid #FFCC00;*/ /* Yellow border */ | ||
color: #333; /* Dark text color */ | ||
padding: 20px; | ||
/* margin: 20px; */ | ||
border-radius: 15px; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.alert-box .icon { | ||
margin-right: 10px; | ||
font-size: 24px; | ||
color: #FFCC00; /* Yellow color */ | ||
} | ||
</style> | ||
|
||
<div class="alert-box"> | ||
<div class="icon">⚠️</div> <!-- Unicode warning sign icon --> | ||
<div>Website under construction.</div> | ||
</div> | ||
|
||
|
||
|
||
{% assign default_beg = offset | minus: pinned.size %} | ||
|
||
{% if default_beg < 0 %} | ||
{% assign default_beg = 0 %} | ||
{% endif %} | ||
|
||
{% assign default_num = paginator.posts | size | minus: pinned_num %} | ||
{% assign default_end = default_beg | plus: default_num | minus: 1 %} | ||
|
||
{% if default_num > 0 %} | ||
{% for i in (default_beg..default_end) %} | ||
{% assign posts = posts | push: default[i] %} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
<div id="post-list" class="flex-grow-1 px-xl-1"> | ||
{% for post in posts %} | ||
<article class="card-wrapper card"> | ||
<a href="{{ post.url | relative_url }}" class="post-preview row g-0 flex-md-row-reverse"> | ||
{% assign card_body_col = '12' %} | ||
|
||
{% if post.image %} | ||
{% assign src = post.image.path | default: post.image %} | ||
{% unless src contains '//' %} | ||
{% assign src = post.media_subpath | append: '/' | append: src | replace: '//', '/' %} | ||
{% endunless %} | ||
|
||
{% assign alt = post.image.alt | xml_escape | default: 'Preview Image' %} | ||
|
||
{% assign lqip = null %} | ||
|
||
{% if post.image.lqip %} | ||
{% capture lqip %}lqip="{{ post.image.lqip }}"{% endcapture %} | ||
{% endif %} | ||
|
||
<div class="col-md-5"> | ||
<img src="{{ src }}" alt="{{ alt }}" {{ lqip }}> | ||
</div> | ||
|
||
{% assign card_body_col = '7' %} | ||
{% endif %} | ||
|
||
<div class="col-md-{{ card_body_col }}"> | ||
<div class="card-body d-flex flex-column"> | ||
<h1 class="card-title my-2 mt-md-0">{{ post.title }}</h1> | ||
|
||
<div class="card-text content mt-0 mb-3"> | ||
<p>{% include post-description.html %}</p> | ||
</div> | ||
|
||
<div class="post-meta flex-grow-1 d-flex align-items-end"> | ||
<div class="me-auto"> | ||
<!-- posted date --> | ||
<i class="far fa-calendar fa-fw me-1"></i> | ||
{% include datetime.html date=post.date lang=lang %} | ||
|
||
<!-- categories --> | ||
{% if post.categories.size > 0 %} | ||
<i class="far fa-folder-open fa-fw me-1"></i> | ||
<span class="categories"> | ||
{% for category in post.categories %} | ||
{{ category }} | ||
{%- unless forloop.last -%},{%- endunless -%} | ||
{% endfor %} | ||
</span> | ||
{% endif %} | ||
</div> | ||
|
||
{% if post.pin %} | ||
<div class="pin ms-1"> | ||
<i class="fas fa-thumbtack fa-fw"></i> | ||
<span>{{ site.data.locales[lang].post.pin_prompt }}</span> | ||
</div> | ||
{% endif %} | ||
</div> | ||
<!-- .post-meta --> | ||
</div> | ||
<!-- .card-body --> | ||
</div> | ||
</a> | ||
</article> | ||
{% endfor %} | ||
</div> | ||
<!-- #post-list --> | ||
|
||
{% if paginator.total_pages > 1 %} | ||
{% include post-paginator.html %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.