我在 GitHub 上建立了一个网站:https://waynemroseberry.github.io/.
页面上的 RSS 提要(当我设置 Jekyll 时默认进入)显示网站上没有主机名的页面。
RSS 提要:https://waynemroseberry.github.io/feed.xml
例如,2024/04/05/Think-like-a-tester-and-go-beyond-the-code.html页面在提要中显示如下:
<entry>
<title type="html">Think Like A Tester And Go Beyond The Code</title>
<link href="/2024/04/05/Think-like-a-tester-and-go-beyond-the-code.html" rel="alternate" type="text/html" title="Think Like A Tester And Go Beyond The Code"/>
<published>2024-04-05T00:00:00+00:00</published>
<updated>2024-04-05T00:00:00+00:00</updated>
我正在尝试找出如何更改提要为我的页面提供的 URL,但我在任何地方都找不到它。
您的 _config.yml 文件既没有定义页面的 url,也没有定义基本 URL:
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
更新您的配置,添加:
url: "https://waynemroseberry.github.io"
或
在配置文件中定义
feed.path
。
实际原因:minima 主题包含 jekyll-feed 插件。主题页脚包含以下代码:
<a href="{{ site.feed.path | default: 'feed.xml' | absolute_url }}">
{{ site.feed.path }}
尝试从站点配置中获取提要文件的路径。如果 feed.path 被定义,它将使用这个值。如果未定义,| absolute_url
过滤器会将站点的基本 URL 附加到路径,将其转换为绝对 URL。