소스 검색

update docs

ruki 4 년 전
부모
커밋
61817bd8dd
5개의 변경된 파일123개의 추가작업 그리고 75개의 파일을 삭제
  1. 9 0
      mirror/package/remote_package.html
  2. 9 0
      mirror/zh-cn/package/remote_package.html
  3. 15 0
      package/remote_package.md
  4. 75 75
      sitemap.xml
  5. 15 0
      zh-cn/package/remote_package.md

+ 9 - 0
mirror/package/remote_package.html

@@ -517,6 +517,15 @@ end
 </code></pre>
 <p>If it returns true, then the url and host are the proxy to go, not to return or return false, it is not to proxy.</p>
 <p>For specific details of this piece, see: <a href="https://github.com/xmake-io/xmake/issues/854">https://github.com/xmake-io/xmake/issues/854</a></p>
+<h4 id="mirroragent">Mirror Agent</h4>
+<p>After v2.5.4, mirroring proxy rules can also be configured in the pac.lua configuration. For example, access to all github.com domain names is switched to the hub.fastgit.org domain name to achieve accelerated downloading of packages.</p>
+<pre><code class="lang-lua">function mirror(url)
+      return url:gsub("github.com", "hub.fastgit.org")
+end
+</code></pre>
+<pre><code class="lang-console">$ xrepo install libpng
+> curl https://hub.fastgit.org/glennrp/libpng/archive/v1.6.37.zip -o v1.6.37.zip
+</code></pre>
 <h2 id="submitpackagestotheofficialrepository">Submit packages to the official repository</h2>
 <h3 id="packagestructureinrepository">Package structure in repository</h3>
 <p>Before making our own package, we need to understand the structure of the next package repository, whether it is the official package repository or the self-built private package repository, the structure is the same:</p>

+ 9 - 0
mirror/zh-cn/package/remote_package.html

@@ -537,6 +537,15 @@ end
 <p>如果返回true,那么这个url和host就是走的代理,不返回或者返回false,就是不走代理。</p>
 <p>这块的具体详情见:<a href="https://github.com/xmake-io/xmake/issues/854">https://github.com/xmake-io/xmake/issues/854</a></p>
 <p>!> 另外,除了依赖包下载,其他涉及网络下载的命令也都支持代理,比如:<code>xmake update</code></p>
+<h4 id="">镜像代理</h4>
+<p>v2.5.4 之后,pac.lua 配置里面还可以配置镜像代理规则,比如对所有 github.com 域名的访问切到 hub.fastgit.org 域名,实现加速下载包。</p>
+<pre><code class="lang-lua">function mirror(url)
+     return url:gsub("github.com", "hub.fastgit.org")
+end
+</code></pre>
+<pre><code class="lang-console">$ xrepo install libpng
+> curl https://hub.fastgit.org/glennrp/libpng/archive/v1.6.37.zip -o v1.6.37.zip
+</code></pre>
 <h2 id="">添加包到仓库</h2>
 <h3 id="">仓库包结构</h3>
 <p>在制作自己的包之前,我们需要先了解下一个包仓库的结构,不管是官方包仓库,还是自建私有包仓库,结构都是相同的:</p>

+ 15 - 0
package/remote_package.md

@@ -670,6 +670,21 @@ If it returns true, then the url and host are the proxy to go, not to return or
 
 For specific details of this piece, see: https://github.com/xmake-io/xmake/issues/854
 
+#### Mirror Agent
+
+After v2.5.4, mirroring proxy rules can also be configured in the pac.lua configuration. For example, access to all github.com domain names is switched to the hub.fastgit.org domain name to achieve accelerated downloading of packages.
+
+```lua
+function mirror(url)
+      return url:gsub("github.com", "hub.fastgit.org")
+end
+```
+
+```console
+$ xrepo install libpng
+> curl https://hub.fastgit.org/glennrp/libpng/archive/v1.6.37.zip -o v1.6.37.zip
+```
+
 ## Submit packages to the official repository
 
 ### Package structure in repository

+ 75 - 75
sitemap.xml

