Skip to content

Commit 2430211

Browse files
* 'master' of https://github.com/sonjh1217/sonjh1217.github.io: feat(i18n): add persian language (cotes2020#2238) docs: using long form Jekyll subcommand (cotes2020#2231) fix(search): avoid missing spaces between paragraphs in search results (cotes2020#2199) feat(i18n): add Dutch locale (cotes2020#2076)
2 parents adf2afc + 7d4d35c commit 2430211

File tree

7 files changed

+346
-17
lines changed

7 files changed

+346
-17
lines changed

_data/locales/fa-IR.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# The layout text of site
2+
3+
# ----- Commons label -----
4+
5+
layout:
6+
post: پست
7+
category: دسته‌بندی
8+
tag: برچسب
9+
10+
# The tabs of sidebar
11+
tabs:
12+
# format: <filename_without_extension>: <value>
13+
home: خانه
14+
categories: دسته‌بندی‌ها
15+
tags: برچسب‌ها
16+
archives: آرشیو
17+
about: درباره
18+
19+
# the text displayed in the search bar & search results
20+
search:
21+
hint: جستجو
22+
cancel: لغو
23+
no_results: متأسفیم! هیچ نتیجه‌ای یافت نشد.
24+
25+
panel:
26+
lastmod: آخرین به‌روزرسانی
27+
trending_tags: برچسب‌های پرطرفدار
28+
toc: فهرست مطالب
29+
30+
copyright:
31+
# Shown at the bottom of the post
32+
license:
33+
template: این پست تحت مجوز :LICENSE_NAME توسط نویسنده منتشر شده است.
34+
name: CC BY 4.0
35+
link: https://creativecommons.org/licenses/by/4.0/
36+
37+
# Displayed in the footer
38+
brief: برخی حقوق محفوظ است.
39+
verbose: >-
40+
مگر اینکه خلاف آن ذکر شده باشد، پست‌های وبلاگ در این سایت
41+
تحت مجوز Creative Commons Attribution 4.0 International (CC BY 4.0) توسط نویسنده منتشر شده‌اند.
42+
43+
meta: با استفاده از :PLATFORM قالب :THEME
44+
45+
not_found:
46+
statement: متأسفیم، لینک زیر معتبر نیست یا به صفحه‌ای که وجود ندارد اشاره می‌کند.
47+
48+
notification:
49+
update_found: نسخه جدیدی از محتوا موجود است.
50+
update: به‌روزرسانی
51+
52+
# ----- Posts related labels -----
53+
54+
post:
55+
written_by: نوشته شده توسط
56+
posted: منتشر شده
57+
updated: به‌روزرسانی شده
58+
words: کلمات
59+
pageview_measure: بازدیدها
60+
read_time:
61+
unit: دقیقه
62+
prompt: زمان مطالعه
63+
relate_posts: بیشتر بخوانید
64+
share: اشتراک‌گذاری
65+
button:
66+
next: جدیدتر
67+
previous: قدیمی‌تر
68+
copy_code:
69+
succeed: کپی شد!
70+
share_link:
71+
title: کپی لینک
72+
succeed: لینک با موفقیت کپی شد!
73+
74+
# Date time format.
75+
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
76+
df:
77+
post:
78+
strftime: "%b %e, %Y"
79+
dayjs: "ll"
80+
archives:
81+
strftime: "%b"
82+
dayjs: "MMM"
83+
84+
# categories page
85+
categories:
86+
category_measure:
87+
singular: دسته‌بندی
88+
plural: دسته‌بندی‌ها
89+
post_measure:
90+
singular: پست
91+
plural: پست‌ها

_data/locales/nl-NL.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# The layout text of site
2+
3+
# ----- Commons label -----
4+
5+
layout:
6+
post: Post
7+
category: Categorie
8+
tag: Tag
9+
10+
# The tabs of sidebar
11+
tabs:
12+
# format: <filename_without_extension>: <value>
13+
home: Startpagina
14+
categories: Categorieën
15+
tags: Tags
16+
archives: Archief
17+
about: Over
18+
19+
# the text displayed in the search bar & search results
20+
search:
21+
hint: Zoek
22+
cancel: Annuleer
23+
no_results: Oops! Geen resultaat gevonden.
24+
25+
panel:
26+
lastmod: Recent Bijgewerkt
27+
trending_tags: Trending Tags
28+
toc: Inhoud
29+
30+
copyright:
31+
# Shown at the bottom of the post
32+
license:
33+
template: Alle posts zijn onder :LICENSE_NAME gepubliceerd door de auteur.
34+
name: CC BY 4.0
35+
link: https://creativecommons.org/licenses/by/4.0/
36+
37+
# Displayed in the footer
38+
brief: Sommige rechten voorbehouden.
39+
verbose: >-
40+
Tenzij anders vermeld, alle posts zijn onder de
41+
Creative Commons Attribution 4.0 International (CC BY 4.0) gepubliceerd door de auteur.
42+
43+
meta: Gebruikt :THEME
44+
45+
not_found:
46+
statement: Sorry, we hebben de URL verkeerd geplaatst of hij verwijst naar iets dat niet bestaat.
47+
48+
notification:
49+
update_found: Nieuwe versie van inhoud beschikbaar.
50+
update: Update
51+
52+
# ----- Posts related labels -----
53+
post:
54+
written_by: Door
55+
posted: Posted
56+
updated: Bijgewerkt
57+
words: woorden
58+
pageview_measure: Gelezen
59+
read_time:
60+
unit: min
61+
prompt: lees
62+
relate_posts: Verder Lezen
63+
share: Deel
64+
button:
65+
next: Volgende
66+
previous: Vorige
67+
copy_code:
68+
succeed: Gekopieerd!
69+
share_link:
70+
title: Link kopiëren
71+
succeed: Succesvol gekopieerd!
72+
73+
# Date time format.
74+
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
75+
df:
76+
post:
77+
strftime: "%b %e, %Y"
78+
dayjs: "ll"
79+
archives:
80+
strftime: "%b"
81+
dayjs: "MMM"
82+
83+
# categories page
84+
categories:
85+
category_measure:
86+
singular: categorie
87+
plural: categorieën
88+
post_measure:
89+
singular: post
90+
plural: posts

