@4awpawz/trio 中文文档教程

发布于 3年前 浏览 27 项目主页 更新于 3年前

Trio

快速、简单但功能强大的 JavaScript 驱动的静态站点生成。

Documentation

v6

https://gettriossg.com/docs/v6

Prior Versions

请注意,不再支持早期版本。

Changelog

请注意,从 v4.0.0 开始,更新日志条目现在仅列出主要亮点。

v6.1.0

请参阅 https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.1.0+is%3Aclosed。

Highlights!

Issue #137: Refactor Trio to use BrowserSync's watcher to watch for changes to the public build folder and to respond to "change" events by reloading the browser.
Issue #138: Auto increment the port number that BrowserSync uses since BrowserSync no longer does so when the default port number (3000) is being used.

v6.0.4

请参阅 https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.0.4+is%3Aclosed。

Highlights!

Issue #134: Module lib/generator/sassRender.js must call toString() when writing the postcssResult.map to a file.
Issue #135: Upgrade Node to v14 LTS and upgrade Trio's dependencies.
Issue #136: A circular dependency discovered in lib/utils/getFileModifiedTime.js after upgrading Node to v14 LTs and Trio's dependencies.

v6.0.3

请参阅 https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.0.3+is%3Aclosed。

Highlights!

Issue #133: File watcher not refreshing the browser when ignored file has been added, changed, and deleted.

v6.0.2

请参阅 https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.0.2+is%3Aclosed。

Highlights!

Issue #131: lib/generator/copyOtherFiles isn't checking if the source folders exist before copying files to the destination folders.

v6.0.1

请参阅 https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.0.1+is%3Aclosed。

Highlights!

Issue #127: File watcher (chokidar) should be configured to ignore user defined folders to prevent polluting metadata and unnecessary development builds.
Issue #128: lib/generator/getAssets should be configured to ignore user defined folders to prevent polluting metadata.
Issue #129: Add "ignore" property to user configuration.

v6.0.0

请参阅 https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.0.0+is%3Aclosed。

Highlights!

Issue #124: Remove cache busting from the release CLI command and create its own CLI command cachebust.
Issue #123: Add configuration options for css source map generation.

v5.0.0

详情请参阅 https://github.com/4awpawz/trio/milestone/25?closed=1。

Highlights!

Issue #120: Replace Node Sass with Dart Sass.
Issue #121: Update all packages and address vulnerabilities.

v4.3.1

详情请参阅 https://github.com/4awpawz/trio/milestone/24?closed=1。

Highlights!

Issue #119: Treat all fragment file names preceded with an underscore "_" as a work in progress.

v4.3.0

详情请参阅 https://github.com/4awpawz/trio/milestone/23?closed=1。

Highlights!

Issue #116: The fragment front matter title property now defaults to Document.
Issue #117: Trio now does a one-off build whenever a file is added to the project and building incrementally.

v4.2.0

详情请见 https://github.com/4awpawz/trio/issues?q=milestone%3Av4.2.0。

Highlights!

Issue #112: Trio now ignores and reports fragments that do not have front matter defined.

v4.1.0

详情请见 https://github.com/4awpawz/trio/issues?q=milestone%3Av4.1.0。

Highlights!

Issue #111: Trio now supports callbacks declared on tags that are replaced by include and fragment content.

v4.0.0

详情请见 https://github.com/4awpawz/trio/issues?q=milestone%3Av4.0.0。

Highlights!

Issue #103: Trio now assigns meaningful default values for all the properties in site metadata and trio.manifest.json.
Issue #106: Trio projects now include a source/lib folder for modules that are required by tag-based callback modules and collection filter modules.
Issue #107: Trio's generated projects now include the empty folders that in previous versions were missing because Git doesn't track empty folders.
Issue: #109: Trio no longer includes the ESLint configuration package @4awpawz/eslint-config-4awpawzconfig in scaffold projects.

v3.1.0

Highlights!

  • New! Preserved include and fragment target tags.
  • New! Auto detection of new version.

More Information

有关此版本的更多信息,请阅读 Trio v3.1.0:改进的开发人员体验

v3.0.0

Highlights!

  • New! Permalinks.
  • New! You now have total control as to how you structure your blogs.
  • New! Incremental Build Now Watches trio.json For Changes.
  • New! Enhanced Collection Dataset Validation.

Other Changes

  • Improved Consistent Formating For Error And Warning Messages.

Major Bug Fixes

  • 修复了#98,它阻止您在命令行中从新的项目的目标文件夹。

  • 修复了 #94,当您重命名片段时,这会导致带有 watch 的增量构建中断。 现在,当您重命名片段时,Trio 将运行一次性构建以确保其缓存准确地代表项目的当前状态。

  • 修复了 #93,如果他们没有在前言中声明类别,有时会阻止生成文章。

Upgrading From v2 to v3

每当您升级到 Trio 的新版本时,您应该始终运行一次性构建以确保 Trio 的缓存更新到其当前预期:

$ trio build | b

More Information

有关此版本的更多信息,请阅读 Trio v3.0.0:永久链接和其他好东西

v2.0.0

Highlights!

  • Collections!
  • Enhancements To The CLI

Other Changes

  • Trio 不再将“-map”附加到输出 css 映射文件名。 这是 Buster 仍在将其哈希附加到文件名时遗留下来的问题,现在它不再这样做,因为它现在在文件名前加上哈希。

  • trio.manifest.json 文件不再压缩。

  • 您不再需要在片段的 front matter 模板属性中包含 .html 文件扩展名。

Changes To gettriossg.com

有一个新的主页,它更简洁地表达了 Trio 的全部内容,并且对文档进行了大量更正和增强,使其更准确、更易于阅读。

Bug Fixes

  • 已修复 #88 - Markdown 片段中的摘录未转换为 HTML。

  • 修复了 #87 - 未正确生成 css 源映射。

Upgrading From v1 to v2

v2.0.0 的缓存架构已更改,并且与之前的版本不兼容。 因此,如果您要将项目从 v1 升级到 v2,则必须重新生成项目的缓存,这可以通过在终端中运行以下构建命令来完成:

$ trio build | b

v1.1.1 (IKIGAI)

Bug Fixes

  • Addresses issue #84, where stats for JSON data files and modules indicate they have dependencies to callbacks even when those callbacks no longer declare them as internal dependencies.

v1.1.0 (IKIGAI)

Highlights!

  • Trio now provides more information when it is unable to resolve assets. See issue #83 for more information.

Bug Fixes

  • Addresses issue #82, where integrity checking and dependency resolution failed to account for templates having indirect references to includes, which caused builds to fail during page generation because of missing include files.

v1.0.0 (IKIGAI)

这标志着 v1.0.0 的第一个稳定版本。 我很兴奋,希望你们也一样。

Highlights!

  • Project scaffolding (issue #80) is now supported as an option (i.e. -s | --scaffold) when creating a new project from the command line (e.g. $ trio new -s path/to/new/project).

v1.0.0-rc.6 (IKIGAI)

Highlights!

  • Addresses issue #79 which formalizes blog archive pages into the project just like blog tag and blog category pages are.

Bug Fixes

  • Addresses issue #81 which would cause destination paths for blog subsidiary pages and archive pages to be generated incorrectly.

v1.0.0-rc.5 (IKIGAI)

Highlights!

  • For callbacks that throw exceptions, Trio would catch the exceptions and print just their message to the console, leaving it up to the user to determine which module actually threw the exception. Now, when callbacks throw exceptions, Trio will also print their module names along with their messages to the console.

Bug Fixes

  • 重大更改 - 片段属性 destPath(生成页面的目标文件路径)和 url(生成页面的 URL)现在以全小写形式生成。

  • 重大变化 - Trio 不再为片段生成唯一的 id 属性,因为在增量构建期间维护其完整性所需的开发时间方面的费用。 取而代之的是,用户现在应该使用片段的 url 属性,该属性本质上始终是唯一的。

  • 重大更改 - 回调参数 $ 已重命名为 $page 以保持清晰和一致。

v1.0.0-rc.4 (IKIGAI)

Bug Fixes

  • Addresses issue #74 which would cause garbage collection to fail to identify the original blog article to delete when the user changes the blog article's category.

v1.0.0-rc.3 (IKIGAI)

Bug Fixes

  • Addresses issue #73 which would cause dependency resolution to fail if tag-based callbacks are declared with their .js file extensions.

v1.0.0-rc.2 (IKIGAI)

Bug Fixes

  • Addresses issue #72 which would cause include assets with .html file extension to be wrongly interpreted as markdown files.

v1.0.0-rc.1 (IKIGAI)

这标志着 Trio v1 的第一个候选版本。 从作为概念可靠证明的 v0.0.6 到现在,这段旅程是漫长的,有时甚至是艰难的,但最后我可以真正地说,这是一种爱的劳动。 我希望你们都喜欢它。

Highlights!

  • 完整性检查会检查项目的依赖链,并在无法解析资产时通知您。

  • 增量构建通过将处理限制为仅陈旧资产来减少项目构建时间。

  • 基于标签的 JavaScript 回调取代了其他静态站点生成器需要您使用的模板引擎和框架来扩展您的组合。

v0.0.6

Bug Fixes

  • Addresses issue #59 which would cause etc folder processing to ignore dot files.

v0.0.5

Bug Fixes

  • Addresses issue #58 which would raise an exception when generating the public destination paths for category pages.

v0.0.4

Bug Fixes

  • Addresses issue #57 which adds the source/etc folder to generated projects and whose files are copied as is to the root of the public folder for both dev and release builds. This folder is intended to be used for files like favicon.ico, robots.txt, sitemaps, .nojekyll, .etc which need to reside in the public folder.

v0.0.3

Bug Fixes

  • Addresses issue #56 which adds a new configuration option, "nojekyll", which when set to true instructs Trio to write a .nojekyll file to the public folder when generating a release build to completely bypass Jekyll processing on GitHub Pages.

v0.0.2

Bug Fixes

  • 解决了 #55 问题,该问题会导致为具有嵌套类别的博客文章生成不准确的公共路径。

  • 解决了 #54 问题,该问题会导致为具有复杂名称的博客文章生成不准确的公共路径。

Copyright And License

Jeffrey Schwartz 版权所有

代码和文档版权所有 © 2018-2021 文档 CC 3.0

Trio

Fast, simple yet powerful JavaScript-driven static site generation.

Documentation

v6

https://gettriossg.com/docs/v6

Prior Versions

Please note that earlier versions are no longer supported.

Changelog

Please note that beginning with v4.0.0 changelog entries now only list major highlights.

v6.1.0

Please see https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.1.0+is%3Aclosed.

Highlights!

Issue #137: Refactor Trio to use BrowserSync's watcher to watch for changes to the public build folder and to respond to "change" events by reloading the browser.
Issue #138: Auto increment the port number that BrowserSync uses since BrowserSync no longer does so when the default port number (3000) is being used.

v6.0.4

Please see https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.0.4+is%3Aclosed.

Highlights!

Issue #134: Module lib/generator/sassRender.js must call toString() when writing the postcssResult.map to a file.
Issue #135: Upgrade Node to v14 LTS and upgrade Trio's dependencies.
Issue #136: A circular dependency discovered in lib/utils/getFileModifiedTime.js after upgrading Node to v14 LTs and Trio's dependencies.

v6.0.3

Please see https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.0.3+is%3Aclosed.

Highlights!

Issue #133: File watcher not refreshing the browser when ignored file has been added, changed, and deleted.

v6.0.2

Please see https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.0.2+is%3Aclosed.

Highlights!

Issue #131: lib/generator/copyOtherFiles isn't checking if the source folders exist before copying files to the destination folders.

v6.0.1

Please see https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.0.1+is%3Aclosed.

Highlights!

Issue #127: File watcher (chokidar) should be configured to ignore user defined folders to prevent polluting metadata and unnecessary development builds.
Issue #128: lib/generator/getAssets should be configured to ignore user defined folders to prevent polluting metadata.
Issue #129: Add "ignore" property to user configuration.

v6.0.0

Please see https://github.com/4awpawz/trio/issues?q=is%3Aissue+milestone%3Av6.0.0+is%3Aclosed.

Highlights!

Issue #124: Remove cache busting from the release CLI command and create its own CLI command cachebust.
Issue #123: Add configuration options for css source map generation.

v5.0.0

Please see https://github.com/4awpawz/trio/milestone/25?closed=1 for details.

Highlights!

Issue #120: Replace Node Sass with Dart Sass.
Issue #121: Update all packages and address vulnerabilities.

v4.3.1

Please see https://github.com/4awpawz/trio/milestone/24?closed=1 for details.

Highlights!

Issue #119: Treat all fragment file names preceded with an underscore "_" as a work in progress.

v4.3.0

Please see https://github.com/4awpawz/trio/milestone/23?closed=1 for details.

Highlights!

Issue #116: The fragment front matter title property now defaults to Document.
Issue #117: Trio now does a one-off build whenever a file is added to the project and building incrementally.

v4.2.0

Please see https://github.com/4awpawz/trio/issues?q=milestone%3Av4.2.0 for details.

Highlights!

Issue #112: Trio now ignores and reports fragments that do not have front matter defined.

v4.1.0

Please see https://github.com/4awpawz/trio/issues?q=milestone%3Av4.1.0 for details.

Highlights!

Issue #111: Trio now supports callbacks declared on tags that are replaced by include and fragment content.

v4.0.0

Please see https://github.com/4awpawz/trio/issues?q=milestone%3Av4.0.0 for details.

Highlights!

Issue #103: Trio now assigns meaningful default values for all the properties in site metadata and trio.manifest.json.
Issue #106: Trio projects now include a source/lib folder for modules that are required by tag-based callback modules and collection filter modules.
Issue #107: Trio's generated projects now include the empty folders that in previous versions were missing because Git doesn't track empty folders.
Issue: #109: Trio no longer includes the ESLint configuration package @4awpawz/eslint-config-4awpawzconfig in scaffold projects.

v3.1.0

Highlights!

  • New! Preserved include and fragment target tags.
  • New! Auto detection of new version.

More Information

For more information regarding this release, please read Trio v3.1.0: Improved Developer Experience

v3.0.0

Highlights!

  • New! Permalinks.
  • New! You now have total control as to how you structure your blogs.
  • New! Incremental Build Now Watches trio.json For Changes.
  • New! Enhanced Collection Dataset Validation.

Other Changes

  • Improved Consistent Formating For Error And Warning Messages.

Major Bug Fixes

  • Fixed #98 that prevented you from creating a new project at the command line from within the new project's target folder.

  • Fixed #94 that would cause incremental build with watch to break when you would rename a fragment. Now, when you rename a fragment, Trio will run a one-off build to insure that its cache accurately represents the current state of your project.

  • Fixed #93 that would sometimes prevent articles from being generated if they didn't declare a category in their front matter.

Upgrading From v2 to v3

Whenever you upgrade to a new version of Trio, you should always run a one-off build to insure that Trio's cache is updated to its current expectations:

$ trio build | b

More Information

For more information regarding this release, please read Trio v3.0.0: Permalinkns And Other Goodies

v2.0.0

Highlights!

  • Collections!
  • Enhancements To The CLI

Other Changes

  • Trio no longer appends "-map" to the output css map file name. This was cruft left over from when Buster was still appending its hash to file names, which it no longer does as it now prepends the file name with the hash.

  • The trio.manifest.json file is no longer compressed.

  • You are no longer required to include the .html file extension in the fragment's front matter template property.

Changes To gettriossg.com

There's a new home page, which more succinctly expresses what Trio is all about, and the documentation has received numerous corrections, and enhancements to make it more accurate and easier to read.

Bug Fixes

  • Fixed #88 - excerpts in markdown fragments aren't being converted to HTML.

  • Fixed #87 - css source maps are being generated incorrectly.

Upgrading From v1 to v2

The schema for the cache has changed for v2.0.0, and is incompatible with prior versions. Therefore, if you are upgrading your projects from v1 to v2, you will have to regenerate your project's cache, which you can do by running the following build command in the terminal:

$ trio build | b

v1.1.1 (IKIGAI)

Bug Fixes

  • Addresses issue #84, where stats for JSON data files and modules indicate they have dependencies to callbacks even when those callbacks no longer declare them as internal dependencies.

v1.1.0 (IKIGAI)

Highlights!

  • Trio now provides more information when it is unable to resolve assets. See issue #83 for more information.

Bug Fixes

  • Addresses issue #82, where integrity checking and dependency resolution failed to account for templates having indirect references to includes, which caused builds to fail during page generation because of missing include files.

v1.0.0 (IKIGAI)

This marks the first stable release of v1.0.0. I'm so excited and I hope you all are too.

Highlights!

  • Project scaffolding (issue #80) is now supported as an option (i.e. -s | --scaffold) when creating a new project from the command line (e.g. $ trio new -s path/to/new/project).

v1.0.0-rc.6 (IKIGAI)

Highlights!

  • Addresses issue #79 which formalizes blog archive pages into the project just like blog tag and blog category pages are.

Bug Fixes

  • Addresses issue #81 which would cause destination paths for blog subsidiary pages and archive pages to be generated incorrectly.

v1.0.0-rc.5 (IKIGAI)

Highlights!

  • For callbacks that throw exceptions, Trio would catch the exceptions and print just their message to the console, leaving it up to the user to determine which module actually threw the exception. Now, when callbacks throw exceptions, Trio will also print their module names along with their messages to the console.

Bug Fixes

  • Breaking Change - Fragment properties destPath (the generated page's target file path) and url (the generated page's URL) are now generated in all lowercase.

  • Breaking Change - Trio no longer generates a unique id property for fragments due to the expense in terms of the development time required to maintain their integrity during incremental builds. In its place, users should now use the fragment's url property, which is intrinsically always unique.

  • Breaking Change - Callback argument $ has been renamed to $page for clarity and consistency.

v1.0.0-rc.4 (IKIGAI)

Bug Fixes

  • Addresses issue #74 which would cause garbage collection to fail to identify the original blog article to delete when the user changes the blog article's category.

v1.0.0-rc.3 (IKIGAI)

Bug Fixes

  • Addresses issue #73 which would cause dependency resolution to fail if tag-based callbacks are declared with their .js file extensions.

v1.0.0-rc.2 (IKIGAI)

Bug Fixes

  • Addresses issue #72 which would cause include assets with .html file extension to be wrongly interpreted as markdown files.

v1.0.0-rc.1 (IKIGAI)

This marks the first release candidate for Trio v1. The journey from v0.0.6, which served as a solid proof of concept, to now, has been a long and sometimes difficult one, but in the end I can truly say that it has been a labor of love. I hope you all enjoy it.

Highlights!

  • Integrity Checking checks your project's chains of dependencies and notifies you when assets can't be resolved.

  • Incremental Build reduces project build times by limiting processing to only stale assets.

  • Tag-Based JavaScript Callbacks replace the template engines and frameworks that other static site generators require you to use to extend your composites.

v0.0.6

Bug Fixes

  • Addresses issue #59 which would cause etc folder processing to ignore dot files.

v0.0.5

Bug Fixes

  • Addresses issue #58 which would raise an exception when generating the public destination paths for category pages.

v0.0.4

Bug Fixes

  • Addresses issue #57 which adds the source/etc folder to generated projects and whose files are copied as is to the root of the public folder for both dev and release builds. This folder is intended to be used for files like favicon.ico, robots.txt, sitemaps, .nojekyll, .etc which need to reside in the public folder.

v0.0.3

Bug Fixes

  • Addresses issue #56 which adds a new configuration option, "nojekyll", which when set to true instructs Trio to write a .nojekyll file to the public folder when generating a release build to completely bypass Jekyll processing on GitHub Pages.

v0.0.2

Bug Fixes

  • Addresses issue #55 which would cause the generation of inaccurate public paths for blog articles that have nested categories.

  • Addresses issue #54 which would cause the generation of inaccurate public paths for blog articles that have complex names.

Copyright And License

Code and documentation Copyright ©2018-2021 Jeffrey Schwartz All Rights Reserved

Code licensed MIT, docs CC By 3.0.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文