本地版本上的 Jekyll 到 css/js 的链接已损坏

发布于 2024-11-24 06:07:15 字数 452 浏览 4 评论 0原文

我使用 Jekyll 来构建我的博客,这是 github 上的代码

当我使用命令 jekyll pygments 生成代码时,它会在_site 目录。

当我在浏览器中打开 _site/index.html 页面时,css/js 链接已损坏,因为它们看起来如下所示,

/css/style.css

要使其正常工作,链接不应以 /

我应该做什么来在本地测试该网站机器有 css/js 的工作链接吗?

谢谢

I use Jekyll to build my blog, here is the code on github

when I generate the code with the command jekyll pygments, it builds the site in the _site directory.

when I open the _site/index.html page in a browser, the css/js links are broken because they looks like the following

/css/style.css

to make it works the links should not begin with the /

what should I do to test the site on my local machine with working links to css/js?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽袖吟 2024-12-01 06:07:15

好的,我找到了解决方案:

使用其独立服务器运行 Jekyll

jekyll --auto --server

,然后在浏览器中访问

http://localhost:4000

ok i found the solution:

Running Jekyll with its standalone server

jekyll --auto --server

and then access in the browser at

http://localhost:4000
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文