部署项目(index.html)不是根文件夹的Git Hub Pages项目 [英] Deploying Git Hub Pages project where project (index.html) is not root folder

查看:99
本文介绍了部署项目(index.html)不是根文件夹的Git Hub Pages项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个github存储库,我使用gruntjs来构建我的静态站点.这会将所有文件构建到dist文件夹(即不在根目录中的文件夹)中.因此index.html文件及其所有内容都在/dist文件夹中

I have a github repository which I use gruntjs to build my static site. This builds all the files to a dist folder (that is a folder not in the root). So the index.html file and all the contents is in /dist folder

当前,我将dist文件夹的内容复制到另一个github存储库中(因此内容位于根目录中),因此我可以将其作为github页面推出,由于手动易发错误,这显然很糟糕.

Currently I copy the content of dist folder to another github repository ( so contents is in root) so I can push out as a github page which is obviously bad due to manual prone errors.

理想情况下,我只想将包含dist文件夹的项目推送到gh-pages,并以某种方式告诉github从dist文件夹读取,然后从root读取.这可能吗,我该如何运作.

Ideally I would just like to push my project containing the dist folder to gh-pages and somehow tell github to read from dist folder rather then root. Is this possible and how can I make it work.

推荐答案

我不熟悉GH页面的工作方式,但是我怀疑您可以将dist文件夹设置为git存储库(而不是父目录),这样您就可以直接进行推送了.

I'm not familiar with how GH pages work, but I suspect you could make the dist folder your git repository (and not the parent dir), that would allow you to push directly.

这篇关于部署项目(index.html)不是根文件夹的Git Hub Pages项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