
图 (Figure)
👁️ 预览
liquid
{% include figure.html image="images/group-photo.jpg" caption="团队在 2025 年年度圣诞派对上的合影" link="team" width="400px" %}
参数 | 描述 |
---|---|
image | 图的图片 URL。 |
caption | 标题内容。可以包含 Markdown。 |
link | 点击图片时导航到的 URL。 |
width / height | 图片的尺寸,单位为 px 或 % 。您应该只指定宽度或高度之一,以保持图片的原始宽高比。图片会缩小以适应较小的屏幕尺寸。 |
提示
images/fallback.svg
是一个图片,当(任何组件中的)图片加载失败时将显示该图片。这很有用,因为您可能经常链接到外部图片 URL,这些 URL 可能会在没有通知的情况下失效。
与 section 组件一起使用以制作全宽横幅的示例:
liquid
{% raw %}
{% include section.html size="full" %}
{% include figure.html image="images/banner.jpg" width="100%" %}
{% include section.html %}
{% endraw %}
继续的内容