【发布时间】:2022-01-20 11:52:10
【问题描述】:
是否可以在 GitHub 自述文件中显示不同的 .svg 图像/内容,具体取决于用于在浏览器中查看自述文件的分支?
本质上,可以做这样的事情:
if current_path=main then:
display main.svg
elif current_path=other_branch then:
display other_branch.svg
end
在readme.md?
这样,如果访问:https://www.github.com/some_user/some_repo/tree/interactive,它会显示另一个 .svg 文件,而不是访问:https://www.github.com/some_user/some_repo/tree/non-interactive。 (如果将拉取请求从分支 interactive 合并到分支 non-interactive 中,则仍然不会产生合并冲突(也不会破坏在右侧分支中显示正确图像的选项)。
【问题讨论】: