From 0cec8b6a0ce6e7f95c0da98e41e7a967e0228b0e Mon Sep 17 00:00:00 2001 From: "hexo-crowdin[bot]" <159447924+hexo-crowdin[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 01:04:36 +0000 Subject: [PATCH] l10n(zh-TW): New translations from Crowdin --- source/zh-tw/api/box.md | 3 -- source/zh-tw/api/console.md | 1 - source/zh-tw/api/deployer.md | 1 - source/zh-tw/api/filter.md | 14 +----- source/zh-tw/api/generator.md | 6 +-- source/zh-tw/api/helper.md | 1 - source/zh-tw/api/index.md | 5 -- source/zh-tw/api/locals.md | 1 - source/zh-tw/api/migrator.md | 1 - source/zh-tw/api/processor.md | 1 - source/zh-tw/api/renderer.md | 3 -- source/zh-tw/api/rendering.md | 3 -- source/zh-tw/api/tag.md | 19 ------- source/zh-tw/api/themes.md | 1 - source/zh-tw/docs/commands.md | 2 +- source/zh-tw/docs/configuration.md | 20 ++------ source/zh-tw/docs/front-matter.md | 15 +++--- source/zh-tw/docs/github-pages.md | 2 +- source/zh-tw/docs/gitlab-pages.md | 8 +-- source/zh-tw/docs/helpers.md | 27 +++++----- source/zh-tw/docs/index.md | 8 +-- source/zh-tw/docs/one-command-deployment.md | 16 +++--- source/zh-tw/docs/plugins.md | 16 +++--- source/zh-tw/docs/setup.md | 1 - source/zh-tw/docs/syntax-highlight.md | 19 ++++--- source/zh-tw/docs/tag-plugins.md | 19 +++---- source/zh-tw/docs/themes.md | 20 ++++---- source/zh-tw/docs/troubleshooting.md | 4 +- source/zh-tw/docs/variables.md | 56 ++++++++++----------- 29 files changed, 117 insertions(+), 176 deletions(-) diff --git a/source/zh-tw/api/box.md b/source/zh-tw/api/box.md index e8388ecebc..e7396c24a0 100644 --- a/source/zh-tw/api/box.md +++ b/source/zh-tw/api/box.md @@ -9,8 +9,6 @@ Box is a container used for processing files in a specified folder. 「箱子」 箱子提供了兩種方法來載入檔案:`process`, `watch`,前者用於載入資料夾內的所有檔案;而後者除了執行 `process` 以外,還會繼續監看檔案變動。 `process` loads all files in the folder. `watch` does the same, but also starts watching for file changes. ```js -box.process().then(function () { - // ... box.process().then(function () { // ... }); @@ -18,7 +16,6 @@ box.process().then(function () { box.watch().then(function () { // 之後可呼叫 box.unwatch() 停止檔案監看 }); -}); ``` ## 路徑比對 diff --git a/source/zh-tw/api/console.md b/source/zh-tw/api/console.md index c569ce29e1..b19e96c8ff 100644 --- a/source/zh-tw/api/console.md +++ b/source/zh-tw/api/console.md @@ -10,7 +10,6 @@ title: 控制台(Console) hexo.extend.console.register(name, desc, options, function (args) { // ... }); -}); ``` | Argument | 描述 | diff --git a/source/zh-tw/api/deployer.md b/source/zh-tw/api/deployer.md index 14ccc6e63c..67f753111b 100644 --- a/source/zh-tw/api/deployer.md +++ b/source/zh-tw/api/deployer.md @@ -10,7 +10,6 @@ title: 佈署器(Deployer) hexo.extend.deployer.register(name, function (args) { // ... }); -}); ``` An argument `args` will be passed into the function. 在函數中會傳入 `args` 參數,此參數包含了 `_config.yml` 中的 `deploy` 設定,及使用者在終端機所傳入的參數。 diff --git a/source/zh-tw/api/filter.md b/source/zh-tw/api/filter.md index dccffac023..a5e51823c5 100644 --- a/source/zh-tw/api/filter.md +++ b/source/zh-tw/api/filter.md @@ -16,12 +16,6 @@ hexo.extend.filter.register(type, function() { const { config: themeCfg } = this.theme; if (themeCfg.fancybox) // do something... -}, priority); - - // Theme configuration - const { config: themeCfg } = this.theme; - if (themeCfg.fancybox) // do something... - }, priority); ``` @@ -156,7 +150,6 @@ Executed after generation finishes. hexo.extend.filter.register("after_generate", function () { // ... }); -}); ``` ### template_locals @@ -180,7 +173,6 @@ hexo.extend.filter.register("template_locals", function (locals) { hexo.extend.filter.register("after_init", function () { // ... }); -}); ``` ### new_post_path @@ -191,7 +183,6 @@ Executed when creating a post to determine the path of new posts. hexo.extend.filter.register("new_post_path", function (data, replace) { // ... }); -}); ``` ### post_permalink @@ -202,7 +193,6 @@ Used to determine the permalink of posts. hexo.extend.filter.register("post_permalink", function (data) { // ... }); -}); ``` ### after_render @@ -214,8 +204,8 @@ Executed after rendering finishes. 在渲染後執行,您可參考 [渲染](re Executed after generated files and cache are removed with `hexo clean` command. ```js -hexo.extend.filter.register("before_exit", function () { - // ... +hexo.extend.filter.register("after_clean", function () { + // remove some other temporary files }); ``` diff --git a/source/zh-tw/api/generator.md b/source/zh-tw/api/generator.md index 77aa1e3026..33baf3f803 100644 --- a/source/zh-tw/api/generator.md +++ b/source/zh-tw/api/generator.md @@ -10,7 +10,6 @@ A generator builds routes based on processed files. hexo.extend.generator.register(name, function (locals) { // ... }); -}); ``` A `locals` argument will get passed into the function, containing the [site variables](../docs/variables.html#Site-Variables). You should use this argument to get the website data, thereby avoiding having to access the database directly. @@ -53,7 +52,7 @@ Next, set the `layout` attribute to render with the theme templates. We're setti hexo.extend.generator.register("archive", function (locals) { return { path: "archives/index.html", - data: locals.posts, + data: locals, layout: ["archive", "index"], }; }); @@ -67,7 +66,8 @@ hexo.extend.generator.register("archive", function (locals) { var pagination = require("hexo-pagination"); hexo.extend.generator.register("archive", function (locals) { - return pagination("archives/index.html", locals.posts, { + // hexo-pagination makes an index.html for the /archives route + return pagination("archives", locals.posts, { perPage: 10, layout: ["archive", "index"], data: {}, diff --git a/source/zh-tw/api/helper.md b/source/zh-tw/api/helper.md index e1fddcf439..52c250795c 100644 --- a/source/zh-tw/api/helper.md +++ b/source/zh-tw/api/helper.md @@ -12,7 +12,6 @@ Helpers can not be accessed from `source` files. hexo.extend.helper.register(name, function () { // ... }); -}); ``` ## 範例 diff --git a/source/zh-tw/api/index.md b/source/zh-tw/api/index.md index 446674f63a..fe3d37a9f4 100644 --- a/source/zh-tw/api/index.md +++ b/source/zh-tw/api/index.md @@ -17,7 +17,6 @@ var hexo = new Hexo(process.cwd(), {}); hexo.init().then(function () { // ... }); -}); ``` | 選項 | 描述 | Default | @@ -35,8 +34,6 @@ Hexo 提供了兩種方法來載入檔案:`load`, `watch`,前者用於載入 Both methods will load the list of files and pass them to the corresponding processors. After all files have been processed, they will call upon the generators to create the routes. ```js -hexo.load().then(function () { - // ... hexo.load().then(function () { // ... }); @@ -44,7 +41,6 @@ hexo.load().then(function () { hexo.watch().then(function () { // 之後可呼叫 hexo.unwatch() 停止檔案監看 }); -}); ``` ## 執行指令 @@ -55,7 +51,6 @@ Any console command can be called explicitly using the `call` method on the Hexo hexo.call("generate", {}).then(function () { // ... }); -}); ``` ```js diff --git a/source/zh-tw/api/locals.md b/source/zh-tw/api/locals.md index 92b483933c..9dcbaf5088 100644 --- a/source/zh-tw/api/locals.md +++ b/source/zh-tw/api/locals.md @@ -25,7 +25,6 @@ hexo.locals.get("posts"); hexo.locals.set('posts', function(){ return ... }); -}); ``` ## 移除變數 diff --git a/source/zh-tw/api/migrator.md b/source/zh-tw/api/migrator.md index 52c91df9e7..956f1497ab 100644 --- a/source/zh-tw/api/migrator.md +++ b/source/zh-tw/api/migrator.md @@ -10,7 +10,6 @@ title: Migrator hexo.extend.migrator.register(name, function (args) { // ... }); -}); ``` An argument `args` will be passed into the function. This argument will contain the user's input into the terminal. diff --git a/source/zh-tw/api/processor.md b/source/zh-tw/api/processor.md index 4b336eb5fc..5e6fa53501 100644 --- a/source/zh-tw/api/processor.md +++ b/source/zh-tw/api/processor.md @@ -10,7 +10,6 @@ title: 處理器(Processor) hexo.extend.processor.register(rule, function (file) { // ... }); -}); ``` 完整說明請參照 [箱子](box.html)。 diff --git a/source/zh-tw/api/renderer.md b/source/zh-tw/api/renderer.md index a73d287feb..25fd4709eb 100644 --- a/source/zh-tw/api/renderer.md +++ b/source/zh-tw/api/renderer.md @@ -14,9 +14,6 @@ hexo.extend.renderer.register( // ... }, sync, -); - }, - sync, ); ``` diff --git a/source/zh-tw/api/rendering.md b/source/zh-tw/api/rendering.md index 4ac643296b..bca20208f9 100644 --- a/source/zh-tw/api/rendering.md +++ b/source/zh-tw/api/rendering.md @@ -12,7 +12,6 @@ title: 渲染 hexo.render.render({ text: "example", engine: "swig" }).then(function (result) { // ... }); -}); ``` ## 渲染檔案 @@ -23,7 +22,6 @@ hexo.render.render({ text: "example", engine: "swig" }).then(function (result) { hexo.render.render({ path: "path/to/file.swig" }).then(function (result) { // ... }); -}); ``` ## 渲染選項 @@ -34,7 +32,6 @@ You can pass in an options object as the second argument. hexo.render.render({ text: "" }, { foo: "foo" }).then(function (result) { // ... }); -}); ``` ## after_render 過濾器 diff --git a/source/zh-tw/api/tag.md b/source/zh-tw/api/tag.md index 9267999bd1..e68c6f3d15 100644 --- a/source/zh-tw/api/tag.md +++ b/source/zh-tw/api/tag.md @@ -13,9 +13,6 @@ hexo.extend.tag.register( // ... }, options, -); - }, - options, ); ``` @@ -142,16 +139,6 @@ hexo.extend.tag.register('foo', function (args) { return 'foo'; }); - - // Front-matter - const { title } = this; // article's (post/page) title - - // Article's content - const { _content } = this; // original content - const { content } = this; // HTML-rendered content - - return 'foo'; -}); ``` 2. @@ -176,12 +163,6 @@ module.exports = hexo => { return 'foo'; }; }; - - const { title, _content, content } = this; - - return 'foo'; - }; -}; ``` [Nunjucks]: https://mozilla.github.io/nunjucks/ diff --git a/source/zh-tw/api/themes.md b/source/zh-tw/api/themes.md index 01aa260848..c3e221b4d1 100644 --- a/source/zh-tw/api/themes.md +++ b/source/zh-tw/api/themes.md @@ -32,7 +32,6 @@ var view = hexo.theme.getView("layout.swig"); view.render({ foo: 1, bar: 2 }).then(function (result) { // ... }); -}); ``` 您可在 `render` 方法傳入選項作為參數,`render` 方法會先使用相應的渲染引擎進行處理,並載入 [輔助函數](helper.html),渲染完成後,會試著尋找佈局(layout)是否存在,當 `layout` 設為 `false` 或不存在時則會直接回傳渲染結果。 When rendering is complete, it will try to find whether a layout exists. If `layout` is `false` or if it doesn't exist, the result will be returned directly. diff --git a/source/zh-tw/docs/commands.md b/source/zh-tw/docs/commands.md index f91556af74..e19fee8d58 100644 --- a/source/zh-tw/docs/commands.md +++ b/source/zh-tw/docs/commands.md @@ -98,7 +98,7 @@ Deploys your website. ## render ```bash -$ hexo render [file2] ... +$ hexo render [file2] ... ``` 渲染檔案。 diff --git a/source/zh-tw/docs/configuration.md b/source/zh-tw/docs/configuration.md index 862681587d..39d5d29ca2 100644 --- a/source/zh-tw/docs/configuration.md +++ b/source/zh-tw/docs/configuration.md @@ -177,27 +177,13 @@ include: - ".nojekyll" # 包括 'source/css/_typing.css' - "css/_typing.css" - # 包括 'source/_css/' 中的任何檔案,但不包括子目錄及其其中的檔案。 - - "css/_typing.css" # Include any file in 'source/_css/'. - "_css/*" # Include any file and subfolder in 'source/_css/'. - - "_css/*" - # 包含 'source/_css/' 中的任何檔案和子目錄下的任何檔案 - "_css/**/*" exclude: - # 不包括 'source/js/test.js' - - "js/test.js" - # 不包括 'source/js/' 中的檔案、但包含子目錄下的所有目錄和檔案 - - "js/*" - # 不包括 'source/js/' 中的檔案和子目錄下的任何檔案 - - "js/**/*" - # 不包括 'source/js/' 目錄下的所有檔案名以 'test' 開頭的檔案,但包括其它檔案和子目錄的單一檔案 - - "js/test*" - # 不包括 'source/js/' 及其子目錄中任何以 'test' 開頭的檔案 - - "js/**/test*" - # 不要用 exclude 来忽略 'source/_posts/' 中的檔案。 + # Exclude 'source/js/test.js'. - "js/test.js" # Exclude any file in 'source/js/'. - "js/*" @@ -231,10 +217,10 @@ Each value in the list must be enclosed with single/double quotes. 使用 `hexo` 指令時,只要在指令後面加上 `--config` 參數與自訂配置檔 (需為 JSON 或 YAML 檔) 路徑即可指定此次想要搭配使用的配置檔。 該參數也可以是以逗號分隔的檔案列表 (注意中間不得有空格) 來滿足一次使用多個配置檔的需求。 ```bash -# 使用自訂的 'custom.yml' 取代預設的 '_config.yml' +# use 'custom.yml' in place of '_config.yml' $ hexo server --config custom.yml -# 使用多個配置檔, 有衝突時優先使用 'custom2.json' +# use 'custom.yml' & 'custom2.json', prioritizing 'custom2.json' $ hexo server --config custom.yml,custom2.json ``` diff --git a/source/zh-tw/docs/front-matter.md b/source/zh-tw/docs/front-matter.md index 7a257c775b..d913181e91 100644 --- a/source/zh-tw/docs/front-matter.md +++ b/source/zh-tw/docs/front-matter.md @@ -54,10 +54,12 @@ Only posts support the use of categories and tags. Categories apply to posts in ```yaml categories: - - Diary + - Sports + - Baseball tags: - - PS3 - - Games + - Injury + - Fight + - Shocking ``` If you want to apply multiple category hierarchies, use a list of names instead of a single name. If Hexo sees any categories defined this way on a post, it will treat each category for that post as its own independent hierarchy. @@ -66,7 +68,8 @@ If you want to apply multiple category hierarchies, use a list of names instead ```yaml categories: - - [Diary, PlayStation] - - [Diary, Games] - - [Life] + - [Sports, Baseball] + - [MLB, American League, Boston Red Sox] + - [MLB, American League, New York Yankees] + - Rivalries ``` diff --git a/source/zh-tw/docs/github-pages.md b/source/zh-tw/docs/github-pages.md index 92e9388d0f..f2ef9c4ad1 100644 --- a/source/zh-tw/docs/github-pages.md +++ b/source/zh-tw/docs/github-pages.md @@ -106,6 +106,6 @@ deploy: ## Useful links -- [GitHub Pages 使用文檔](https://docs.github.com/en/pages) +- [GitHub Pages](https://docs.github.com/en/pages) - [使用自定义 GitHub Actions 工作流进行发布](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) - [actions/deploy-github-pages-site](https://github.com/marketplace/actions/deploy-github-pages-site) diff --git a/source/zh-tw/docs/gitlab-pages.md b/source/zh-tw/docs/gitlab-pages.md index 0b3198ca70..43c53d6fae 100644 --- a/source/zh-tw/docs/gitlab-pages.md +++ b/source/zh-tw/docs/gitlab-pages.md @@ -9,7 +9,7 @@ title: GitLab Pages 5. Add `.gitlab-ci.yml` file to the root folder of your repo (alongside \_config.yml & package.json) with the following content (replacing `16` with the major version of Node.js you noted in previous step): ```yml -image: node:10-alpine # use nodejs v10 LTS +image: node:16-alpine cache: paths: - node_modules/ @@ -20,12 +20,12 @@ before_script: pages: script: - - hexo generate + - npm run build artifacts: paths: - public - only: - - master + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ``` 6. GitLab CI 完成部署後,你應該能瀏覽 `.gitlab.io` 頁面。 diff --git a/source/zh-tw/docs/helpers.md b/source/zh-tw/docs/helpers.md index 5d1ff4e738..05f751e1ad 100644 --- a/source/zh-tw/docs/helpers.md +++ b/source/zh-tw/docs/helpers.md @@ -124,7 +124,7 @@ More info: [Gravatar](https://en.gravatar.com/site/implement/images/) ### css -載入 CSS 檔案。 `path` can be an array or a string. `path` can be a string, an array, an object or an array of objects. `path` 可以是陣列或字串,如果 `path` 開頭不是 `/` 或任何協議,則會自動加上根路徑;如果後面沒有加上 `.css` 副檔名的話,也會自動加上。 Use object type for custom attributes. +載入 CSS 檔案。 `path` can be a string, an array, an object or an array of objects. `path` 可以是陣列或字串,如果 `path` 開頭不是 `/` 或任何協議,則會自動加上根路徑;如果後面沒有加上 `.css` 副檔名的話,也會自動加上。 Use object type for custom attributes. ```js <%- css(path, ...) %> @@ -929,18 +929,19 @@ Parses all heading tags (h1~h6) in the content and inserts a table of contents. <%- toc(str, [options]) %> ``` -| Option | Description | Default | -| ----------------------- | -------------------- | ----------------- | -| `class` | Class 名稱 | `toc` | -| `class_item` (+6.3.0) | 文章列表的 class 名稱。 | `${class}-item` | -| `class_link` (+6.3.0) | 插入分頁連結。 | `${class}-link` | -| `class_text` (+6.3.0) | 改變文章名稱顯示方法的函數 | `${class}-text` | -| `class_child` (+6.3.0) | 改變彙整名稱顯示方法的函數 | `${class}-child` | -| `class_number` (+6.3.0) | 顯示編號 | `${class}-number` | -| `class_level` (+6.3.0) | 改變分類名稱顯示方法的函數 | `${class}-level` | -| `list_number` | Displays list number | true | -| `max_depth` | 生成 TOC 的最大深度 | 6 | -| `min_depth` | 生成 TOC 的最小深度 | 1 | +| Option | Description | Default | +| ----------------------- | ---------------------------------------- | ----------------- | +| `class` | Class 名稱 | `toc` | +| `class_item` (+6.3.0) | 文章列表的 class 名稱。 | `${class}-item` | +| `class_link` (+6.3.0) | 插入分頁連結。 | `${class}-link` | +| `class_text` (+6.3.0) | 改變文章名稱顯示方法的函數 | `${class}-text` | +| `class_child` (+6.3.0) | 改變彙整名稱顯示方法的函數 | `${class}-child` | +| `class_number` (+6.3.0) | 顯示編號 | `${class}-number` | +| `class_level` (+6.3.0) | 改變分類名稱顯示方法的函數 | `${class}-level` | +| `list_number` | Displays list number | true | +| `max_depth` | 生成 TOC 的最大深度 | 6 | +| `min_depth` | 生成 TOC 的最小深度 | 1 | +| `max_items` (+7.3.0) | Maximum number of items in generated toc | `Infinity` | **Examples:** diff --git a/source/zh-tw/docs/index.md b/source/zh-tw/docs/index.md index c7e10ca9f0..493563fa31 100644 --- a/source/zh-tw/docs/index.md +++ b/source/zh-tw/docs/index.md @@ -49,15 +49,15 @@ Node.js 為大多數平台提供了官方的 [安裝程序](https://nodejs.org/e 對於 Mac 和 Linux 同樣建議使用 nvs 或者 nvm,以避免可能會出現的權限問題。 -{% note info Windows 用戶 %} +{% note info Windows %} 使用 Node.js 官方安裝程序時,請確保勾選 **Add to PATH** 選項(默認已勾選) {% endnote %} -{% note warn For Mac / Linux 用戶 %} +{% note warn Mac / Linux %} 如果在嘗試安裝Hexo 的過程中出現`EACCES` 權限錯誤,請遵循[由npmjs 發布的指導](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally) 修復該問題。 {% endnote %} -{% note info Linux 用戶 %} +{% note info Linux %} 若您使用 Snap 安裝 Node.js,您則需要在[初始化](/zh-tw/docs/commands#init)一個部落格時,於目標資料夾中手動執行 `npm install`。 {% endnote %} @@ -74,7 +74,7 @@ $ npm install -g hexo-cli Advanced users may prefer to install and use `hexo` package instead. ```bash -讓 Hexo 準備就緒僅需幾分鐘,若您在安裝時遭遇問題而且找不到任何解決方式,請 回報問題,我會試著解決您的問題。 +$ npm install hexo ``` Once installed, you can run Hexo in two ways: diff --git a/source/zh-tw/docs/one-command-deployment.md b/source/zh-tw/docs/one-command-deployment.md index 6721152107..5af31c1377 100644 --- a/source/zh-tw/docs/one-command-deployment.md +++ b/source/zh-tw/docs/one-command-deployment.md @@ -42,17 +42,17 @@ $ npm install hexo-deployer-git --save ```yaml deploy: type: git - repo: #https://bitbucket.org/JohnSmith/johnsmith.bitbucket.io + repo: # https://bitbucket.org/JohnSmith/johnsmith.bitbucket.io branch: [branch] message: [message] ``` -| 選項 | 描述 | Default | -| --------- | ------------------------------------------------ | -------------------------------------------------------------------------------------- | -| `repo` | URL of the target repository | | -| `branch` | 分支名稱。 | `gh-pages` (GitHub)
`coding-pages` (Coding.net)
`master` (其他) | -| `message` | Customize commit message. | `Site updated: {% raw %}{{ now('YYYY-MM-DD HH:mm:ss') }}{% endraw %}`) | -| `token` | 選填的 token 值用來儲存庫存取身份認證。 以 `$` 作為前綴從環境變數中讀取 token | | +| 選項 | 描述 | Default | +| --------- | ------------------------------------------------ | ------------------------------------------------------------------------------- | +| `repo` | URL of the target repository | | +| `branch` | 分支名稱。 | `gh-pages` (GitHub)
`coding-pages` (Coding.net)
`master` (其他) | +| `message` | Customize commit message. | `Site updated: {% raw %}{{ now('YYYY-MM-DD HH:mm:ss') }}{% endraw %}` | +| `token` | 選填的 token 值用來儲存庫存取身份認證。 以 `$` 作為前綴從環境變數中讀取 token | | 3. 上傳你的網站。 執行 `hexo clean && hexo deploy`。 @@ -280,7 +280,7 @@ After a few moments, your website will be deployed. 2. 修改配置。 ```yaml -deploy: # 所有部署器的根配置塊 +deploy: # The root configuration block for all deployers - type: rss3 endpoint: https://hub.rss3.io privateKey: 47e18d6c386898b424025cd9db446f779ef24ad33a26c499c87bb3d9372540ba diff --git a/source/zh-tw/docs/plugins.md b/source/zh-tw/docs/plugins.md index d6f52903a3..8f0aa3c482 100644 --- a/source/zh-tw/docs/plugins.md +++ b/source/zh-tw/docs/plugins.md @@ -16,7 +16,6 @@ If your code is complicated or if you want to publish it to the NPM registry, we ```plain . -. ├── index.js └── package.json ``` @@ -50,9 +49,9 @@ You'll also need to list your plugin as a dependency in the root `package.json` 2. Clone the repository to your computer and install dependencies. ```shell - /site.git -$ cd site -$ npm install + $ git clone https://github.com//site.git + $ cd site + $ npm install ``` 3. 編輯 `source/_data/plugins.yml`,在檔案中新增您的外掛,例如: @@ -61,10 +60,11 @@ $ npm install ```yaml description: Server module for Hexo. - name: hexo-server -description: Server module for Hexo. -link: https://github.com/hexojs/hexo-server -tags: - official - server - console + link: https://github.com/hexojs/hexo-server + tags: + - official + - server + - console ``` 5. 推送(push)分支。 diff --git a/source/zh-tw/docs/setup.md b/source/zh-tw/docs/setup.md index 9b89a69e40..1c1383013a 100644 --- a/source/zh-tw/docs/setup.md +++ b/source/zh-tw/docs/setup.md @@ -16,7 +16,6 @@ Once initialized, here's what your project folder will look like: ```plain . -. ├── _config.yml ├── package.json ├── scaffolds diff --git a/source/zh-tw/docs/syntax-highlight.md b/source/zh-tw/docs/syntax-highlight.md index ca294fe919..cdb1454683 100644 --- a/source/zh-tw/docs/syntax-highlight.md +++ b/source/zh-tw/docs/syntax-highlight.md @@ -33,7 +33,7 @@ highlight: auto_detect: false line_number: true line_threshold: 0 - tab_replace: '' + tab_replace: "" exclude_languages: - example wrap: true @@ -43,8 +43,7 @@ prismjs: preprocess: true line_number: true line_threshold: 0 - line_threshold: 0 - tab_replace: '' + tab_replace: "" ``` v7.0.0+: @@ -151,7 +150,7 @@ highlight: > Tip: When you want to use "sublanguage highlight", enable `auto_detect` and don't mark language when writing code block. -{% note warn "Warning!" %} %} +{% note warn "Warning!" %} `auto_detect` is very resource-intensive. `auto_detect` is very resource-intensive. Do not enable it unless you really need "sublanguage highlight" or prefer not to mark language when writing code block. {% endnote %} @@ -205,7 +204,7 @@ Hexo _wraps_ the output inside `
` and `` to support line number. ``` -{% note warn "Warning!" %} %} +{% note warn "Warning!" %} Because `line_number` feature relies on `wrap`, you can't disable `wrap` with `line_number` enabled: If you set `line_number` to `true`, `wrap` will be automatically enabled. {% endnote %} @@ -241,10 +240,14 @@ prismjs: v7.0.0+: ```yaml -Prismjs is disabled by default. You should set highlight.enable to false before enabling prismjs. +# _config.yml +syntax_highlighter: prismjs +prismjs: + preprocess: true + line_number: true + line_threshold: 0 + tab_replace: "" ``` - to false before enabling prismjs. - Prismjs is disabled by default. You should set `highlight.enable` to `false` (below v7.0.0) or set `syntax_highlighter` to `prismjs` (v7.0.0+) before enabling prismjs. diff --git a/source/zh-tw/docs/tag-plugins.md b/source/zh-tw/docs/tag-plugins.md index 527e9546b4..c3b3fe94b4 100644 --- a/source/zh-tw/docs/tag-plugins.md +++ b/source/zh-tw/docs/tag-plugins.md @@ -6,7 +6,7 @@ Tag plugins are different from post tags. They are ported from Octopress and pro Although you can write your posts in any format, the tag plugins will always be available and syntax remains the same. -禁止 YouTube cookie +{% youtube I07XMi7MHd4 %} _標籤外掛不應該被包裝在 Markdown 語法當中,例如: `[]({% post_path lorem-ipsum %})` 是不支援的。_ @@ -41,7 +41,6 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque hendrerit ``` {% blockquote David Levithan, Wide Awake %} Do not just seek happiness for yourself. Seek happiness for all. Through kindness. Through mercy. -{% endblockquote %} Seek happiness for all. Through kindness. Through mercy. {% endblockquote %} ``` @@ -54,12 +53,11 @@ Do not just seek happiness for yourself. Seek happiness for all. Through kindnes ``` {% blockquote @DevDocs https://twitter.com/devdocs/status/356095192085962752 %} NEW: DevDocs now comes with syntax highlighting. http://devdocs.io -{% endblockquote %} http://devdocs.io {% endblockquote %} ``` {% blockquote @DevDocs https://twitter.com/devdocs/status/356095192085962752 %} -NEW: DevDocs now comes with syntax highlighting. http://devdocs.io http://devdocs.io +NEW: DevDocs now comes with syntax highlighting. http://devdocs.io {% endblockquote %} **引用網路上的文章** @@ -68,7 +66,6 @@ NEW: DevDocs now comes with syntax highlighting. http://devdocs.io http://devdoc {% blockquote Seth Godin http://sethgodin.typepad.com/seths_blog/2009/07/welcome-to-island-marketing.html Welcome to Island Marketing %} Every interaction is both precious and an opportunity to delight. {% endblockquote %} -{% endblockquote %} ``` {% blockquote Seth Godin http://sethgodin.typepad.com/seths_blog/2009/07/welcome-to-island-marketing.html Welcome to Island Marketing %} @@ -156,7 +153,7 @@ This is identical to using a code block, but instead uses three backticks to del {% raw %} ``[language] [title] [url] [link text] code snippet -`` +`` {% endraw %} ## Pull Quote @@ -222,7 +219,7 @@ To embed a Gist snippet: 插入 `source/downloads/code` 資料夾內的程式檔,資料夾取決於你在設定文件中 `code_dir` 的設定。 The folder location can be specified through the `code_dir` option in the config. ``` -{% include_code [title] [lang:language] path/to/file %} +{% include_code [title] [lang:language] [from:line] [to:line] path/to/file %} ``` ### 影片 @@ -301,7 +298,7 @@ YouTube's cookie is not used in this mode. Inserts a responsive or specified size Vimeo video. ``` -{% vimeo video_id %} +{% vimeo video_id [width] [height] %} ``` ## Include Posts @@ -394,7 +391,7 @@ _hexo-renderer-marked 3.1.0+ 可以(可選的)自動解析文章內的圖片 **Title & Alt** -`{% asset_img logo.svg "lorem ipsum'dolor'" %}` +`{% asset_img foo.jpg "lorem ipsum'dolor'" %}` ```html dolor @@ -414,7 +411,7 @@ _hexo-renderer-marked 3.1.0+ 可以(可選的)自動解析文章內的圖片 ```yml _config.yml -root: /blog/ # 範例 +root: /blog/ # example ``` ``` @@ -493,6 +490,4 @@ content Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - -Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ``` diff --git a/source/zh-tw/docs/themes.md b/source/zh-tw/docs/themes.md index f27b7d7074..302f1a8125 100644 --- a/source/zh-tw/docs/themes.md +++ b/source/zh-tw/docs/themes.md @@ -8,7 +8,6 @@ title: 主題 ```plain . -. ├── _config.yml ├── languages ├── layout @@ -53,9 +52,9 @@ When you have finished building your theme, you can publish it to the [theme lis 2. Clone the repository to your computer and install dependencies. ```shell - /site.git -$ cd site -$ npm install + $ git clone https://github.com//site.git + $ cd site + $ npm install ``` 3. 編輯 `source/_data/themes.yml`,在檔案中新增您的主題,例如: @@ -64,11 +63,14 @@ $ npm install ```yaml description: A brand new default theme for Hexo. - name: landscape -description: A brand new default theme for Hexo. -link: https://github.com/hexojs/hexo-theme-landscape -preview: http://hexo.io/hexo-theme-landscape -tags: - official - responsive - widget - two_column - one_column + link: https://github.com/hexojs/hexo-theme-landscape + preview: http://hexo.io/hexo-theme-landscape + tags: + - official + - responsive + - widget + - two_column + - one_column ``` 5. 在 `source/themes/screenshots` 新增同名的截圖檔案,圖片必須為 800x500 的 PNG 檔案。 It must be a 800\*500px PNG. diff --git a/source/zh-tw/docs/troubleshooting.md b/source/zh-tw/docs/troubleshooting.md index 23500ad800..cf9c246f68 100644 --- a/source/zh-tw/docs/troubleshooting.md +++ b/source/zh-tw/docs/troubleshooting.md @@ -90,6 +90,8 @@ Increase Node.js heap memory size by changing the first line of `hexo-cli` (`whi ### RPC failed ```plain +error: RPC failed; result=22, HTTP code = 403 + fatal: 'username.github.io' does not appear to be a git repository ``` @@ -278,7 +280,7 @@ YAMLException: Specified list of YAML types (or a single Type object) contains a This may be caused by an incorrect dependency(i.e. `js-yaml`) setting that can't be solved automatically by the package manager, and you may have to update it manually running: ```sh -npm ERR! node-waf configure build +$ npm install js-yaml@latest ``` or diff --git a/source/zh-tw/docs/variables.md b/source/zh-tw/docs/variables.md index 6b4ce739bb..dc984b1bd6 100644 --- a/source/zh-tw/docs/variables.md +++ b/source/zh-tw/docs/variables.md @@ -35,14 +35,14 @@ Lodash has been removed from global variables since Hexo 5.0.0. [You-Dont-Need-L | 變數 | 描述 | Type | | ------------------ | --------------------------------------------- | ------------------------ | -| `page.title` | 文章標題 | `tag` | +| `page.title` | 文章標題 | `string` | | `page.date` | Article created date | 文章建立日期([Moment.js][] 物件) | | `page.updated` | Article last updated date | 文章更新日期([Moment.js][] 物件) | | `page.comments` | Comment enabled or not | `boolean` | -| `page.layout` | Layout name | `category` | +| `page.layout` | Layout name | `string` | | `page.content` | 文章的完整網址 | `string` | | `page.excerpt` | 文章的原始內容 | `string` | -| `page.more` | 除了文章摘要的其餘內容 | `總頁數` | +| `page.more` | 除了文章摘要的其餘內容 | `string` | | `page.source` | The path of the source file | `string` | | `page.full_source` | Full path of the source file | `string` | | `page.path` | 文章網址(不含根路徑)。 我們通常在主題中使用 `url_for(page.path)`。 | `文章的完整內容` | @@ -51,50 +51,50 @@ Lodash has been removed from global variables since Hexo 5.0.0. [You-Dont-Need-L | `page.next` | 下一篇文章。 如果此為最後一篇文章則為 `null`。 | ??? | | `page.raw` | The raw data of the article | ??? | | `page.photos` | 文章的照片(用於相簿) | array of ??? | -| `page.link` | 文章的外連連結(用於連結文章) | `文章標籤` | +| `page.link` | 文章的外連連結(用於連結文章) | `string` | **彙整 (archive)**:與 `index` 佈局相同,但新增以下變數。 | 變數 | 描述 | Type | | ----------------- | ------------------------------- | -------------- | -| `每頁顯示的文章數量` | True if the post is not a draft | `boolean` | +| `page.published` | True if the post is not a draft | `boolean` | | `page.categories` | All categories of the post | `array` of ??? | | `page.tags` | All tags of the post | `array` of ??? | **首頁(index)** -| 變數 | 描述 | Type | -| ------------------ | ---------------------------------------------------------------------- | -------------- | -| `page.per_page` | Posts displayed per page | `number` | -| `page.total` | Total number of pages | `number` | -| `page.current` | 目前頁數 | `number` | -| `page.current_url` | 目前分頁的網址 | `#網站變數` | -| `page.posts` | Posts in this page ([Data Model](https://hexojs.github.io/warehouse/)) | `object` | -| `page.prev` | 上一頁的頁數。 如果此頁是第一頁的話則為 `0`。 | `number` | -| `page.prev_link` | 下一頁的網址。 如果此頁是最後一頁的話則為 `''`。 | `彙整月份(不含開頭的零)` | -| `page.next` | 下一頁的頁數。 如果此頁是最後一頁的話則為 `0`。 | `number` | -| `page.next_link` | 上一頁的連結。 如果此頁是第一頁的話則為 `''`。 | `全局變數` | -| `page.path` | 目前頁面的路徑(不含根目錄)。 我們通常在主題中使用 `url_for(page.path)`。 | `string` | +| 變數 | 描述 | Type | +| ------------------ | ---------------------------------------------------------------------- | -------- | +| `page.per_page` | Posts displayed per page | `number` | +| `page.total` | Total number of pages | `number` | +| `page.current` | 目前頁數 | `number` | +| `page.current_url` | 目前分頁的網址 | `string` | +| `page.posts` | Posts in this page ([Data Model](https://hexojs.github.io/warehouse/)) | `object` | +| `page.prev` | 上一頁的頁數。 如果此頁是第一頁的話則為 `0`。 | `number` | +| `page.prev_link` | 下一頁的網址。 如果此頁是最後一頁的話則為 `''`。 | `string` | +| `page.next` | 下一頁的頁數。 如果此頁是最後一頁的話則為 `0`。 | `number` | +| `page.next_link` | 上一頁的連結。 如果此頁是第一頁的話則為 `''`。 | `string` | +| `page.path` | 目前頁面的路徑(不含根目錄)。 我們通常在主題中使用 `url_for(page.path)`。 | `string` | **標籤 (tag)**:與 `index` 佈局相同,但新增以下變數。 -| 變數 | 描述 | Type | -| --------- | --------------------------------------------- | --------- | -| `archive` | 等於 `true` | `boolean` | -| `year` | 彙整年份(4 位數) | `number` | -| `month` | Archive month (2-digit without leading zeros) | `number` | +| 變數 | 描述 | Type | +| -------------- | --------------------------------------------- | --------- | +| `page.archive` | 等於 `true` | `boolean` | +| `page.year` | 彙整年份(4 位數) | `number` | +| `page.month` | Archive month (2-digit without leading zeros) | `number` | **分類 (category)**:與 `index` 佈局相同,但新增以下變數。 -| 變數 | 描述 | Type | -| ------ | ---- | -------- | -| `文章分類` | 分類名稱 | `文章原始路徑` | +| 變數 | 描述 | Type | +| --------------- | ---- | -------- | +| `page.category` | 分類名稱 | `string` | Lodash has been removed from global variables since Hexo 5.0.0. [You-Dont-Need-Lodash-Underscore](https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore) might be helpful for your migration. -| Variable | 文章摘要 | Type | -| -------- | ---- | ------ | -| `本頁文章` | 標籤名稱 | `佈局名稱` | +| Variable | 文章摘要 | Type | +| ---------- | ---- | -------- | +| `page.tag` | 標籤名稱 | `string` | [Moment.js]: http://momentjs.com/ [Site Variables]: #Site-Variables