xcode - 在没有 Apache Server/ (.htaccess) 的情况下运行 Xcode DocC
问题描述
在 DocC 文档“向外部开发人员分发文档”中,Apple 提供了在您的网站上托管文档存档的文档。不幸的是,当我打开时.doccarchive/index.html
,我只得到一个白页。他们只展示了 Apache 服务器的指南。他们指定了使用.htaccess
文件,并RewriteRule .* SlothCreator.doccarchive/$0 [L]
在用户访问文档页面时使用重写 URL。
有没有办法在不运行 Apache 服务器的情况下打开文档 Web 应用程序?(我不想做任何机器特定的配置,比如修改/etc/hosts
)。能够将其托管为静态站点(例如在 Github 页面、Cloudflare 页面、Netlify 等)上将是理想的
编辑:使用@Ranoiaetep 的答案,我已经构建并将其推送到GitHub存储库,并且可以通过 Netlify 站点查看:https ://xcode-docc.netlify.app/documentation/
解决方案
截至目前,我认为没有任何选项可以将其托管为静态站点。
但是,通过设置 .toml 文件在 Netlify 上托管它非常容易:
[build]
publish = "ProjectName.doccarchive/"
###### Change it to your doccarchive file's name
[[redirects]]
from = "/documentation/*"
status = 200
to = "/index.html"
[[redirects]]
from = "/tutorials/*"
status = 200
to = "/index.html"
[[redirects]]
from = "/data/documentation.json"
status = 200
to = "/data/documentation/projectname.json"
###### Change it to name in ProjectName.doccarchive/data/documentation/...
# often just all lowercase of your project name
[[redirects]]
force = true
from = "/"
status = 302
to = "/documentation/"
[[redirects]]
force = true
from = "/documentation"
status = 302
to = "/documentation/"
[[redirects]]
force = true
from = "/tutorials"
status = 302
to = "/tutorials/"
推荐阅读
- python - 从PDF文件中提取稀疏图?
- javascript - 如何将特定数组添加到数据库中的现有文档?
- javascript - Express-Postgres 无法应用数组过滤器:错误:运算符不存在:整数 [] && 文本 []
- python - AttributeError:“unicode”对象没有属性“strftime”
- javascript - 传递给网络工作者时,文件实例上的自定义属性未克隆
- python - tensorflow 2.3下的tensorflow-hub导入错误
- reactjs - 删除请求在邮递员中有效,但在我的代码中无效,显示 401.even 根据需要发送标头
- c++ - CRTP:使用派生类中的静态 constexpr
- angular-services - 如何从 FormGroup 获取数据并添加最旧的假数据
- pine-script - 松脚本止损从订单开始蜡烛(柱)中获取利润