Skip to content

Commit a1b4e6a

Browse files
committed
fix(tutorials): fix nav footers, restore image captions, add breadcrumb
Address a batch of rendering and consistency issues found reviewing the GitHub Pages site. Navigation footers: - Correct Next/Previous labels that named the wrong step across the walkthrough (34, 35 and 9 more: 15, 16, 18, 19, 23, 24, 30, 32, 36); link targets were right, only the display text was wrong. - OData V4: add the missing Next on step 9 and Previous on step 10, drop the bogus Next on the last step (11) that looped back to step 1. - Normalize footer shape across tutorials: collapse the doubled `***` rule in the navigation steps, and reorder OData V4 so Next/Previous comes before Related Information (matching the other four tutorials). - Document the canonical footer order in AGENTS.md. Image captions (restore Demo Kit behavior): - Auto-render a caption from each image's alt text in assets/js/custom.js (styled in assets/css/custom.css). Alt text was never removed; only the visible caption was lost in the migration. - Remove the ~42 redundant hand-authored <sup> captions, folding their wording fixes back into the alt/title first so nothing is lost. Broken OData V4 images: - Fix multiline alt-text syntax in steps 2 and 4 (an image whose alt spans two lines does not render). - Add the image files that were referenced but never committed: steps 9 and 11 from the SDK screenshots, steps 5 and 10 reuse the previous step's screenshot ("no visual change"). Quickstart overview: - Replace the borrowed step-3 screenshot (which carried a copy-pasted Walkthrough alt text) with the correct SDK image, fix the alt text, and remove a stray trailing period. Tutorial breadcrumb: - Inject a "UI5 Tutorials > <Tutorial>" breadcrumb on every step page (tools/builder/prepare-gh-pages.js for GitHub Pages, tools/dev-server for local preview) so readers know which tutorial they are in and can return to its overview.
1 parent 6ee9134 commit a1b4e6a

79 files changed

Lines changed: 261 additions & 200 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Full author docs are in [CONTRIBUTING.md](CONTRIBUTING.md).
7676
Other conventions:
7777

