我把我做的一个gatsby博客部署到github页面。第一页链接到一篇博客文章。点击链接时,没有任何显示。但如果我手动输入网址(与链接的网址相同),我看到页面半秒后就消失在空白页。
有用的信息
在看了你的GitHub代码后,我认为你这里有问题。(错误的URL。/blog/blog/why-gatsby
),还有你的主代码与gh-pages的代码不匹配(我知道这是从gatsby build生成的文件,但其他东西)。另外,为什么你要在index.js组件中创建一个静态查询?你可以用一个普通的页面查询来做。
你的gatsby网站从 https:/www.ragith.comblog 所以你才会出现这样的问题。当Gatsby查看页面时,只有。blog.js
里面的。
即
pagesblog.js
链接问题
<a class="article-card-link" href="/blog/blog/why-gatsby"><section><article><h2 class="article-title">Why Gatsby js ?</h2><p class="article-date">May 09, 2020</p><p class="article-excerpt">In a world with so many JavaScript frameworks such as React, Vue, heck even Next, why Gatsby? The short answer is, none of those frameworks are the target market of Gatsby. Gatsby is a static website generator. Great! Wait, who cares? Well a lot of my clients and so will yours…</p>READ MORE</article></section></a>