Blogdown serve_site() removes absolute image paths for Twitter cards

旧城冷巷雨未停 提交于 2021-01-29 14:38:39

问题


Based on this question, it's clear that Twitter requires absolute paths for card images. With that in mind, I've set baseurl = "https://strimas.com/" in my config.toml file for the Hugo Academic theme. When I build the entire site with build_site(), everything works as desired, the twitter:image metatag contains the full path to the image, and the card renders properly. However, when I use serve_site() to only re-build changed posts, it breaks everything, the image URLs go back to relative, and the Twitter cards don't work anymore. Is there a way to call serve_site() and have it retain the absolute paths?

It's not clear to me how to make a reprex for a blogdown example, but here's my site that's having the problem: https://github.com/mstrimas/website

System info:

blogdown v0.18.1
Hugo v0.67.1
Hugo Academic theme v4.9

来源:https://stackoverflow.com/questions/60807293/blogdown-serve-site-removes-absolute-image-paths-for-twitter-cards

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!