7878
- Callouts use `> :note:`, `> :tip:`, `> :info:` (custom syntax, not GitHub's `[!NOTE]` alerts).
79-
- Step navigation footer: `***` separator, then `**Next:** [Step N+1: <title>](../<NN+1>/README.md)` and `**Previous:** [Step N-1: <title>](../<NN-1>/README.md)`.
79+
- Step navigation footer: a single `***` separator, then `**Next:** [Step N+1: <title>](../<NN+1>/README.md)` and `**Previous:** [Step N-1: <title>](../<NN-1>/README.md)`. When a step also has a **Related Information** section, the order is Next/Previous first, then another `***`, then `**Related Information**` (matches all five tutorials). The first step has no `**Previous:**`; the last step has no `**Next:**`. The link display text must match the target step's actual title.
8080
- Preview images: descriptive `alt` text (no bare `![](…)`), optional `"title"` for the hover tooltip.
8181
- Do not add `<!-- loio… -->` markers or `<a name="loio…"/>` anchors — those are SAP-internal SDK artifacts.
8282

assets/css/custom.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,36 @@ li > section.ts-only, li > section.js-only {
165165
#__bs_notify__ {
166166
background-color: rgba(27, 32, 50, 0.3) !important;
167167
top: 40px !important;
168+
}
169+
170+
/* Image captions rendered from each image's alt text (see renderImageCaptions
171+
in assets/js/custom.js). Restores the SAP Demo Kit behavior of showing the
172+
image description below the figure. */
173+
figure.img-figure {
174+
margin: 16px 0;
175+
}
176+
177+
figure.img-figure > .img-caption {
178+
margin-top: 6px;
179+
font-size: 90%;
180+
font-style: italic;
181+
color: var(--inactive-color);
182+
text-align: center;
183+
}
184+
185+
/* Breadcrumb shown at the top of each step page: "UI5 Tutorials › <Tutorial>".
186+
Injected server-side (tools/builder/prepare-gh-pages.js for GitHub Pages,
187+
tools/dev-server/server.js for local preview) so the reader knows which
188+
tutorial they are in and can jump back to its overview. */
189+
.tutorial-breadcrumb {
190+
margin-bottom: 16px;
191+
padding-bottom: 8px;
192+
border-bottom: 1px solid var(--neutral-border);
193+
font-size: 90%;
194+
color: var(--inactive-color);
195+
}
196+
197+
.tutorial-breadcrumb .tutorial-breadcrumb-sep {
198+
margin: 0 6px;
199+
color: var(--inactive-color);
168200
}

assets/js/custom.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,60 @@ function updateAllCodeCouples(globalLang) {
276276

277277
// initialization on startup
278278

279+
/**
280+
* Render each content image's `alt` text as a visible caption beneath it,
281+
* mirroring the SAP Demo Kit behavior that was lost when the tutorials moved
282+
* to GitHub Pages. The caption text lives only in the image's `alt` attribute
283+
* (also used by screen readers and as the broken-image fallback), so there is
284+
* a single source of truth.
285+
*
286+
* Idempotent: an image already wrapped in <figure class="img-figure"> is
287+
* skipped, so re-running (e.g. after a language switch) does not duplicate.
288+
*/
289+
function renderImageCaptions() {
290+
const images = document.querySelectorAll("img");
291+
images.forEach((img) => {
292+
const caption = (img.getAttribute("alt") || "").trim();
293+
if (!caption) {
294+
return; // no alt text -> no caption
295+
}
296+
if (img.closest("figure.img-figure")) {
297+
return; // already processed
298+
}
299+
300+
// A link-wrapped image is captioned via its anchor; otherwise the image
301+
// itself is the wrap target.
302+
const wrapTarget =
303+
img.parentElement && img.parentElement.tagName === "A"
304+
? img.parentElement
305+
: img;
306+
const host = wrapTarget.parentElement;
307+
if (!host) {
308+
return;
309+
}
310+
311+
// Only caption block-level "preview" images — those that are the sole
312+
// meaningful content of their containing block. This skips inline
313+
// images sitting inside a line of prose (badges, inline icons), which
314+
// should not get a centered caption. `host.textContent` is empty for a
315+
// standalone image because the <img> contributes no text.
316+
if (host.textContent.trim() !== "") {
317+
return;
318+
}
319+
320+
const figure = document.createElement("figure");
321+
figure.classList.add("img-figure");
322+
323+
const figcaption = document.createElement("figcaption");
324+
figcaption.classList.add("img-caption");
325+
figcaption.textContent = caption;
326+
327+
wrapTarget.parentNode.insertBefore(figure, wrapTarget);
328+
figure.appendChild(wrapTarget);
329+
figure.appendChild(figcaption);
330+
});
331+
}
332+
279333
document.addEventListener("DOMContentLoaded", (event) => {
280334
setTimeout(() => {
281335
const lang = initializeLanguage();
@@ -285,5 +339,6 @@ document.addEventListener("DOMContentLoaded", (event) => {
285339
addLanguageSwitchButtons();
286340
updateAllCodeCouples(lang);
287341
updatePrevNextLinks(lang);
342+
renderImageCaptions();
288343
});
289344
});

packages/navigation/steps/01/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ With the downloaded coding, you have an initial app with recommended settings th
8989

9090
So far we have a basic app that does not really have any navigation or routing implemented. This will change in the next steps when we implement our first navigation features.
9191

92-
***
93-
94-
9592
***
9693

9794
**Next:** [Step 2: Enable Routing](../02/README.md)

packages/navigation/steps/02/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,6 @@ Create a file `Home.controller.ts` in the `webapp/controller` folder. The contro
238238

239239
***
240240

241-
***
242-
243241
**Next:** [Step 3: Catch Invalid Hashes](../03/README.md)
244242

245243
**Previous:** [Step 1: Set Up the Initial App](../01/README.md)

packages/navigation/steps/03/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ Open the URL `index.html#/thisIsInvalid` in your browser. From now on the user w
160160

161161
***
162162

163-
***
164-
165163
**Next:** [Step 4: Add a *Back* Button to *Not Found* Page](../04/README.md)
166164

167165
**Previous:** [Step 2: Enable Routing](../02/README.md)

packages/navigation/steps/04/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ The same applies to our `Home` controller, we now also inherit from the `BaseCon
231231

232232
***
233233

234-
***
235-
236234
**Next:** [Step 5: Display a Target Without Changing the Hash](../05/README.md)
237235

238236
**Previous:** [Step 3: Catch Invalid Hashes](../03/README.md)

packages/navigation/steps/05/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,6 @@ When we now click the *Back* button, it works as expected and brings us back to
218218
219219
***
220220
221-
***
222-
223221
**Next:** [Step 6: Navigate to Routes with Hard-Coded Patterns](../06/README.md)
224222
225223
**Previous:** [Step 4: Add a *Back* Button to *Not Found* Page](../04/README.md)

packages/navigation/steps/06/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ Now you can open the app and press the *Show Employee List* button to navigate t
265265

266266
***
267267

268-
***
269-
270268
**Next:** [Step 7: Navigate to Routes with Mandatory Parameters](../07/README.md)
271269

272270
**Previous:** [Step 5: Display a Target Without Changing the Hash](../05/README.md)

packages/navigation/steps/07/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,6 @@ That’s it. You can go to `webapp/index.html#/employees` and click on any list
394394

395395
***
396396

397-
***
398-
399397
**Next:** [Step 8: Navigate with Flip Transition](../08/README.md)
400398

401399
**Previous:** [Step 6: Navigate to Routes with Hard-Coded Patterns](../06/README.md)

0 commit comments

Comments
 (0)