Hugo网站前事中的绝对URL _index.md文件
我遇到以下问题是雨果的新问题。我想将url
重定向到绝对URL,而不是相对URL
。这是我的意思。 在_index.md文件中,
# Display name
title: mohit kumar
url: ranveeriit.github.io/
假设基本URL为https://eample.com
。因此,Hugo将我重定向到https://example.com/ranveeriit.github.io/
我想让雨果重定向到ranveeriit.github.io/
单击Mohit Kumar
在https://chandu8542.github.io/
下与团队见面。我正在使用Hugo Wowchemy学术主题。
I'm stuck at the following issue being a new in Hugo. I want to redirect URL
to a absolute URL rather than relative url
. Here is what I means.
In _index.md file
# Display name
title: mohit kumar
url: ranveeriit.github.io/
Assume base URL is https://eample.com
. As such, hugo redirects me to https://example.com/ranveeriit.github.io/
what I want hugo to redirect to ranveeriit.github.io/
when I click the mohit kumar
under meet the team at https://chandu8542.github.io/
. I'm using hugo wowchemy academic theme.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须编辑主题的
/layouts/
文件才能为您的特定用例添加支持。它可以在
index.html
> list.html 或其他一些文件中,具体取决于您的主题如何拆分其代码。寻找
< a href =“”>
零件。它看起来更有可能看起来像< a href =“ {{.permalink}}”>
或< a href =“ {.relpermalink}}}”>
> 。将其更改为:
< a href =“ {{with .params.link}}}} {{。}} {{else}} {{else}} {{.permalink}}} {.permalink}}} { ;
。然后在您的
.md
文件中,添加链接
frontMatter param。它看起来应该与此相似:You have to edit your theme's
/layouts/
files to add support to your particular use-case.It may be in
index.html
orlist.html
or some other file, depending on how your theme split up their code.Look for the
<a href="">
part. It more likely looks like<a href="{{ .Permalink }}">
or<a href="{{ .RelPermalink}}">
.Change it to something like:
<a href="{{ with .Params.link }}{{ . }}{{ else }}{{ .Permalink }}{{ end }}">
.Then in your
.md
file, add thelink
frontmatter param. It should look similar to this: