Skip to content

Commit f7da50c

Browse files
authored
Unify image and video figure shortcodes (rust-gamedev#1553)
1 parent d407529 commit f7da50c

File tree

6 files changed

+56
-27
lines changed

6 files changed

+56
-27
lines changed

.github/newsletter-issue-template.md

+15-9
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ but here are the most important rules:
104104
- The image should come before the text, and must have alt text for accessibility.
105105
- Prefer static images to GIFs/videos, to keep the page load times down.
106106
- To include a video, encode it as `H.264` in an `mp4` container and use
107-
the `embed_video()` shortcode; videos autoplay in a loop (muted).
107+
the `video_figure()` shortcode; videos autoplay in a loop (muted).
108108
- Each section should be under 1000 characters, and under 6 paragraphs.
109109
- This only applies to the rendered text, not the markup.
110110
- Keep formatting minimal - no bold/italics/etc.
@@ -118,13 +118,16 @@ Please use these templates as a starting point:
118118
### [Game name]
119119

120120
{{ image_figure(
121-
alt="alt text"
122-
src="img"
123-
caption="optional image label") }}
121+
alt="image/GIF description",
122+
src="image link",
123+
caption="image caption") }}
124124

125125
OR
126126

127-
{{ embed_video(type="video/mp4", src="my-video.mp4", caption="optional video caption") }}
127+
{{ video_figure(
128+
type="video/mp4",
129+
src="my-video.mp4",
130+
caption="optional video caption") }}
128131

129132
[Game name] ([GitHub], [Discord], [Twitter]) by [@nickname]
130133
is... {short project description in one sentence}.
@@ -142,13 +145,16 @@ _Discussions: [/r/rust_gamedev](link), [Twitter](link), [etc](link)_
142145
### [Article name]
143146

144147
{{ image_figure(
145-
alt="alt text"
146-
src="img"
147-
caption="optional image label") }}
148+
alt="image/GIF description",
149+
src="image link",
150+
caption="image caption") }}
148151

149152
OR
150153

151-
{{ embed_video(type="video/mp4", src="my-video.mp4", caption="optional video caption") }}
154+
{{ video_figure(
155+
type="video/mp4",
156+
src="my-video.mp4",
157+
caption="optional video caption") }}
152158

153159
[@nickname] published an [article] about...
154160
{overview what the resource is about}.

.github/newsletter-template.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,16 @@ Ideal section structure is:
5151
### [Title]
5252
5353
{{ image_figure(
54-
alt="image/GIF description"
55-
src="image link"
54+
alt="image/GIF description",
55+
src="image link",
5656
caption="image caption") }}
5757
5858
OR
5959
60-
{{ embed_video(type="video/mp4", src="my-video.mp4", caption="optional video caption") }}
60+
{{ video_figure(
61+
type="video/mp4",
62+
src="my-video.mp4",
63+
caption="optional video caption") }}
6164
6265
A paragraph or two with a summary and [useful links].
6366

CONTRIBUTING.md

+18-8
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,16 @@ your GitHub notifications for any further review comments from the editors.
5757
### [Game name]
5858

5959
{{ image_figure(
60-
alt="alt text"
61-
src="img"
62-
caption="optional image label") }}
60+
alt="image/GIF description",
61+
src="image link",
62+
caption="image caption") }}
63+
64+
OR
65+
66+
{{ video_figure(
67+
type="video/mp4",
68+
src="my-video.mp4",
69+
caption="optional video caption") }}
6370

6471
[Game name] ([GitHub], [Discord], [Twitter]) by [@nickname]
6572
is... {short project description in one sentence}.
@@ -77,13 +84,16 @@ _Discussions: [/r/rust_gamedev](link), [Twitter](link), [etc](link)_
7784
### [Article name]
7885

7986
{{ image_figure(
80-
alt="alt text"
81-
src="img"
82-
caption="optional image label") }}
87+
alt="image/GIF description",
88+
src="image link",
89+
caption="image caption") }}
8390

8491
OR
8592

86-
{{ embed_video(type="video/mp4", src="my-video.mp4", caption="optional video caption") }}
93+
{{ video_figure(
94+
type="video/mp4",
95+
src="my-video.mp4",
96+
caption="optional video caption") }}
8797

8898
[@nickname] published an [article] about...
8999
{overview what the resource is about}.
@@ -113,7 +123,7 @@ _Discussions: [/r/rust_gamedev](link), [Twitter](link), [etc](link)_
113123
- Unless essential to demonstrating your project, prefer static images
114124
over GIFs/videos, to keep the file size down.
115125
- To include a video, encode it as `H.264` in an `mp4` container and use
116-
the `embed_video()` shortcode; videos autoplay in a loop (muted).
126+
the `video_figure()` shortcode; videos autoplay in a loop (muted).
117127
- Use singular 'they' if you’re not sure what someone's pronouns are.
118128
- If a project has been featured in previous newsletters, try to focus on
119129
what's new rather than repeating previous content.

content/news/052/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ We will switch this to an actual @gamedev.rs address in the future. Please tell
8282

8383
### [Untitled Pixel Wizards Game][pixel-wizards]
8484

85-
{{ embed_video(
85+
{{ video_figure(
8686
type="video/mp4",
8787
src="untitled-pixel-wizards-game.mp4",
8888
caption="Enemies now perceive, pursue, and attack... and occasionally get burned to death.") }}
@@ -337,7 +337,7 @@ You can get started by reading the [bevy_lunex book][bevy-lunex-book].
337337

338338
### [haalka]
339339

340-
{{ embed_video(type="video/mp4", src="haalka.mp4", caption="A Minecraft-like UI made with haalka") }}
340+
{{ video_figure(type="video/mp4", src="haalka.mp4", caption="A Minecraft-like UI made with haalka") }}
341341

342342
হালকা: _in bengali, haalka means "light" (e.g. not heavy) and can also be used to mean "easy"_
343343

content/news/053/index.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,17 @@ Ideal section structure is:
5151
### [Title]
5252
5353
{{ image_figure(
54-
alt="image/GIF description"
55-
src="image link"
54+
alt="image/GIF description",
55+
src="image link",
5656
caption="image caption") }}
5757
58+
OR
59+
60+
{{ video_figure(
61+
type="video/mp4",
62+
src="my-video.mp4",
63+
caption="optional video caption") }}
64+
5865
A paragraph or two with a summary and [useful links].
5966
6067
_Discussions:
@@ -77,8 +84,8 @@ If needed, a section can be split into subsections with a "------" delimiter.
7784
### [Chuột][chuot-website]
7885

7986
{{ image_figure(
80-
alt="Bunnymark example"
81-
src="chuot.png"
87+
alt="Bunnymark example",
88+
src="chuot.png",
8289
caption="[Bunnymark example](https://tversteeg.nl/chuot/examples/bunnymark/)") }}
8390

8491
Chuột ([Website][chuot-website], [GitHub][chuot-github]) by [@tversteeg]

templates/shortcodes/embed_video.html templates/shortcodes/video_figure.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{# <!--
22
Embed a video into a markdown file. Example usage:
33
4-
{{ embed_video(type="video/mp4", src="my-video.mp4", caption="Some caption.") }}
4+
{{ video_figure(
5+
type="video/mp4",
6+
src="my-video.mp4",
7+
caption="Some caption.") }}
58
69
--> #}
710
<figure>

0 commit comments

Comments
 (0)