@@ -12,377 +12,377 @@
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2021-05-14T17:42:08+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/other_features.html</loc>
-  <lastmod>2021-05-14T17:42:09+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:41+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2021-05-14T17:42:09+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2021-05-14T17:42:09+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2021-05-14T17:42:09+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2021-05-14T17:42:09+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2021-05-14T17:42:09+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:42+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2021-05-14T17:42:10+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2021-05-14T17:42:10+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2021-05-14T17:42:10+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2021-05-14T17:42:10+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/technical_support.html</loc>
-  <lastmod>2021-05-14T17:42:11+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2021-05-14T17:42:11+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2021-05-14T17:42:11+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2021-05-14T17:42:11+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/who_is_using_xmake.html</loc>
-  <lastmod>2021-05-14T17:42:11+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2021-05-14T17:42:11+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2021-05-14T17:42:12+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2021-05-14T17:42:12+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/other_features.html</loc>
-  <lastmod>2021-05-14T17:42:12+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2021-05-14T17:42:12+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2021-05-14T17:42:12+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2021-05-14T17:42:13+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2021-05-14T17:42:13+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2021-05-14T17:42:13+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2021-05-14T17:42:13+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2021-05-14T17:42:13+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2021-05-14T17:42:13+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2021-05-14T17:42:14+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/technical_support.html</loc>
-  <lastmod>2021-05-14T17:42:14+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2021-05-14T17:42:14+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2021-05-14T17:42:14+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/peripheral_items.html</loc>
-  <lastmod>2021-05-14T17:42:14+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2021-05-14T17:42:15+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/who_is_using_xmake.html</loc>
-  <lastmod>2021-05-14T17:42:15+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2021-05-14T17:42:15+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/course.html</loc>
-  <lastmod>2021-05-14T17:42:15+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2021-05-14T17:42:15+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2021-05-14T17:42:16+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2021-05-14T17:42:16+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2021-05-14T17:42:16+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2021-05-14T17:42:16+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2021-05-14T17:42:16+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2021-05-14T17:42:17+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2021-05-14T17:42:17+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2021-05-14T17:42:17+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2021-05-14T17:42:17+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2021-05-14T17:42:17+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2021-05-14T17:42:17+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2021-05-14T17:42:18+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2021-05-14T17:42:18+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2021-05-14T17:42:18+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2021-05-14T17:42:18+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2021-05-14T17:42:18+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2021-05-14T17:42:19+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2021-05-14T17:42:19+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2021-05-14T17:42:19+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2021-05-14T17:42:19+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2021-05-14T17:42:19+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2021-05-14T17:42:20+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2021-05-14T17:42:20+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2021-05-14T17:42:20+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_interface.html</loc>
-  <lastmod>2021-05-14T17:42:20+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2021-05-14T17:42:21+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2021-05-14T17:42:21+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2021-05-14T17:42:21+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2021-05-14T17:42:21+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2021-05-14T17:42:21+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2021-05-14T17:42:22+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2021-05-14T17:42:22+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2021-05-14T17:42:22+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2021-05-14T17:42:22+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2021-05-14T17:42:22+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2021-05-14T17:42:22+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2021-05-14T17:42:23+08:00</lastmod>
+  <lastmod>2021-05-14T17:53:54+08:00</lastmod>
 </url>
 
 </urlset>

+ 15 - 0
zh-cn/package/remote_package.md

@@ -710,6 +710,21 @@ end
 
 !> 另外,除了依赖包下载,其他涉及网络下载的命令也都支持代理,比如:`xmake update`
 
+#### 镜像代理
+
+v2.5.4 之后,pac.lua 配置里面还可以配置镜像代理规则,比如对所有 github.com 域名的访问切到 hub.fastgit.org 域名,实现加速下载包。
+
+```lua
+function mirror(url)
+     return url:gsub("github.com", "hub.fastgit.org")
+end
+```
+
+```console
+$ xrepo install libpng
+> curl https://hub.fastgit.org/glennrp/libpng/archive/v1.6.37.zip -o v1.6.37.zip
+```
+
 ## 添加包到仓库
 
 ### 仓库包结构