Skip to content

Commit

Permalink
fixed several bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
RoboMico committed Sep 22, 2024
1 parent 05584cb commit 96a6d5c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 15 deletions.
55 changes: 43 additions & 12 deletions _includes/post-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,64 @@

<nav class="post-navigation d-flex justify-content-between" aria-label="Post Navigation">
{% assign previous = site.data.locales[include.lang].post.button.previous %}
{% assign next = site.data.locales[include.lang].post.button.next %}
{% assign next = site.data.locales[include.lang].post.button.next %}

{% if page.previous.url %}
<!--
-->
{% assign previous_post = nil %}
{% assign next_post = nil %}

{% assign flag = false %}
{% for p in site.posts %}
{% if flag %}
{% if p.lang == page.lang %}
{% assign previous_post = p %}
{% break %}
{% endif %}
{% else %}
{% if p.id == page.id %}
{% assign flag = true %}
{% endif %}
{% endif %}
{% endfor %}

{% assign flag = false %}
{% for p in site.posts reversed %}
{% if flag %}
{% if p.lang == page.lang %}
{% assign next_post = p %}
{% break %}
{% endif %}
{% else %}
{% if p.id == page.id %}
{% assign flag = true %}
{% endif %}
{% endif %}
{% endfor %}

{% if previous_post.url %}
<a
href="{{ site.baseurl }}{{ page.previous.url }}"
href="{{ site.baseurl }}{{ previous_post.url }}"
class="btn btn-outline-primary"
aria-label="{{ previous }}"
>
<p>{{ page.previous.title }}</p>
aria-label="{{ previous }}">
<p>{{ previous_post.title }}</p>
</a>
{% else %}
<div class="btn btn-outline-primary disabled" aria-label="{{ previous }}">
<p>-</p>
</div>
{% endif %}

{% if page.next.url %}
{% if next_post.url %}
<a
href="{{ site.baseurl }}{{page.next.url}}"
href="{{ site.baseurl }}{{next_post.url}}"
class="btn btn-outline-primary"
aria-label="{{ next }}"
>
<p>{{ page.next.title }}</p>
aria-label="{{ next }}">
<p>{{ next_post.title }}</p>
</a>
{% else %}
<div class="btn btn-outline-primary disabled" aria-label="{{ next }}">
<p>-</p>
</div>
{% endif %}
</nav>
</nav>
2 changes: 1 addition & 1 deletion _posts/2024-09-11-the-origin-ch1-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ He rolls up the venetian blind a little, revealing a bar of the window near the

"Yes, and in an e-waste dump." He says in a calm tone as he closes the blinds.

"**What!?** I was abandoned after the explosion?"
"**What?!** I was abandoned after the explosion?"

"What explosion?"

Expand Down
4 changes: 2 additions & 2 deletions assets/css/jekyll-theme-chirpy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ banner {
}
#memset-banner {
background-color: #292929;
margin-top: -12rem;
font-family: var(--bs-font-monospace);
margin-top: -5rem;
font-family: var(--bs-font-monospace),var(--bs-font-sans-serif);
p {
font-size: 1.2rem;
color: white;
Expand Down

0 comments on commit 96a6d5c

Please sign in to comment.