Skip to content

Commit

Permalink
identified a problem in index.html, but not sure why and how to avoid.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShixingWang committed May 15, 2023
1 parent 52e8114 commit ec2f11c
Show file tree
Hide file tree
Showing 19 changed files with 84 additions and 72 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ github:
# i18n
languages: ["en", "zh-CN"]
lang_name:
en: En
en: En
zh-CN:
6 changes: 6 additions & 0 deletions _i18n/en.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
global:
title: "Shixing Wang"
description: "Shixing Wang's personal website"
titles:
index: Shixing Wang
home: Home
research: Research
courses: Courses
resume: Resumé
Empty file added _i18n/en/courses.html
Empty file.
32 changes: 32 additions & 0 deletions _i18n/en/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<div class="posts">
{% for post in paginator.posts %}
<div class="post">
<h1 class="post-title">
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h1>

<span class="post-date">{{ post.date | date_to_string }}</span>

{{ post.content }}
</div>
{% endfor %}
</div>

<div class="pagination">
{% if paginator.next_page %}
<a class="pagination-item older" href="{{ site.baseurl }}page{{paginator.next_page}}">Older</a>
{% else %}
<span class="pagination-item older">Older</span>
{% endif %}
{% if paginator.previous_page %}
{% if paginator.page == 2 %}
<a class="pagination-item newer" href="{{ site.baseurl }}">Newer</a>
{% else %}
<a class="pagination-item newer" href="{{ site.baseurl }}page{{paginator.previous_page}}">Newer</a>
{% endif %}
{% else %}
<span class="pagination-item newer">Newer</span>
{% endif %}
</div>
Empty file added _i18n/en/index.html
Empty file.
Empty file added _i18n/en/research.html
Empty file.
Empty file added _i18n/en/resume.html
Empty file.
8 changes: 7 additions & 1 deletion _i18n/zh-CN.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
global:
title: "王世兴"
description: "王世兴的个人网站"
description: "王世兴的个人网站"
titles:
index: 王世兴
home: 主页
research: 研究
courses: 课程
resume: 简历
Empty file added _i18n/zh-CN/courses.html
Empty file.
Empty file added _i18n/zh-CN/home.html
Empty file.
Empty file added _i18n/zh-CN/index.html
Empty file.
Empty file added _i18n/zh-CN/research.html
Empty file.
Empty file added _i18n/zh-CN/resume.html
Empty file.
15 changes: 7 additions & 8 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ <h1>
`layout: page` in the front-matter. See readme for usage.
{% endcomment %}

{% assign pages_list = site.pages %}
{% for node in pages_list %}
{% if node.title != null %}
{% if node.layout == "page" %}
<a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{ node.url }}">{{ node.title }}</a>
{% endif %}
{% endif %}
{% endfor %}
{% comment %}
OK there's problem in this block
<a class="sidebar-nav-item{% capture url %}{% t {{ titles.home }} %}{% endcapture %}{% if page.url == url %} active{% endif %}" href="{% tl home %}" >{% t {{ titles.home }} %}</a>
<a class="sidebar-nav-item{% capture url %}{% t {{ titles.reserch }} %}{% endcapture %}{% if page.url == url %} active{% endif %}" href="{% tl reserch %}">{% t {{ titles.reserch }} %}</a>
<a class="sidebar-nav-item{% capture url %}{% t {{ titles.courses }} %}{% endcapture %}{% if page.url == url %} active{% endif %}" href="{% tl courses %}">{% t {{ titles.courses }} %}</a>
<a class="sidebar-nav-item{% capture url %}{% t {{ titles.resume }} %}{% endcapture %}{% if page.url == url %} active{% endif %}" href="{% tl resume %}" >{% t {{ titles.resume }} %}</a>
{% endcomment %}

<a class="sidebar-nav-item" href="{{ site.github.repo }}">GitHub project</a>
</nav>
Expand Down
9 changes: 8 additions & 1 deletion courses.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
layout: page
---
title: titles.courses

namespace: courses
permalink: /courses
permalink_zh-CN: /courses
---

{% tf courses.html %}
41 changes: 7 additions & 34 deletions home.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,10 @@
---
layout: default
title: Home
---

<div class="posts">
{% for post in paginator.posts %}
<div class="post">
<h1 class="post-title">
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h1>
layout: page
title: titles.home

<span class="post-date">{{ post.date | date_to_string }}</span>

{{ post.content }}
</div>
{% endfor %}
</div>
namespace: home
permalink: /home
permalink_zh-CN: /home
---

<div class="pagination">
{% if paginator.next_page %}
<a class="pagination-item older" href="{{ site.baseurl }}page{{paginator.next_page}}">Older</a>
{% else %}
<span class="pagination-item older">Older</span>
{% endif %}
{% if paginator.previous_page %}
{% if paginator.page == 2 %}
<a class="pagination-item newer" href="{{ site.baseurl }}">Newer</a>
{% else %}
<a class="pagination-item newer" href="{{ site.baseurl }}page{{paginator.previous_page}}">Newer</a>
{% endif %}
{% else %}
<span class="pagination-item newer">Newer</span>
{% endif %}
</div>
{% tf home.html %}
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
layout: null
---

{% comment %}<!-- No need for {% tf index.html %} -->{% endcomment %}

<!DOCTYPE html>
<html lang="en-us">
{% include head.html %}
Expand Down
9 changes: 8 additions & 1 deletion research.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
layout: page
---
title: titles.research

namespace: research
permalink: /research
permalink_zh-CN: /research
---

{% tf research.html %}
32 changes: 6 additions & 26 deletions resume.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
---
layout: page
title: Resume
---

<p class="message">
Hey there! This page is included as an example. Feel free to customize it for your own use upon downloading. Carry on!
</p>

In the novel, *The Strange Case of Dr. Jeykll and Mr. Hyde*, Mr. Poole is Dr. Jekyll's virtuous and loyal butler. Similarly, Poole is an upstanding and effective butler that helps you build Jekyll themes. It's made by [@mdo](https://twitter.com/mdo).

There are currently two themes built on Poole:

* [Hyde](http://hyde.getpoole.com)
* [Lanyon](http://lanyon.getpoole.com)
title: titles.resume

Learn more and contribute on [GitHub](https://github.com/poole).

## Setup

Some fun facts about the setup of this project include:

* Built for [Jekyll](http://jekyllrb.com)
* Developed on GitHub and hosted for free on [GitHub Pages](https://pages.github.com)
* Coded with [Sublime Text 2](http://sublimetext.com), an amazing code editor
* Designed and developed while listening to music like [Blood Bros Trilogy](https://soundcloud.com/maddecent/sets/blood-bros-series)

Have questions or suggestions? Feel free to [open an issue on GitHub](https://github.com/poole/issues/new) or [ask me on Twitter](https://twitter.com/mdo).
namespace: resume
permalink: /resume
permalink_zh-CN: /resume
---

Thanks for reading!
{% tf resume.html %}

0 comments on commit ec2f11c

Please sign in to comment.