_includes/no-linenos.html

Lines changed: 0 additions & 10 deletions
This file was deleted.

_includes/post-description.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@
88
{%- if post.description -%}
99
{{- post.description -}}
1010
{%- else -%}
11-
{%- include no-linenos.html content=post.content -%}
12-
{{- content | markdownify | strip_html -}}
11+
{% comment %}
12+
Remove the line number of the code snippet.
13+
{% endcomment %}
14+
{% assign content = post.content %}
15+
16+
{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %}
17+
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%}
18+
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
19+
{% endif %}
20+
21+
{{- content | markdownify | strip_html | newline_to_br | replace: '<br />', ' ' | strip_newlines -}}
1322
{%- endif -%}
1423
{%- endcapture -%}
1524

_includes/search-loader.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h2><a href="{url}">{title}</a></h2>
1212
{tags}
1313
</div>
1414
</header>
15-
<p>{snippet}</p>
15+
<p>{content}</p>
1616
</article>
1717
{% endcapture %}
1818

_posts/2019-08-09-getting-started.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
title: Getting Started
3+
description: >-
4+
Get started with Chirpy basics in this comprehensive overview.
5+
You will learn how to install, configure, and use your first Chirpy-based website, as well as deploy it to a web server.
6+
author: cotes
7+
date: 2019-08-09 20:55:00 +0800
8+
categories: [Blogging, Tutorial]
9+
tags: [getting started]
10+
pin: true
11+
media_subpath: '/posts/20180809'
12+
---
13+
14+
## Creating a Site Repository
15+
16+
When creating your site repository, you have two options depending on your needs:
17+
18+
### Option 1. Using the Starter (Recommended)
19+
20+
This approach simplifies upgrades, isolates unnecessary files, and is perfect for users who want to focus on writing with minimal configuration.
21+
22+
1. Sign in to GitHub and navigate to the [**starter**][starter].
23+
2. Click the <kbd>Use this template</kbd> button and then select <kbd>Create a new repository</kbd>.
24+
3. Name the new repository `<username>.github.io`, replacing `username` with your lowercase GitHub username.
25+
26+
### Option 2. Forking the Theme
27+
28+
This approach is convenient for modifying features or UI design, but presents challenges during upgrades. So don't try this unless you are familiar with Jekyll and plan to heavily modify this theme.
29+
30+
1. Sign in to GitHub.
31+
2. [Fork the theme repository](https://github.com/cotes2020/jekyll-theme-chirpy/fork).
32+
3. Name the new repository `<username>.github.io`, replacing `username` with your lowercase GitHub username.
33+
34+
## Setting up the Environment
35+
36+
Once your repository is created, it's time to set up your development environment. There are two primary methods:
37+
38+
### Using Dev Containers (Recommended for Windows)
39+
40+
Dev Containers offer an isolated environment using Docker, which prevents conflicts with your system and ensures all dependencies are managed within the container.
41+
42+
**Steps**:
43+
44+
1. Install Docker:
45+
- On Windows/macOS, install [Docker Desktop][docker-desktop].
46+
- On Linux, install [Docker Engine][docker-engine].
47+
2. Install [VS Code][vscode] and the [Dev Containers extension][dev-containers].
48+
3. Clone your repository:
49+
- For Docker Desktop: Start VS Code and [clone your repo in a container volume][dc-clone-in-vol].
50+
- For Docker Engine: Clone your repo locally, then [open it in a container][dc-open-in-container] via VS Code.
51+
4. Wait for the Dev Containers setup to complete.
52+
53+
### Setting up Natively (Recommended for Unix-like OS)
54+
55+
For Unix-like systems, you can set up the environment natively for optimal performance, though you can also use Dev Containers as an alternative.
56+
57+
**Steps**:
58+
59+
1. Follow the [Jekyll installation guide](https://jekyllrb.com/docs/installation/) to install Jekyll and ensure [Git](https://git-scm.com/) is installed.
60+
2. Clone your repository to your local machine.
61+
3. If you forked the theme, install [Node.js][nodejs] and run `bash tools/init.sh` in the root directory to initialize the repository.
62+
4. Run command `bundle` in the root of your repository to install the dependencies.
63+
64+
## Usage
65+
66+
### Start the Jekyll Server
67+
68+
To run the site locally, use the following command:
69+
70+
```terminal
71+
$ bundle exec jekyll serve
72+
```
73+
74+
> If you are using Dev Containers, you must run that command in the **VS Code** Terminal.
75+
{: .prompt-info }
76+
77+
After a few seconds, the local server will be available at <http://127.0.0.1:4000>.
78+
79+
### Configuration
80+
81+
Update the variables in `_config.yml`{: .filepath} as needed. Some typical options include:
82+
83+
- `url`
84+
- `avatar`
85+
- `timezone`
86+
- `lang`
87+
88+
### Social Contact Options
89+
90+
Social contact options are displayed at the bottom of the sidebar. You can enable or disable specific contacts in the `_data/contact.yml`{: .filepath} file.
91+
92+
### Customizing the Stylesheet
93+
94+
To customize the stylesheet, copy the theme's `assets/css/jekyll-theme-chirpy.scss`{: .filepath} file to the same path in your Jekyll site, and add your custom styles at the end of the file.
95+
96+
### Customizing Static Assets
97+
98+
Static assets configuration was introduced in version `5.1.0`. The CDN of the static assets is defined in `_data/origin/cors.yml`{: .filepath }. You can replace some of them based on the network conditions in the region where your website is published.
99+
100+
If you prefer to self-host the static assets, refer to the [_chirpy-static-assets_](https://github.com/cotes2020/chirpy-static-assets#readme) repository.
101+
102+
## Deployment
103+
104+
Before deploying, check the `_config.yml`{: .filepath} file and ensure the `url` is configured correctly. If you prefer a [**project site**](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or if you want to visit your website with a base URL on a web server other than **GitHub Pages**, remember to set the `baseurl` to your project name, starting with a slash, e.g., `/project-name`.
105+
106+
Now you can choose _ONE_ of the following methods to deploy your Jekyll site.
107+
108+
### Deploy Using Github Actions
109+
110+
Prepare the following:
111+
112+
- If you're on the GitHub Free plan, keep your site repository public.
113+
- If you have committed `Gemfile.lock`{: .filepath} to the repository, and your local machine is not running Linux, update the platform list of the lock file:
114+
115+
```console
116+
$ bundle lock --add-platform x86_64-linux
117+
```
118+
119+
Next, configure the _Pages_ service:
120+
121+
1. Go to your repository on GitHub. Select the _Settings_ tab, then click _Pages_ in the left navigation bar. In the **Source** section (under _Build and deployment_), select [**GitHub Actions**][pages-workflow-src] from the dropdown menu.
122+
![Build source](pages-source-light.png){: .light .border .normal w='375' h='140' }
123+
![Build source](pages-source-dark.png){: .dark .normal w='375' h='140' }
124+
125+
2. Push any commits to GitHub to trigger the _Actions_ workflow. In the _Actions_ tab of your repository, you should see the workflow _Build and Deploy_ running. Once the build is complete and successful, the site will be deployed automatically.
126+
127+
You can now visit the URL provided by GitHub to access your site.
128+
129+
### Manual Build and Deployment
130+
131+
For self-hosted servers, you will need to build the site on your local machine and then upload the site files to the server.
132+
133+
Navigate to the root of the source project, and build your site with the following command:
134+
135+
```console
136+
$ JEKYLL_ENV=production bundle exec jekyll b
137+
```
138+
139+
Unless you specified the output path, the generated site files will be placed in the `_site`{: .filepath} folder of the project's root directory. Upload these files to your target server.
140+
141+
[nodejs]: https://nodejs.org/
142+
[starter]: https://github.com/cotes2020/chirpy-starter
143+
[pages-workflow-src]: https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow
144+
[docker-desktop]: https://www.docker.com/products/docker-desktop/
145+
[docker-engine]: https://docs.docker.com/engine/install/
146+
[vscode]: https://code.visualstudio.com/
147+
[dev-containers]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
148+
[dc-clone-in-vol]: https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume
149+
[dc-open-in-container]: https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-an-existing-folder-in-a-container

assets/js/data/search.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ swcache: true
55

66
[
77
{% for post in site.posts %}
8+
{%- capture description -%}
9+
{% include post-description.html %}
10+
{%- endcapture -%}
811
{
912
"title": {{ post.title | jsonify }},
1013
"url": {{ post.url | relative_url | jsonify }},
1114
"categories": {{ post.categories | join: ', ' | jsonify }},
1215
"tags": {{ post.tags | join: ', ' | jsonify }},
1316
"date": "{{ post.date }}",
14-
{% include no-linenos.html content=post.content %}
15-
{% assign _content = content | strip_html | strip_newlines %}
16-
"snippet": {{ _content | truncate: 200 | jsonify }},
17-
"content": {{ _content | jsonify }}
17+
"content": "{{ description }}"
1818
}{% unless forloop.last %},{% endunless %}
1919
{% endfor %}
2020
]

0 commit comments

Comments
 (0)