Relative image paths for Twitter cards in blogdown

前端 未结 2 1512
旧巷少年郎
旧巷少年郎 2021-01-18 04:13

I\'m trying to set up a template for generating Twitter Cards in blogdown. It put the following in layouts/partials/twitter-card.html:



        
相关标签:
2条回答
  • 2021-01-18 05:00

    I recommend you to use an absolute URL in this case:

    image: "/post/foo/figure-html/some_image.png"
    

    Note you should remove the directory name static (Why?).

    0 讨论(0)
  • 2021-01-18 05:03

    Twitter cards do not support relative paths, and you have to use a fully-qualified HTTP(S) URL in the image tag. This is described in the troubleshooting post.

    0 讨论(0)
提交回复
热议问题