Skip to content

Commit

Permalink
feat(site): prepare for i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
ourai committed Apr 19, 2023
1 parent f52380b commit 4077c18
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 43 deletions.
2 changes: 1 addition & 1 deletion man/cookbook/.meta/basic.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
permalink: /:collection/:path/
permalink: /zh/:collection/:path/
4 changes: 2 additions & 2 deletions man/cookbook/guides/getting-started/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ksio:
url: https://ourai.ws/
```

全部配置项详见《[网站配置]({{ site.baseurl }}/apis/site-config/)》。
全部配置项详见《[网站配置]({{ site.baseurl }}/zh/apis/site-config/)》。

### 页面配置

Expand All @@ -105,4 +105,4 @@ ksio:
page: # 用于页面,值为数组
```

全部配置项详见《[页面配置]({{ site.baseurl }}/apis/page-config/)》。
全部配置项详见《[页面配置]({{ site.baseurl }}/zh/apis/page-config/)》。
14 changes: 7 additions & 7 deletions src/jekyll/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,20 @@ ksio:
url: https://oss.ourai.ws/
copyright:
owner:
text: 欧雷流
url: https://ourai.ws/
text: 欧雷
url: https://linxoid.com/ourai/
period:
start: 2015
header:
navs:
- text: 文档
url: /guides/
url: /zh/guides/
- text: 博客
url: /posts/
url: /zh/posts/
- text: 关于
children:
- text: 本站
url: /about/
url: /zh/about/
- text: 作者
url: https://linxoid.com/ourai/
- text: GitHub
Expand All @@ -164,6 +164,6 @@ ksio:
partial: footer.html
links:
- text: 关于
url: /about/
url: /zh/about/
- text: 资助
url: /about/#donation
url: /zh/about/#donation
1 change: 1 addition & 0 deletions src/jekyll/_data/local/repos.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cookbook:
name: 食用手册
base: /zh
collection: guides
toc:
- text: 概述
Expand Down
31 changes: 1 addition & 30 deletions src/jekyll/_pages/index.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,6 @@
---
layout: ksio/default
css:
- local/pages/index
permalink: index.html
---

{% include ksio/partials/header.html %}
<main class="Page-content">
<article class="Homepage">
<header class="Homepage-header">
<h1>{{ site.title }}</h1>
<p class="Homepage-slogan">{{ site.tagline | default: site.description }}</p>
<p class="GetStarted"><a href="{{ '/guides/' | prepend: site.baseurl | prepend: site.url }}">开始了解<i class="fa fa-long-arrow-right"></i></a></p>
</header>
<section class="Homepage-body">
<h2 class="sr-only">特色</h2>
<div class="FeatureList">
<div class="FeatureList-item">
<h3>体验优先</h3>
<p>以提高阅读体验和保持简洁风格为最高原则,体现个性在其次。</p>
</div>
<div class="FeatureList-item">
<h3>应用广泛</h3>
<p>可用于博客、个人网站、API 文档站等以内容为主的网站。</p>
</div>
<div class="FeatureList-item">
<h3>多种支持</h3>
<p>除了提供核心的样式与交互外,还支持 Jekyll、Hexo 等主流静态网站生成器。</p>
</div>
</div>
</section>
</article>
</main>
{% include footer.html %}
<p style="display: flex; align-items: center; height: 100%; justify-content: center; font-size: 3rem;"><span>Sorry, only <a href="{{ '' | prepend: site.baseurl | prepend: site.url }}/zh/" style="font-weight: 400; font-style: italic;">Chinese</a> is supported for now.</span></p>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ js:
- ksio/initializers/time
- ksio/initializers/lazyload
repo: cookbook
permalink: /guides/
---

本主题由[欧雷](https://linxoid.com/ourai/?utm_source={{ site.ksio.meta.url }}){:target="_blank"}{:rel="external "}于 2015 年开始设计与开发,并在个人网站「[欧雷流](https://ourai.ws/?utm_source={{ site.ksio.meta.url }}){:target="_blank"}{:rel="external "}」及个人各种开源软件的文档站上使用多年;在设计时以提高阅读体验和保持简洁风格为最高原则,体现个性在其次。
Expand Down Expand Up @@ -59,7 +58,7 @@ permalink: /guides/

## 使用

本主题支持多种使用方式,详见《[快速上手]({{ site.baseurl }}/guides/getting-started/)》。
本主题支持多种使用方式,详见《[快速上手]({{ site.baseurl }}/zh/guides/getting-started/)》。

### 主题署名

Expand All @@ -72,7 +71,7 @@ permalink: /guides/
<figcaption>主题提供者声明</figcaption>
</figure>

但这并非是强制的,可通过在[网站配置]({{ site.baseurl }}/apis/site-config/)文件中将 [`copyright.provider`]({{ site.baseurl }}/apis/site-config/#copyright) 设为 `false` 以关闭显示;或把 [`footer.partial`]({{ site.baseurl }}/apis/site-config/#footer) 改为自定义的页脚去覆盖。
但这并非是强制的,可通过在[网站配置]({{ site.baseurl }}/zh/apis/site-config/)文件中将 [`copyright.provider`]({{ site.baseurl }}/zh/apis/site-config/#copyright) 设为 `false` 以关闭显示;或把 [`footer.partial`]({{ site.baseurl }}/zh/apis/site-config/#footer) 改为自定义的页脚去覆盖。

如果可以,请不要关闭默认页脚中主题和提供者的名字与来源的显示;如需完全使用自定义页脚文件,也请在页脚加上如下 HTML 代码:

Expand Down
35 changes: 35 additions & 0 deletions src/jekyll/_pages/zh/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
layout: ksio/default
css:
- local/pages/index
permalink: /zh/
---

{% include ksio/partials/header.html %}
<main class="Page-content">
<article class="Homepage">
<header class="Homepage-header">
<h1>{{ site.title }}</h1>
<p class="Homepage-slogan">{{ site.tagline | default: site.description }}</p>
<p class="GetStarted"><a href="{{ '/zh/guides/' | prepend: site.baseurl | prepend: site.url }}">开始了解<i class="fa fa-long-arrow-right"></i></a></p>
</header>
<section class="Homepage-body">
<h2 class="sr-only">特色</h2>
<div class="FeatureList">
<div class="FeatureList-item">
<h3>体验优先</h3>
<p>以提高阅读体验和保持简洁风格为最高原则,体现个性在其次。</p>
</div>
<div class="FeatureList-item">
<h3>应用广泛</h3>
<p>可用于博客、个人网站、API 文档站等以内容为主的网站。</p>
</div>
<div class="FeatureList-item">
<h3>多种支持</h3>
<p>除了提供核心的样式与交互外,还支持 Jekyll、Hexo 等主流静态网站生成器。</p>
</div>
</div>
</section>
</article>
</main>
{% include footer.html %}
File renamed without changes.

0 comments on commit 4077c18

Please sign in to comment.