Skip to content

allow multiple labels setting for breadcrum#253

Merged
masao merged 2 commits into
mainfrom
feature/breadcrumb-labels
Jul 12, 2026
Merged

allow multiple labels setting for breadcrum#253
masao merged 2 commits into
mainfrom
feature/breadcrumb-labels

Conversation

@masao

@masao masao commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

Support both a single property and a list of properties in the breadcrumb label configuration.

When multiple label properties are configured, ttl2html now checks them in order and uses the first property that has a value. If none of the configured properties match, it falls back to the default title generated by get_title.

This keeps the existing behavior for a single label property while allowing projects to define prioritized fallback properties for breadcrumb labels.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation or other updates (if none of the other choices apply)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0660f1df17

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/ttl2html.rb
{
uri: parent,
label: label,
label: breadcrumb_label(data_parent, template, label_prop),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply label fallback list to the current breadcrumb

This routes only parent breadcrumbs through the new fallback-list helper; the active/current item is still built in build_breadcrumbs with the old scalar lookup (data[@config[:breadcrumbs].first["label"]]), so when label is an array that lookup misses and a page such as ex:sect1 renders the default title Section 1 instead of the configured fallback Sect1. Please use the same fallback helper for the depth-0 label so the new option applies to every breadcrumb item.

Useful? React with 👍 / 👎.

@masao
masao merged commit 394975e into main Jul 12, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant