Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: open external links in a new window #346

Merged
merged 2 commits into from
Jan 4, 2025

Conversation

hst1189
Copy link
Contributor

@hst1189 hst1189 commented Dec 30, 2024

感谢作者提供的 Hugo Theme Dream

在利用模板制作网站的过程中,遇到了跳转问题
为了实现站外跳转,本PR 对跳转问题做了修改
markdown存在默认情况下, 存在无法跳转新页面的缺陷
添加一个render-link.html,实现 同域名时自页面跳转,不同域名时新页面跳转的功能

試作品:https://myfont.us.kg/

Copy link

netlify bot commented Dec 30, 2024

Deploy Preview for hugo-theme-dream-docs-preview canceled.

Name Link
🔨 Latest commit 32ff465
🔍 Latest deploy log https://app.netlify.com/sites/hugo-theme-dream-docs-preview/deploys/677650ab167d210008d0de98

@g1eny0ung
Copy link
Owner

Hi, @hst1189, thanks for reporting this problem. I agree with your solution, but I also update some of the code to detect absolute URLs using urls.Parse because I often see this method in Hugo's documentation.

If you agree with these changes, I'll merge this PR after you reply.

BTW, I saw that your site content is mainly in Japanese, so I decided to reply you in English 😃, and your site background is very beautiful 👍🏼.

@g1eny0ung g1eny0ung changed the title add render link feat: open external links in a new window Jan 2, 2025
@hst1189
Copy link
Contributor Author

hst1189 commented Jan 4, 2025

@g1eny0ung
谢谢你的回复 ,如果不需要花很多时间,能把urls.Parse加入其中的话,也是一种非常好的解决方案
为了能实现 瀑布型页面的模板, 我收藏了 Hugo Theme Dream , 再次非常感谢
喜欢动漫,我的小站就设计成2次元风格了, 谢谢你的点赞

@g1eny0ung
Copy link
Owner

好的,那我就合并这个PR了。感谢使用~

@g1eny0ung g1eny0ung merged commit 27daac3 into g1eny0ung:master Jan 4, 2025
4 checks passed
@g1eny0ung g1eny0ung linked an issue Jan 4, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

站外跳转问题
2 participants