Mar*_*Lau 5 dns redirect github subdirectory github-pages
我这里有一个 github 项目页面:lwymarie.github.io/QPQ_Web/Quasars_Probing_Quasars/Welcome.html
该项目名为 QPQ_Web。其中有一个 index.html 文件,它指向子目录 Quasars_Probing_Quasars 中的 Welcome.html 文件,所有其他 html 文件也存储在其中。
我想用 www.qpqsurvey.org 替换 URL 的整个 lwymarie.github.io/QPQ_Web/Quasars_Probing_Quasars/ 部分。即我想跳过 URL 中的 Quasars_Probing_Quasars 子目录。请参阅当前的 www.qpqsurvey.org 站点以了解我的意思。
是否可以为此目的设置永久链接而不重组我的文件?谢谢。
它似乎与这个问题相关:Set subdirectory as website root on Github Pages
\n\n(1) 按照以下说明将您的子目录设为 GitHub 根目录,然后 (2)按照 GitHub 的自定义域说明将http://www.qpqsurvey.org重定向到 gh-pages: https:// /help.github.com/articles/using-a-custom-domain-with-github-pages/
\n\n复制 @CodeWizard 的答案,该答案又从https://gist.github.com/cobyism/4730490引用作为我答案的前半部分:
\n\n有时您希望分支上的子目录master成为存储库\xe2\x80\x99s 分支的根目录gh-pages。这对于使用Yeoman开发的站点等非常有用,或者如果您的分支中包含 Jekyll 站点master以及其余代码。
在本示例中,让\xe2\x80\x99s 假设包含您网站的子文件夹名为dist。
dist从project\xe2\x80\x99s文件中删除目录.gitignore(Yeoman 默认忽略它\xe2\x80\x99s)。
确保 git 了解您的子树(您网站的子文件夹)。
\n\ngit add dist && git commit -m "Initial dist subtree commit"\nRun Code Online (Sandbox Code Playgroud)\n\n使用子树推送将其发送到gh-pagesGitHub上的分支。
git subtree push --prefix dist origin gh-pages\nRun Code Online (Sandbox Code Playgroud)\n\n繁荣。如果您的文件夹名为 \xe2\x80\x99t dist,那么您\xe2\x80\x99 将需要在上面的每个命令中更改它。
如果您定期执行此操作,您还可以在路径中的某个位置创建一个包含以下内容的脚本:
\n\n#!/bin/sh\nif [ -z "$1" ]\nthen\n echo "Which folder do you want to deploy to GitHub Pages?"\n exit 1\nfi\ngit subtree push --prefix $1 origin gh-pages\nRun Code Online (Sandbox Code Playgroud)\n\n它可以让你输入如下命令:
\n\ngit gh-deploy path/to/your/site\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
1342 次 |
| 最近记录: |