GitHub页面只显示自述文件?

时间:2018-02-22 03:31:45

标签: git github

我正在尝试将我的网页托管到Github页面中,但由于某种原因,它似乎只显示我的自述文件。

GitHub回购:https://github.com/InquisitiveDev2016/InquisitiveDev2016.github.io

网站:

https://inquisitivedev2016.github.io/

10 个答案:

答案 0 :(得分:5)

GitHub Pages正在做它的目的:托管整个存储库。存储库的根目录只包含一个文件(README.md)。还有其他页面,例如https://inquisitivedev2016.github.io/Photo%20Website/webpage.html,但没有一种简单的方法可以导航到它们。

考虑将您的网络内容移至存储库的根目录,并将默认网页重命名为index.mdindex.html,具体取决于文件类型。 (按照惯例,大多数网站的默认页面都称为index.html,这就是GitHub页面默认显示的内容(如果存在)。)

答案 1 :(得分:1)

在根目录中创建index.html并插入行

<meta http-equiv="Refresh" content="2; url=public/index.html">

或者说它对我遇到麻烦的Vue CLI项目有用。

答案 2 :(得分:1)

就我而言,我必须在 GitHub 上的 Pages 设置中选择分支 gh-pages/root

答案 3 :(得分:0)

Github为您提供了多种选择来源。默认情况下,它是master分支的根,如果没有README.md,它将使用index.html

但是您也可以在存储库设置中切换到docs/文件夹。这样,您可以将index.html放在docs/文件夹下。

请参见enter image description here

答案 4 :(得分:0)

解决此问题的最简单方法是将index.html文件与readme.md放在最外面的文件夹中

答案 5 :(得分:0)

请将HTML文件更改为 2020-10-07 12:53:51,782 [main ] ERROR [ / ] o.s.boot.SpringApplication - Application run failed java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:148) ~[spring-cloud-config-client-2.2.3.RELEASE.jar!/:2.2.3.RELEASE] at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:52) ~[spring-cloud-context-2.2.3.RELEASE.jar!/:2.2.3.RELEASE] at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locateCollection(ConfigServicePropertySourceLocator.java:163) ~[spring-cloud-config-client-2.2.3.RELEASE.jar!/:2.2.3.RELEASE] at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$FastClassBySpringCGLIB$$fa44b2a.invoke(<generated>) ~[spring-cloud-config-client-2.2.3.RELEASE.jar!/:2.2.3.RELEASE] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) ~[spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:91) ~[spring-retry-1.2.5.RELEASE.jar!/:na] at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:287) ~[spring-retry-1.2.5.RELEASE.jar!/:na] at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:164) ~[spring-retry-1.2.5.RELEASE.jar!/:na] at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:118) ~[spring-retry-1.2.5.RELEASE.jar!/:na] at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:153) ~[spring-retry-1.2.5.RELEASE.jar!/:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) ~[spring-aop-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$EnhancerBySpringCGLIB$$1f84d380.locateCollection(<generated>) ~[spring-cloud-config-client-2.2.3.RELEASE.jar!/:2.2.3.RELEASE] at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:98) ~[spring-cloud-context-2.2.3.RELEASE.jar!/:2.2.3.RELEASE] at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:626) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE] at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:370) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) ~[spring-boot-2.3.2.RELEASE.jar!/:2.3.2.RELEASE] at com.esure.api.paymentplanoptions.PaymentPlanOptionsApplication.main(PaymentPlanOptionsApplication.java:23) [classes!/:1.1.3-SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [app.jar:1.1.3-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:109) [app.jar:1.1.3-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [app.jar:1.1.3-SNAPSHOT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) [app.jar:1.1.3-SNAPSHOT] Caused by: org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Internal Server Error: [{"timestamp":"2020-10-07T12:53:51.771+0000","status":500,"error":"Internal Server Error","message":"Could not construct context for config=service-name profile=a,b,dev label= includeOrigin=true; nested exception is java.lang.NullPointerException","path":"/path-to-config/service-name/a,b,dev"}] at org.springframework.web.client.HttpServerErrorException.create(HttpServerErrorException.java:100) ~[spring-web-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:186) ~[spring-web-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:125) ~[spring-web-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) ~[spring-web-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:782) ~[spring-web-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:740) ~[spring-web-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:674) ~[spring-web-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:583) ~[spring-web-5.2.8.RELEASE.jar!/:5.2.8.RELEASE] at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:264) ~[spring-cloud-config-client-2.2.3.RELEASE.jar!/:2.2.3.RELEASE] at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:107) ~[spring-cloud-config-client-2.2.3.RELEASE.jar!/:2.2.3.RELEASE] ... 29 common frames omitted 。这个简单的事情使我奋力工作了6个小时才能找到它。 我之前的HTML名称是index.html;这仅显示自述文件。 更改为base.html后,文件打开没有任何问题。

答案 6 :(得分:0)

从最佳实践中解决此问题的步骤是转到您的项目文件夹。如上所述,您应该将自己的根目录或初始页的名称更改为index.html。然后在系统上的git bash中打开项目,执行常规的git步骤,例如,

  • git add
  • git commit -m " change to index.html"
  • git push origin master {取决于您命名的根分支}

然后进入设置,然后进入设置(哇) 一两次刷新后,您的网站就会上线

答案 7 :(得分:0)

对我来说,问题是 docs 文件夹被自动移动到 .gitignore。您必须从 .gitignore 中删除文档,提交并推送。

答案 8 :(得分:0)

如果你想访问 index.html, 试着写 https://githubdeloyaddress.com/index.html

所以只需在地址末尾添加'/index.html'! (这就是我解决我的案子的方式)

答案 9 :(得分:0)

总结一下,如果您的存储库没有 Index.html,它将显示自述文件。 因此,为了更正它,您需要做的就是将 index.html 或 index.md 文件添加到您的文件夹并将其用作主要文件。 从那里所有其他人都可以通过此页面上的链接访问。类似于网页。