Skip to content

Commit

Permalink
Unify image and video figure shortcodes (#1553)
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Jul 7, 2024
1 parent d407529 commit f7da50c
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 27 deletions.
24 changes: 15 additions & 9 deletions .github/newsletter-issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ but here are the most important rules:
- The image should come before the text, and must have alt text for accessibility.
- Prefer static images to GIFs/videos, to keep the page load times down.
- To include a video, encode it as `H.264` in an `mp4` container and use
the `embed_video()` shortcode; videos autoplay in a loop (muted).
the `video_figure()` shortcode; videos autoplay in a loop (muted).
- Each section should be under 1000 characters, and under 6 paragraphs.
- This only applies to the rendered text, not the markup.
- Keep formatting minimal - no bold/italics/etc.
Expand All @@ -118,13 +118,16 @@ Please use these templates as a starting point:
### [Game name]

{{ image_figure(
alt="alt text"
src="img"
caption="optional image label") }}
alt="image/GIF description",
src="image link",
caption="image caption") }}

OR

{{ embed_video(type="video/mp4", src="my-video.mp4", caption="optional video caption") }}
{{ video_figure(
type="video/mp4",
src="my-video.mp4",
caption="optional video caption") }}

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

{{ image_figure(
alt="alt text"
src="img"
caption="optional image label") }}
alt="image/GIF description",
src="image link",
caption="image caption") }}

OR

{{ embed_video(type="video/mp4", src="my-video.mp4", caption="optional video caption") }}
{{ video_figure(
type="video/mp4",
src="my-video.mp4",
caption="optional video caption") }}

[@nickname] published an [article] about...
{overview what the resource is about}.
Expand Down
9 changes: 6 additions & 3 deletions .github/newsletter-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ Ideal section structure is:
### [Title]
{{ image_figure(
alt="image/GIF description"
src="image link"
alt="image/GIF description",
src="image link",
caption="image caption") }}
OR
{{ embed_video(type="video/mp4", src="my-video.mp4", caption="optional video caption") }}
{{ video_figure(
type="video/mp4",
src="my-video.mp4",
caption="optional video caption") }}
A paragraph or two with a summary and [useful links].
Expand Down
26 changes: 18 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,16 @@ your GitHub notifications for any further review comments from the editors.
### [Game name]

{{ image_figure(
alt="alt text"
src="img"
caption="optional image label") }}
alt="image/GIF description",
src="image link",
caption="image caption") }}

OR

{{ video_figure(
type="video/mp4",
src="my-video.mp4",
caption="optional video caption") }}

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

{{ image_figure(
alt="alt text"
src="img"
caption="optional image label") }}
alt="image/GIF description",
src="image link",
caption="image caption") }}

OR

{{ embed_video(type="video/mp4", src="my-video.mp4", caption="optional video caption") }}
{{ video_figure(
type="video/mp4",
src="my-video.mp4",
caption="optional video caption") }}

[@nickname] published an [article] about...
{overview what the resource is about}.
Expand Down Expand Up @@ -113,7 +123,7 @@ _Discussions: [/r/rust_gamedev](link), [Twitter](link), [etc](link)_
- Unless essential to demonstrating your project, prefer static images
over GIFs/videos, to keep the file size down.
- To include a video, encode it as `H.264` in an `mp4` container and use
the `embed_video()` shortcode; videos autoplay in a loop (muted).
the `video_figure()` shortcode; videos autoplay in a loop (muted).
- Use singular 'they' if you’re not sure what someone's pronouns are.
- If a project has been featured in previous newsletters, try to focus on
what's new rather than repeating previous content.
Expand Down
4 changes: 2 additions & 2 deletions content/news/052/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ We will switch this to an actual @gamedev.rs address in the future. Please tell

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

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

### [haalka]

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

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

Expand Down
15 changes: 11 additions & 4 deletions content/news/053/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,17 @@ Ideal section structure is:
### [Title]
{{ image_figure(
alt="image/GIF description"
src="image link"
alt="image/GIF description",
src="image link",
caption="image caption") }}
OR
{{ video_figure(
type="video/mp4",
src="my-video.mp4",
caption="optional video caption") }}
A paragraph or two with a summary and [useful links].
_Discussions:
Expand All @@ -77,8 +84,8 @@ If needed, a section can be split into subsections with a "------" delimiter.
### [Chuột][chuot-website]

{{ image_figure(
alt="Bunnymark example"
src="chuot.png"
alt="Bunnymark example",
src="chuot.png",
caption="[Bunnymark example](https://tversteeg.nl/chuot/examples/bunnymark/)") }}

Chuột ([Website][chuot-website], [GitHub][chuot-github]) by [@tversteeg]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{# <!--
Embed a video into a markdown file. Example usage:
{{ embed_video(type="video/mp4", src="my-video.mp4", caption="Some caption.") }}
{{ video_figure(
type="video/mp4",
src="my-video.mp4",
caption="Some caption.") }}
--> #}
<figure>
Expand Down

0 comments on commit f7da50c

Please sign in to comment.