Skip to content

Conversation

@Tearran
Copy link
Owner

@Tearran Tearran commented Aug 15, 2025

Summary by CodeRabbit

  • New Features

    • Added a consolidated media kit CLI that generates multi-format icons, builds a logos manifest, produces a responsive gallery and favicon, and can run a local preview server.
  • Chores

    • Removed the legacy static gallery and prior media-kit artifacts; consolidated asset generation into the new media kit flow.
  • Documentation

    • Updated README to document the new CLI, its commands, inputs/outputs, and usage.

modified:   media_kit/armbian-media_kit.sh
new file:   media_kit/dist/images/16x16/armbian_font.v2.1.png
new file:   media_kit/dist/images/16x16/armbian_mascot_v2.1.png
new file:   media_kit/dist/images/16x16/armbian_sdk_v2.0.png
new file:   media_kit/dist/images/16x16/configng_font_v1.0.png
renamed:    media_kit/images/16x16/configng-mascot_v2.0.png -> media_kit/dist/images/16x16/configng_mascot_v2.0.png
new file:   media_kit/dist/images/16x16/configng_sdk_v2.0.png
new file:   media_kit/dist/images/48x48/armbian_font.v2.1.png
new file:   media_kit/dist/images/48x48/armbian_mascot_v2.1.png
new file:   media_kit/dist/images/48x48/armbian_sdk_v2.0.png
renamed:    media_kit/images/48x48/config_font.png -> media_kit/dist/images/48x48/configng_font_v1.0.png
renamed:    media_kit/images/48x48/configng-mascot_v2.0.png -> media_kit/dist/images/48x48/configng_mascot_v2.0.png
new file:   media_kit/dist/images/48x48/configng_sdk_v2.0.png
new file:   media_kit/dist/images/512x512/armbian_font.v2.1.png
new file:   media_kit/dist/images/512x512/armbian_mascot_v2.1.png
new file:   media_kit/dist/images/512x512/armbian_sdk_v2.0.png
renamed:    media_kit/images/512x512/config_font.png -> media_kit/dist/images/512x512/configng_font_v1.0.png
renamed:    media_kit/images/512x512/configng-mascot_v2.0.png -> media_kit/dist/images/512x512/configng_mascot_v2.0.png
new file:   media_kit/dist/images/512x512/configng_sdk_v2.0.png
renamed:    media_kit/images/scalable/brand/armbian_font.v2.1.svg -> media_kit/dist/images/scalable/armbian_font.v2.1.svg
renamed:    media_kit/images/scalable/brand/armbian_mascot_v2.1.svg -> media_kit/dist/images/scalable/armbian_mascot_v2.1.svg
renamed:    media_kit/images/scalable/brand/armbian_sdk_v2.0.svg -> media_kit/dist/images/scalable/armbian_sdk_v2.0.svg
renamed:    media_kit/images/scalable/brand/configng_font_v1.0.svg -> media_kit/dist/images/scalable/configng_font_v1.0.svg
renamed:    media_kit/images/scalable/brand/configng_mascot_v2.0.svg -> media_kit/dist/images/scalable/configng_mascot_v2.0.svg
renamed:    media_kit/images/scalable/brand/configng_sdk_v2.0.svg -> media_kit/dist/images/scalable/configng_sdk_v2.0.svg
renamed:    media_kit/images/scalable/brand/legacy/armbian_cpu_v1.0.svg -> media_kit/dist/images/scalable/legacy/armbian_cpu_v1.0.svg
renamed:    media_kit/images/scalable/brand/legacy/armbian_font_v1.5.svg -> media_kit/dist/images/scalable/legacy/armbian_font_v1.5.svg
renamed:    media_kit/images/scalable/brand/legacy/configng-tux_v1.0.svg -> media_kit/dist/images/scalable/legacy/configng-tux_v1.0.svg
renamed:    media_kit/images/scalable/brand/legacy/configng_cog_v1.0.svg -> media_kit/dist/images/scalable/legacy/configng_cog_v1.0.svg
renamed:    media_kit/index.html -> media_kit/dist/index.html
renamed:    media_kit/logos.json -> media_kit/dist/logos.json
modified:   media_kit/images/16x16/armbian_font.v2.1.png
modified:   media_kit/images/16x16/armbian_mascot_v2.1.png
modified:   media_kit/images/16x16/armbian_sdk_v2.0.png
deleted:    media_kit/images/16x16/config_font.png
deleted:    media_kit/images/16x16/config_font_v1.0.png
modified:   media_kit/images/16x16/configng_font_v1.0.png
modified:   media_kit/images/16x16/configng_mascot_v2.0.png
modified:   media_kit/images/16x16/configng_sdk_v2.0.png
modified:   media_kit/images/48x48/armbian_font.v2.1.png
modified:   media_kit/images/48x48/armbian_mascot_v2.1.png
modified:   media_kit/images/48x48/armbian_sdk_v2.0.png
deleted:    media_kit/images/48x48/config_font_v1.0.png
modified:   media_kit/images/48x48/configng_font_v1.0.png
modified:   media_kit/images/48x48/configng_mascot_v2.0.png
modified:   media_kit/images/48x48/configng_sdk_v2.0.png
modified:   media_kit/images/512x512/armbian_font.v2.1.png
modified:   media_kit/images/512x512/armbian_mascot_v2.1.png
modified:   media_kit/images/512x512/armbian_sdk_v2.0.png
deleted:    media_kit/images/512x512/config_font_v1.0.png
modified:   media_kit/images/512x512/configng_font_v1.0.png
modified:   media_kit/images/512x512/configng_mascot_v2.0.png
modified:   media_kit/images/512x512/configng_sdk_v2.0.png
deleted:    media_kit/images/scalable/brand/config_font_v1.0.svg
deleted:    media_kit/images/scalable/configng-mascot_v2.0.svg
renamed:    media_kit/images/scalable/brand/config_font.svg -> media_kit/images/scalable/configng_font_v1.0.svg
renamed:    media_kit/images/scalable/brand/configng-mascot_v2.0.svg -> media_kit/images/scalable/configng_mascot_v2.0.svg
new file:   media_kit/images/scalable/brand/armbian_mascot_v2.1.svg
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

Warning

Rate limit exceeded

@Tearran has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 14 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between fb65cab and 7e31683.

📒 Files selected for processing (2)
  • media_kit/README.md (0 hunks)
  • media_kit/media_kit.sh (1 hunks)

Walkthrough

Deletes the root index.html and several static media-kit artifacts; removes the legacy media_kit/armbian-media_kit.sh; adds a new Bash media kit CLI at media_kit/media_kit.sh that can generate images, build media_kit/logos.json, emit media_kit/index.html, and serve the directory; updates media_kit/README.md. (50 words)

Changes

Cohort / File(s) Summary
Root gallery removed
index.html
Deleted the static root HTML gallery listing logos, download links, and license/brand references.
Legacy CLI removed
media_kit/armbian-media_kit.sh
Deleted the previous Bash media kit script, helpers, and test harness.
New CLI & toolchain
media_kit/media_kit.sh
Added a new Bash media_kit CLI with subcommands: help, index, icon, server, all; includes helpers to scan SVGs, extract metadata, generate PNG/GIF/JPG/favicons, write logos.json, and emit index.html.
HTML index removed/replaced
media_kit/index.html
Deleted prior static client-side gallery; index generation moved into the new CLI (_html_index).
Manifest removed / regen target introduced
media_kit/logos.json
Deleted the existing logos.json manifest file; the new CLI can regenerate logos.json from SVG sources.
Documentation updated
media_kit/README.md
Updated to reflect renamed entrypoint (media_kit.sh), new all command, changed input/output dirs and sizes, favicon behavior, and format/policy notes.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI as media_kit (bash)
  participant FS as Filesystem
  participant IM as ImageMagick
  participant Py as python3 HTTP server

  User->>CLI: media_kit <subcommand>
  alt help
    CLI->>User: print usage
  else icon
    CLI->>FS: read brand/ (SVGs)
    CLI->>IM: convert SVG -> PNG/JPG/GIF, build favicon.ico
    CLI->>FS: write images/<size>x<size>/ and images/scalable/
  else index
    CLI->>FS: scan SVGs -> extract svg_meta
    CLI->>FS: write media_kit/logos.json
    CLI->>FS: write media_kit/index.html
  else server
    CLI->>Py: start http.server (port 8080)
    User->>Py: HTTP requests
    User->>CLI: stop -> CLI->>Py: terminate server
  else all
    CLI->>CLI: run icon -> _index_json -> _html_index -> _html_server
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through deleted pages, nibble old script shells,
I stitch new manifests and polish tiny favicon bells.
I spin SVGs to PNGs, GIFs, and JPG delight,
An index rises, a server hums — I watch them light. 🥕🐇

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch media_kit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

deleted:    media_kit/dist/images/16x16/armbian_font.v2.1.png
deleted:    media_kit/dist/images/16x16/armbian_mascot_v2.1.png
deleted:    media_kit/dist/images/16x16/armbian_sdk_v2.0.png
deleted:    media_kit/dist/images/16x16/configng_font_v1.0.png
deleted:    media_kit/dist/images/16x16/configng_mascot_v2.0.png
deleted:    media_kit/dist/images/16x16/configng_sdk_v2.0.png
deleted:    media_kit/dist/images/48x48/armbian_font.v2.1.png
deleted:    media_kit/dist/images/48x48/armbian_mascot_v2.1.png
deleted:    media_kit/dist/images/48x48/armbian_sdk_v2.0.png
deleted:    media_kit/dist/images/48x48/configng_font_v1.0.png
deleted:    media_kit/dist/images/48x48/configng_mascot_v2.0.png
deleted:    media_kit/dist/images/48x48/configng_sdk_v2.0.png
deleted:    media_kit/dist/images/512x512/armbian_font.v2.1.png
deleted:    media_kit/dist/images/512x512/armbian_mascot_v2.1.png
deleted:    media_kit/dist/images/512x512/armbian_sdk_v2.0.png
deleted:    media_kit/dist/images/512x512/configng_font_v1.0.png
deleted:    media_kit/dist/images/512x512/configng_mascot_v2.0.png
deleted:    media_kit/dist/images/512x512/configng_sdk_v2.0.png
deleted:    media_kit/dist/images/scalable/armbian_font.v2.1.svg
deleted:    media_kit/dist/images/scalable/armbian_mascot_v2.1.svg
deleted:    media_kit/dist/images/scalable/armbian_sdk_v2.0.svg
deleted:    media_kit/dist/images/scalable/configng_font_v1.0.svg
deleted:    media_kit/dist/images/scalable/configng_mascot_v2.0.svg
deleted:    media_kit/dist/images/scalable/configng_sdk_v2.0.svg
deleted:    media_kit/dist/images/scalable/legacy/armbian_cpu_v1.0.svg
deleted:    media_kit/dist/images/scalable/legacy/armbian_font_v1.5.svg
deleted:    media_kit/dist/images/scalable/legacy/configng-tux_v1.0.svg
deleted:    media_kit/dist/images/scalable/legacy/configng_cog_v1.0.svg
modified:   media_kit/images/16x16/armbian_font.v2.1.png
modified:   media_kit/images/16x16/armbian_mascot_v2.1.png
modified:   media_kit/images/16x16/armbian_sdk_v2.0.png
modified:   media_kit/images/16x16/configng_font_v1.0.png
modified:   media_kit/images/16x16/configng_mascot_v2.0.png
modified:   media_kit/images/16x16/configng_sdk_v2.0.png
modified:   media_kit/images/48x48/armbian_font.v2.1.png
modified:   media_kit/images/48x48/armbian_mascot_v2.1.png
modified:   media_kit/images/48x48/armbian_sdk_v2.0.png
modified:   media_kit/images/48x48/configng_font_v1.0.png
modified:   media_kit/images/48x48/configng_mascot_v2.0.png
modified:   media_kit/images/48x48/configng_sdk_v2.0.png
modified:   media_kit/images/512x512/armbian_font.v2.1.png
modified:   media_kit/images/512x512/armbian_mascot_v2.1.png
modified:   media_kit/images/512x512/armbian_sdk_v2.0.png
modified:   media_kit/images/512x512/configng_font_v1.0.png
modified:   media_kit/images/512x512/configng_mascot_v2.0.png
modified:   media_kit/images/512x512/configng_sdk_v2.0.png
renamed:    media_kit/dist/index.html -> media_kit/index.html
renamed:    media_kit/dist/logos.json -> media_kit/logos.json
deleted:    media_kit/images/16x16/armbian_mascot_v2.1.png
deleted:    media_kit/images/16x16/armbian_sdk_v2.0.png
deleted:    media_kit/images/16x16/configng_font_v1.0.png
deleted:    media_kit/images/16x16/configng_mascot_v2.0.png
deleted:    media_kit/images/16x16/configng_sdk_v2.0.png
deleted:    media_kit/images/48x48/armbian_font.v2.1.png
deleted:    media_kit/images/48x48/armbian_mascot_v2.1.png
deleted:    media_kit/images/48x48/armbian_sdk_v2.0.png
deleted:    media_kit/images/48x48/configng_font_v1.0.png
deleted:    media_kit/images/48x48/configng_mascot_v2.0.png
deleted:    media_kit/images/48x48/configng_sdk_v2.0.png
deleted:    media_kit/images/512x512/armbian_font.v2.1.png
deleted:    media_kit/images/512x512/armbian_mascot_v2.1.png
deleted:    media_kit/images/512x512/armbian_sdk_v2.0.png
deleted:    media_kit/images/512x512/configng_font_v1.0.png
deleted:    media_kit/images/512x512/configng_mascot_v2.0.png
deleted:    media_kit/images/512x512/configng_sdk_v2.0.png
deleted:    media_kit/images/scalable/armbian_font.v2.1.svg
deleted:    media_kit/images/scalable/armbian_mascot_v2.1.svg
deleted:    media_kit/images/scalable/armbian_sdk_v2.0.svg
deleted:    media_kit/images/scalable/brand/armbian_font.v2.1.svg
deleted:    media_kit/images/scalable/brand/armbian_mascot_v2.1.svg
deleted:    media_kit/images/scalable/brand/armbian_sdk_v2.0.svg
deleted:    media_kit/images/scalable/brand/configng_font_v1.0.svg
deleted:    media_kit/images/scalable/brand/configng_mascot_v2.0.svg
deleted:    media_kit/images/scalable/brand/configng_sdk_v2.0.svg
deleted:    media_kit/images/scalable/brand/legacy/armbian_cpu_v1.0.svg
deleted:    media_kit/images/scalable/brand/legacy/armbian_font_v1.5.svg
deleted:    media_kit/images/scalable/brand/legacy/configng-tux_v1.0.svg
deleted:    media_kit/images/scalable/brand/legacy/configng_cog_v1.0.svg
deleted:    media_kit/images/scalable/configng_font_v1.0.svg
deleted:    media_kit/images/scalable/configng_mascot_v2.0.svg
deleted:    media_kit/images/scalable/configng_sdk_v2.0.svg
deleted:    media_kit/images/scalable/legacy/armbian_cpu_v1.0.svg
deleted:    media_kit/images/scalable/legacy/armbian_font_v1.5.svg
deleted:    media_kit/images/scalable/legacy/configng-tux_v1.0.svg
deleted:    media_kit/images/scalable/legacy/configng_cog_v1.0.svg
deleted:    media_kit/index.html
deleted:    media_kit/logos.json
@Tearran Tearran marked this pull request as ready for review August 15, 2025 18:28
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

✅ Actions performed

Full review triggered.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (7)
media_kit/media_kit.sh (7)

4-4: Update header comment to the new script name

The banner still references the legacy path.

Apply this diff:

-# ./armbian-media_kit.sh - Armbian Config V2 module
+# ./media_kit.sh - Armbian Config V2 module

189-195: Improve SVG metadata extraction and portability

  • grep -P (PCRE) isn’t available on BSD/macOS by default; this limits portability.
  • svg_title and svg_desc currently include the XML tags.

Consider either:

  • Using POSIX tools with sed to extract content:
-    svg_title=$(grep -oP '<title>(.*?)</title>' "$file" | head -n1 || echo "")
-    svg_desc=$(grep -oP '<desc>(.*?)</desc>' "$file" | head -n1 || echo "")
+    svg_title=$(sed -n 's/.*<title>\(.*\)<\/title>.*/\1/p' "$file" | head -n1 || echo "")
+    svg_desc=$(sed -n 's/.*<desc>\(.*\)<\/desc>.*/\1/p' "$file" | head -n1 || echo "")
  • Or keep PCRE but extract only inner text with lookarounds (GNU grep required):
-    svg_title=$(grep -oP '<title>(.*?)</title>' "$file" | head -n1 || echo "")
-    svg_desc=$(grep -oP '<desc>(.*?)</desc>' "$file" | head -n1 || echo "")
+    svg_title=$(grep -oP '(?<=<title>).*?(?=</title>)' "$file" | head -n1 || echo "")
+    svg_desc=$(grep -oP '(?<=<desc>).*?(?=</desc>)' "$file" | head -n1 || echo "")

147-154: Avoid innerHTML injection; render text safely

innerHTML concatenates unescaped values from logos.json (e.g., logo.name and file names). Filenames with special characters could break HTML or inject markup.

Use DOM APIs and textContent to construct the nodes instead of template strings. Example (JS outside of the heredoc for illustration):

const div = document.createElement('div');
div.appendChild(document.createElement('hr'));
const img = document.createElement('img');
img.src = logo.svg;
img.alt = logo.name;
img.width = 64;
img.height = 64;
div.appendChild(img);
const p = document.createElement('p');
p.textContent = `${logo.name} PNG:`;
div.appendChild(p);
const ul = document.createElement('ul');
for (const p of logo.pngs) {
  const li = document.createElement('li');
  const a = document.createElement('a');
  if (typeof p === 'string') {
    a.href = p;
    a.textContent = p.split('/').pop();
  } else {
    a.href = p.path;
    a.textContent = p.size;
    li.append(` – ${p.kb} KB`);
  }
  li.prepend(a);
  ul.appendChild(li);
}
div.appendChild(ul);
container.appendChild(div);

323-337: Consider mirroring instead of blind copy for scalable assets

cp -r "$SRC_DIR" "images/scalable" may leave stale files in images/scalable or overwrite permissions.

If available, use rsync to mirror and prune removed files:

-    cp -r "$SRC_DIR" "images/scalable"
+    mkdir -p "images/scalable"
+    rsync -a --delete "$SRC_DIR"/ "images/scalable"/

If rsync is not guaranteed, at least mkdir -p images/scalable before copying to avoid errors.


267-305: Non-interactive environments: avoid blocking on read -p for install

Prompting to install ImageMagick can hang CI or non-interactive shells.

  • Detect non-interactive mode ([[ ! -t 0 ]]) and fail fast with a clear message.
  • Or accept a --yes/-y flag to auto-install, and default to “no” otherwise.

376-391: Don’t rely on the START harness for defaults

SIZES and SVG_DIR are only set in the START block. When the functions are sourced/called from another script, arrays may be unset, leading to no PNGs and empty pngs arrays.

Initialize sane defaults near the top of the file:

 set -euo pipefail
+
+# Defaults (can be overridden by env)
+if [[ -z "${SIZES+x}" ]]; then
+    SIZES=(16 48 512)
+fi
+SVG_DIR="${SVG_DIR:-./brand}"
+SRC_DIR="${SRC_DIR:-./brand}"

122-160: Optional: include “Other” categories in the HTML

_index_json can emit other and other-legacy, but the UI ignores them.

If intentional, ignore. Otherwise, add sections and switch cases for these categories.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 71f9b61 and 654a65f.

⛔ Files ignored due to path filters (49)
  • media_kit/images/16x16/armbian_font.v2.1.png is excluded by !**/*.png
  • media_kit/images/16x16/armbian_mascot_v2.1.png is excluded by !**/*.png
  • media_kit/images/16x16/armbian_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/16x16/config_font.png is excluded by !**/*.png
  • media_kit/images/16x16/config_font_v1.0.png is excluded by !**/*.png
  • media_kit/images/16x16/configng-mascot_v2.0.png is excluded by !**/*.png
  • media_kit/images/16x16/configng_font_v1.0.png is excluded by !**/*.png
  • media_kit/images/16x16/configng_mascot_v2.0.png is excluded by !**/*.png
  • media_kit/images/16x16/configng_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/48x48/armbian_font.v2.1.png is excluded by !**/*.png
  • media_kit/images/48x48/armbian_mascot_v2.1.png is excluded by !**/*.png
  • media_kit/images/48x48/armbian_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/48x48/config_font.png is excluded by !**/*.png
  • media_kit/images/48x48/config_font_v1.0.png is excluded by !**/*.png
  • media_kit/images/48x48/configng-mascot_v2.0.png is excluded by !**/*.png
  • media_kit/images/48x48/configng_font_v1.0.png is excluded by !**/*.png
  • media_kit/images/48x48/configng_mascot_v2.0.png is excluded by !**/*.png
  • media_kit/images/48x48/configng_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/512x512/armbian_font.v2.1.png is excluded by !**/*.png
  • media_kit/images/512x512/armbian_mascot_v2.1.png is excluded by !**/*.png
  • media_kit/images/512x512/armbian_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/512x512/config_font.png is excluded by !**/*.png
  • media_kit/images/512x512/config_font_v1.0.png is excluded by !**/*.png
  • media_kit/images/512x512/configng-mascot_v2.0.png is excluded by !**/*.png
  • media_kit/images/512x512/configng_font_v1.0.png is excluded by !**/*.png
  • media_kit/images/512x512/configng_mascot_v2.0.png is excluded by !**/*.png
  • media_kit/images/512x512/configng_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/scalable/armbian_font.v2.1.svg is excluded by !**/*.svg
  • media_kit/images/scalable/armbian_mascot_v2.1.svg is excluded by !**/*.svg
  • media_kit/images/scalable/armbian_sdk_v2.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/armbian_font.v2.1.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/armbian_mascot_v2.1.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/armbian_sdk_v2.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/config_font.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/config_font_v1.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/configng-mascot_v2.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/configng_font_v1.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/configng_mascot_v2.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/configng_sdk_v2.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/legacy/armbian_cpu_v1.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/legacy/armbian_font_v1.5.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/legacy/configng-tux_v1.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/brand/legacy/configng_cog_v1.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/configng-mascot_v2.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/configng_sdk_v2.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/legacy/armbian_cpu_v1.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/legacy/armbian_font_v1.5.svg is excluded by !**/*.svg
  • media_kit/images/scalable/legacy/configng-tux_v1.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/legacy/configng_cog_v1.0.svg is excluded by !**/*.svg
📒 Files selected for processing (5)
  • index.html (0 hunks)
  • media_kit/armbian-media_kit.sh (0 hunks)
  • media_kit/index.html (0 hunks)
  • media_kit/logos.json (0 hunks)
  • media_kit/media_kit.sh (1 hunks)
💤 Files with no reviewable changes (4)
  • media_kit/index.html
  • media_kit/armbian-media_kit.sh
  • media_kit/logos.json
  • index.html
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Tearran
PR: Tearran/configng-v2#36
File: src/network/interface/network_manager.sh:46-53
Timestamp: 2025-06-23T18:54:21.952Z
Learning: Tearran prefers heredoc over echo/printf for multi-line templating work, especially for generating dynamic content from metadata. Heredoc provides better readability, easier maintenance, and is more forgiving for complex formatting than chained echo statements.
🧬 Code Graph Analysis (1)
media_kit/media_kit.sh (1)
SDK/00_start_here.sh (1)
  • _template_sh (78-149)
🔇 Additional comments (2)
media_kit/media_kit.sh (2)

168-231: JSON number formatting: ensure non-empty numeric kb

du -k yields integer KiB. You format as %.2f then emit bare JSON number, which is fine. Edge cases:

  • On systems where du uses 512-byte blocks by default, sizes may be off.
  • If du fails, kb may be empty; you guard with || echo 0, good.

6-32: Nice dispatcher structure and set -euo pipefail

Clear subcommands, good defaults, and a consistent module entrypoint. The heredoc-based HTML generator also aligns with the preference for heredocs for multi-line templating.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🔭 Outside diff range comments (2)
media_kit/index.html (2)

35-52: Add “Other” and “Other Legacy” sections to match README and generator categories

Without these sections, logos with category “other”/“other-legacy” won’t render.

 		<div id="configng-legacy-section" class="section legacy">
 			<h2>ConfigNG Legacy</h2>
 			<div id="configng-legacy-logos"></div>
 		</div>
+		<div id="other-section" class="section">
+			<h2>Other</h2>
+			<div id="other-logos"></div>
+		</div>
+		<div id="other-legacy-section" class="section legacy">
+			<h2>Other Legacy</h2>
+			<div id="other-legacy-logos"></div>
+		</div>

70-79: Switch should route ‘other’ categories to their sections

Currently default: return drops them.

-                    switch (logo.category) {
+                    switch (logo.category) {
                         case 'armbian': sectionId = 'armbian-logos'; break;
                         case 'armbian-legacy': sectionId = 'armbian-legacy-logos'; break;
                         case 'configng': sectionId = 'configng-logos'; break;
                         case 'configng-legacy': sectionId = 'configng-legacy-logos'; break;
-                        default: return;
+                        case 'other': sectionId = 'other-logos'; break;
+                        case 'other-legacy': sectionId = 'other-legacy-logos'; break;
+                        default: return;
                     }

Also applies to: 100-111

♻️ Duplicate comments (4)
media_kit/media_kit.sh (4)

11-13: index subcommand doesn’t generate logos.json

index.html fetches logos.json, but index) doesn’t call _index_json. This causes the page to fail on a fresh run.

-        index)
-            _html_index > index.html
+        index)
+            _index_json
+            _html_index > index.html

250-278: Honor DIR and ensure clean shutdown in _html_server

Currently it serves CWD regardless of DIR and lacks traps.

 _html_server() {
-    local DIR="${1:-.}"
+    local DIR="${1:-.}"
     if ! command -v python3 &> /dev/null; then
         echo "Python 3 is required to run the server. Please install it."
         exit 1
     fi
-    echo "Starting Python web server"
-    python3 -m http.server 8080 &
-
-    PYTHON_PID=$!
-
-    echo "Python web server started with PID $PYTHON_PID"
-    echo "You can access the server at http://localhost:8080/$DIR"
-    echo "Press any key to stop the server..."
-    read -r -n 1 -s
-    echo "Stopping the server..."
+    if [[ ! -d "$DIR" ]]; then
+        echo "Directory not found: $DIR"
+        exit 1
+    fi
+    echo "Starting Python web server serving directory: $DIR"
+    python3 -m http.server 8080 --directory "$DIR" &
+    PYTHON_PID=$!
+    trap '[[ -n "${PYTHON_PID:-}" ]] && kill "$PYTHON_PID" 2>/dev/null || true' INT TERM EXIT
+
+    echo "Python web server started with PID $PYTHON_PID"
+    echo "Open: http://localhost:8080/"
+    echo "Press any key to stop the server..."
+    read -r -n 1 -s
+    echo "Stopping the server..."
     if ! kill -0 "$PYTHON_PID" 2>/dev/null; then
         echo "Server is not running or already stopped."
         exit 0
     fi
     kill "$PYTHON_PID" && wait "$PYTHON_PID" 2>/dev/null
     if [[ $? -eq 0 ]]; then
         echo "Server stopped successfully."
     else
         echo "Failed to stop the server."
         exit 1
     fi
-    echo "Test complete"
+    trap - INT TERM EXIT
 }

323-330: convert failures will exit the script under set -e

Wrap convert in the if directly to avoid premature termination and log errors to stderr.

-            if [[ ! -f "$OUT_FILE" || "$svg" -nt "$OUT_FILE" ]]; then
-                convert -background none -resize ${size}x${size} "$svg" "$OUT_FILE"
-                if [ $? -eq 0 ]; then
-                    echo "Generated $OUT_FILE"
-                else
-                    echo "Failed to convert $svg to $OUT_FILE"
-                fi
-            fi
+            if [[ ! -f "$OUT_FILE" || "$svg" -nt "$OUT_FILE" ]]; then
+                if convert -background none -resize "${size}x${size}" "$svg" "$OUT_FILE"; then
+                    echo "Generated $OUT_FILE"
+                else
+                    echo "Failed to convert $svg to $OUT_FILE" >&2
+                fi
+            fi

366-399: Help text: wrong paths and example subcommand

  • Source dir for icons is ./brand (copied to ./images/scalable), not ./images/scalable.
  • Example uses “serve” but the subcommand is “server”.
 Commands:
 help    - Show this help message.
-icon    - Generate a PNG, JPG, and GIF icon set from SVG files in ./images/scalable.
+icon    - Generate a PNG, JPG, and GIF icon set from SVG files in ./brand (copied to ./images/scalable).
 index   - Generate an HTML media kit index of all SVGs and icons.
 server  - Serve the HTML and icon directory using a simple HTTP server.
 all     - Run icon generation, HTML index generation and start the server.
@@
-# Generate the HTML and start the server
-media_kit index serve
+# Generate the HTML and start the server
+media_kit index server
@@
-- SVGs should be placed in ./images/scalable for indexing and icon generation.
+- SVG source files should be placed in ./brand; they will be copied to ./images/scalable for indexing/serving.
🧹 Nitpick comments (7)
media_kit/README.md (2)

41-45: Clarify output location vs current working directory

The script writes index.html, logos.json, and favicon.ico to the current working directory, not necessarily the “project root.” Either make the script anchor outputs relative to its own directory or adjust docs to say “generated in the current directory.”

If you prefer to anchor to repo root, I can provide a patch to resolve SCRIPT_DIR and write outputs to "$(dirname "$SCRIPT_DIR")".


72-76: Minor wording nit: make the format policy more concise

The three sentences can be tightened without losing meaning.

-**Format Policy:**  
-All graphics in this media kit are provided in SVG format as the source, which is widely compatible with both FOSS and commercial design tools (such as Inkscape, Photoshop, Illustrator, etc.).  
-Generated PNG, JPG, and GIF formats are provided for easy use.  
-If you need other formats, you can convert from SVG using your preferred tools or request a new export.
+**Format Policy:**  
+Source graphics are provided in SVG, compatible with FOSS and commercial tools (Inkscape, Photoshop, Illustrator, etc.).  
+PNG, JPG, and GIF exports are included for convenience.  
+Need another format? Convert from SVG or request a new export.
media_kit/index.html (3)

60-65: Harden against XSS and broken HTML when rendering metadata

meta.title/desc originate from SVG content. You’re inserting them via innerHTML without escaping. Prefer textContent or basic escaping.

Minimal approach: escape <, >, & before interpolation; or build DOM nodes and set textContent for values.


66-76: Make logos.json path work from both project root and media_kit/

This file lives under media_kit/. When opened directly, fetch('logos.json') and ./favicon.ico won’t resolve unless the page is generated at project root. Either document that this file is a template only, or make the paths robust.

Option: detect base path.

-        fetch('logos.json')
+        const base = location.pathname.includes('/media_kit/') ? '../' : './';
+        fetch(base + 'logos.json')

Note: To fully support both locations, you’d also need to prefix image links with base.

Also applies to: 81-91


129-129: Add fetch error handling for better UX

If logos.json is missing or malformed, the page silently fails.

-            });
+            })
+            .catch(err => {
+                console.error('Failed to load logos.json', err);
+                const main = document.querySelector('main');
+                if (main) {
+                    const p = document.createElement('p');
+                    p.style.color = '#c00';
+                    p.textContent = 'Error: Unable to load logos.json';
+                    main.prepend(p);
+                }
+            });
media_kit/media_kit.sh (2)

4-4: Outdated header comment

Rename to match the file name.

-# ./armbian-media_kit.sh - Armbian Config V2 module
+# ./media_kit.sh - Armbian Config V2 module

404-407: Set sane defaults when sourced (optional)

If the file is sourced and the entrypoint block doesn’t run, SIZES/SVG_DIR may be undefined. Consider setting defaults at function entrypoints.

Example:

# at the start of _icon_set_from_svg and _index_json
: "${SVG_DIR:=./brand}"
: "${SIZES:=16 48 512}"  # or SIZES=(${SIZES:-16 48 512}) if you prefer arrays
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 654a65f and 03491b6.

⛔ Files ignored due to path filters (56)
  • media_kit/images/16x16/armbian_font.v2.1.gif is excluded by !**/*.gif
  • media_kit/images/16x16/armbian_font.v2.1.jpg is excluded by !**/*.jpg
  • media_kit/images/16x16/armbian_font.v2.1.png is excluded by !**/*.png
  • media_kit/images/16x16/armbian_mascot_v2.1.gif is excluded by !**/*.gif
  • media_kit/images/16x16/armbian_mascot_v2.1.jpg is excluded by !**/*.jpg
  • media_kit/images/16x16/armbian_mascot_v2.1.png is excluded by !**/*.png
  • media_kit/images/16x16/armbian_sdk_v2.0.gif is excluded by !**/*.gif
  • media_kit/images/16x16/armbian_sdk_v2.0.jpg is excluded by !**/*.jpg
  • media_kit/images/16x16/armbian_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/16x16/configng_font_v1.0.gif is excluded by !**/*.gif
  • media_kit/images/16x16/configng_font_v1.0.jpg is excluded by !**/*.jpg
  • media_kit/images/16x16/configng_font_v1.0.png is excluded by !**/*.png
  • media_kit/images/16x16/configng_mascot_v2.0.gif is excluded by !**/*.gif
  • media_kit/images/16x16/configng_mascot_v2.0.jpg is excluded by !**/*.jpg
  • media_kit/images/16x16/configng_mascot_v2.0.png is excluded by !**/*.png
  • media_kit/images/16x16/configng_sdk_v2.0.gif is excluded by !**/*.gif
  • media_kit/images/16x16/configng_sdk_v2.0.jpg is excluded by !**/*.jpg
  • media_kit/images/16x16/configng_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/48x48/armbian_font.v2.1.gif is excluded by !**/*.gif
  • media_kit/images/48x48/armbian_font.v2.1.jpg is excluded by !**/*.jpg
  • media_kit/images/48x48/armbian_font.v2.1.png is excluded by !**/*.png
  • media_kit/images/48x48/armbian_mascot_v2.1.gif is excluded by !**/*.gif
  • media_kit/images/48x48/armbian_mascot_v2.1.jpg is excluded by !**/*.jpg
  • media_kit/images/48x48/armbian_mascot_v2.1.png is excluded by !**/*.png
  • media_kit/images/48x48/armbian_sdk_v2.0.gif is excluded by !**/*.gif
  • media_kit/images/48x48/armbian_sdk_v2.0.jpg is excluded by !**/*.jpg
  • media_kit/images/48x48/armbian_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/48x48/configng_font_v1.0.gif is excluded by !**/*.gif
  • media_kit/images/48x48/configng_font_v1.0.jpg is excluded by !**/*.jpg
  • media_kit/images/48x48/configng_font_v1.0.png is excluded by !**/*.png
  • media_kit/images/48x48/configng_mascot_v2.0.gif is excluded by !**/*.gif
  • media_kit/images/48x48/configng_mascot_v2.0.jpg is excluded by !**/*.jpg
  • media_kit/images/48x48/configng_mascot_v2.0.png is excluded by !**/*.png
  • media_kit/images/48x48/configng_sdk_v2.0.gif is excluded by !**/*.gif
  • media_kit/images/48x48/configng_sdk_v2.0.jpg is excluded by !**/*.jpg
  • media_kit/images/48x48/configng_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/512x512/armbian_font.v2.1.gif is excluded by !**/*.gif
  • media_kit/images/512x512/armbian_font.v2.1.jpg is excluded by !**/*.jpg
  • media_kit/images/512x512/armbian_font.v2.1.png is excluded by !**/*.png
  • media_kit/images/512x512/armbian_mascot_v2.1.gif is excluded by !**/*.gif
  • media_kit/images/512x512/armbian_mascot_v2.1.jpg is excluded by !**/*.jpg
  • media_kit/images/512x512/armbian_mascot_v2.1.png is excluded by !**/*.png
  • media_kit/images/512x512/armbian_sdk_v2.0.gif is excluded by !**/*.gif
  • media_kit/images/512x512/armbian_sdk_v2.0.jpg is excluded by !**/*.jpg
  • media_kit/images/512x512/armbian_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/512x512/configng_font_v1.0.gif is excluded by !**/*.gif
  • media_kit/images/512x512/configng_font_v1.0.jpg is excluded by !**/*.jpg
  • media_kit/images/512x512/configng_font_v1.0.png is excluded by !**/*.png
  • media_kit/images/512x512/configng_mascot_v2.0.gif is excluded by !**/*.gif
  • media_kit/images/512x512/configng_mascot_v2.0.jpg is excluded by !**/*.jpg
  • media_kit/images/512x512/configng_mascot_v2.0.png is excluded by !**/*.png
  • media_kit/images/512x512/configng_sdk_v2.0.gif is excluded by !**/*.gif
  • media_kit/images/512x512/configng_sdk_v2.0.jpg is excluded by !**/*.jpg
  • media_kit/images/512x512/configng_sdk_v2.0.png is excluded by !**/*.png
  • media_kit/images/scalable/configng_font_v1.0.svg is excluded by !**/*.svg
  • media_kit/images/scalable/configng_mascot_v2.0.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • media_kit/README.md (3 hunks)
  • media_kit/index.html (4 hunks)
  • media_kit/logos.json (10 hunks)
  • media_kit/media_kit.sh (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: Tearran
PR: Tearran/configng-v2#36
File: src/network/interface/network_manager.sh:46-53
Timestamp: 2025-06-23T18:54:21.952Z
Learning: Tearran prefers heredoc over echo/printf for multi-line templating work, especially for generating dynamic content from metadata. Heredoc provides better readability, easier maintenance, and is more forgiving for complex formatting than chained echo statements.
📚 Learning: 2025-07-16T21:23:23.697Z
Learnt from: Tearran
PR: Tearran/configng-v2#71
File: docs/index.html:312-330
Timestamp: 2025-07-16T21:23:23.697Z
Learning: In configng-v2, docs/index.html is generated from tools/index.html, so when fixing JavaScript logic issues like double-escaping in onclick handlers, the fix must be applied to the source file tools/index.html rather than the generated version in docs/.

Applied to files:

  • media_kit/media_kit.sh
📚 Learning: 2025-06-23T18:16:55.123Z
Learnt from: Tearran
PR: Tearran/configng-v2#36
File: src/network/interface/network_manager.sh:46-53
Timestamp: 2025-06-23T18:16:55.123Z
Learning: In Tearran's CLI tools, help text intentionally shows simplified "command" terminology with only preferred options for UI parsing and integration purposes, while the actual implementation includes additional standard flags (like -h, --help) for bash/shell conventions. This creates an intentional discrepancy between displayed help and full functionality.

Applied to files:

  • media_kit/media_kit.sh
🧬 Code Graph Analysis (1)
media_kit/media_kit.sh (6)
src/system/user/adjust_motd.sh (1)
  • _about_adjust_motd (83-116)
SDK/00_start_here.sh (2)
  • _template_sh (78-149)
  • _template_md (151-183)
staging/plexmediaserver.sh (2)
  • plexmediaserver (6-44)
  • _about_plexmediaserver (46-72)
src/software/management/webmin.sh (1)
  • _about_webmin (6-41)
src/system/kernel/boot_kernel.sh (1)
  • _about_boot_kernel (71-94)
SDK/30_docstring.sh (2)
  • generate_module_docs (75-94)
  • main (178-192)
🔇 Additional comments (2)
media_kit/logos.json (2)

176-192: Legacy entries are correctly marked with empty asset arrays

Legacy items have pngs/gifs/jpgs set to [], which aligns with the new rendering logic. LGTM.


1-17: Confirm the generator emits the same structure (pngs, gifs, jpgs)

The committed manifest includes gifs and jpgs arrays per logo. Ensure _index_json in media_kit.sh emits the exact same keys/shape; otherwise the UI will diverge at runtime.

I’ve also flagged JSON-escaping issues in _index_json; fix that to avoid malformed output when title/desc contain quotes.

Comment on lines +17 to +19
server)
_html_server
;;
Copy link
Contributor

@coderabbitai coderabbitai bot Aug 15, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

server subcommand ignores directory argument

The dispatcher drops the optional DIR argument. Pass it through.

-        server)
-            _html_server
+        server)
+            _html_server "${2:-.}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
server)
_html_server
;;
server)
_html_server "${2:-.}"
;;
🤖 Prompt for AI Agents
In media_kit/media_kit.sh around lines 17-19, the server case currently calls
_html_server without forwarding the optional DIR argument; change the branch so
it shifts past the subcommand and invokes _html_server with the remaining
arguments (e.g., perform a shift then call _html_server "$@") so the DIR (and
any additional args) are passed through to the server handler.

Copy link
Owner Author

Choose a reason for hiding this comment

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

drop as did not seem to work

Copy link
Contributor

Choose a reason for hiding this comment

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

@Tearran, understood! I'll drop that suggestion since it didn't work as expected. Thank you for testing it and providing the feedback.


🧠 Learnings used
Learnt from: Tearran
PR: Tearran/configng-v2#36
File: src/network/interface/network_manager.sh:46-53
Timestamp: 2025-06-23T18:54:21.952Z
Learning: Tearran prefers heredoc over echo/printf for multi-line templating work, especially for generating dynamic content from metadata. Heredoc provides better readability, easier maintenance, and is more forgiving for complex formatting than chained echo statements.

Comment on lines +168 to +174
_index_json() {
OUTPUT="logos.json"
mapfile -t svg_files < <(find "$SVG_DIR" -type f -name "*.svg" | sort -u)

echo "[" > "$OUTPUT"
first=1

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

JSON output is not escaped; titles/descriptions with quotes will break logos.json

title/desc (and even paths) can contain quotes or special chars. Escape JSON strings before writing.

Add a small helper to escape JSON strings:

# Place near the top of the file (outside functions)
json_escape() {
    local s=$1
    s=${s//\\/\\\\}
    s=${s//\"/\\\"}
    s=${s//$'\n'/\\n}
    s=${s//$'\r'/\\r}
    s=${s//$'\t'/\\t}
    printf '%s' "$s"
}

Then update the emitters:

-    echo "    \"name\": \"$name\"," >> "$OUTPUT"
-    echo "    \"category\": \"$category\"," >> "$OUTPUT"
-    echo "    \"svg\": \"$file\"," >> "$OUTPUT"
+    echo "    \"name\": \"$(json_escape "$name")\"," >> "$OUTPUT"
+    echo "    \"category\": \"$(json_escape "$category")\"," >> "$OUTPUT"
+    echo "    \"svg\": \"$(json_escape "$file")\"," >> "$OUTPUT"
@@
-    echo "      \"width\": \"$svg_width\"," >> "$OUTPUT"
-    echo "      \"height\": \"$svg_height\"," >> "$OUTPUT"
-    echo "      \"viewBox\": \"$svg_viewbox\"," >> "$OUTPUT"
-    echo "      \"title\": \"$svg_title\"," >> "$OUTPUT"
-    echo "      \"desc\": \"$svg_desc\"" >> "$OUTPUT"
+    echo "      \"width\": \"$(json_escape "$svg_width")\"," >> "$OUTPUT"
+    echo "      \"height\": \"$(json_escape "$svg_height")\"," >> "$OUTPUT"
+    echo "      \"viewBox\": \"$(json_escape "$svg_viewbox")\"," >> "$OUTPUT"
+    echo "      \"title\": \"$(json_escape "$svg_title")\"," >> "$OUTPUT"
+    echo "      \"desc\": \"$(json_escape "$svg_desc")\"" >> "$OUTPUT"

Also applies to: 204-215, 216-240

🤖 Prompt for AI Agents
In media_kit/media_kit.sh around lines 168-174 (and also apply to 204-215 and
216-240), JSON string values (titles, descriptions, paths) are written raw and
unescaped which will break logos.json when strings contain quotes or special
chars; add a json_escape() helper near the top of the file that escapes
backslashes, double quotes, newlines, carriage returns and tabs, then call that
helper when emitting any JSON string values (wrap the helper output in quotes in
the JSON), replacing direct variable interpolations for title/description/path
with the escaped output to ensure valid JSON.

Comment on lines +349 to +351
cp -r "$SRC_DIR" "images/scalable"

# Generate multi-resolution favicon.ico from chosen SVG
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Copy SVG files into images/scalable without nesting the brand directory

cp -r "$SRC_DIR" "images/scalable" will create images/scalable/brand/, not images/scalable/*.svg as documented.

-cp -r "$SRC_DIR" "images/scalable"
+mkdir -p "images/scalable"
+cp "$SRC_DIR"/*.svg "images/scalable/" 2>/dev/null || true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cp -r "$SRC_DIR" "images/scalable"
# Generate multi-resolution favicon.ico from chosen SVG
mkdir -p "images/scalable"
cp "$SRC_DIR"/*.svg "images/scalable/" 2>/dev/null || true
# Generate multi-resolution favicon.ico from chosen SVG
🤖 Prompt for AI Agents
In media_kit/media_kit.sh around lines 349 to 351, the command cp -r "$SRC_DIR"
"images/scalable" copies the whole brand directory as images/scalable/brand/
instead of placing the SVG files directly under images/scalable as documented;
change the copy to transfer the contents (e.g. cp -r "$SRC_DIR"/.
"images/scalable" or cp "$SRC_DIR"/*.svg "images/scalable") and ensure
images/scalable exists beforehand so the SVG files end up as
images/scalable/*.svg rather than nested in a brand subdirectory.

Comment on lines 17 to 18
./media_kit.sh <command> [options]
```
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fix CLI invocation path: script lives under media_kit/

The README shows ./media_kit.sh, but the script is committed at media_kit/media_kit.sh. Update examples accordingly to avoid confusion.

-./media_kit.sh <command> [options]
+./media_kit/media_kit.sh <command> [options]
@@
-./media_kit.sh icon
-./media_kit.sh index
-./media_kit.sh server
-./media_kit.sh all
+./media_kit/media_kit.sh icon
+./media_kit/media_kit.sh index
+./media_kit/media_kit.sh server
+./media_kit/media_kit.sh all

Also applies to: 66-70

🤖 Prompt for AI Agents
In media_kit/README.md around lines 17-18 (and also update lines 66-70), the CLI
invocation path is incorrect: change occurrences of "./media_kit.sh <command>
[options]" to "media_kit/media_kit.sh <command> [options]" (or
"<repo-root>/media_kit/media_kit.sh" if absolute path is preferred) so the
examples point to the committed script location; update any other README
examples that reference ./media_kit.sh to the correct relative path.

Comment on lines 48 to 51
- Logos starting with `armbian_` are displayed on the left.
- Logos starting with `configng_` are displayed on the right.
- All other images appear in a separate section at the bottom.

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Docs say “other” section exists; HTML doesn’t render it

README promises a section for “all other images,” but index.html currently only renders four sections (armbian, configng, and their legacy variants). Either add “Other” and “Other Legacy” sections in the HTML (recommended), or amend the README.

I’ve proposed HTML changes in media_kit/index.html and media_kit.sh to add the missing sections.

🤖 Prompt for AI Agents
In media_kit/README.md around lines 48 to 51: the README mentions an “All other
images” section that doesn’t exist in the generated HTML; update the site
generation to add "Other" and "Other Legacy" sections (recommended) or change
the README to remove that reference. Modify media_kit/index.html to include two
new headings/containers for Other and Other Legacy and update media_kit.sh to
classify images that do not match armbian_* or configng_* (and their legacy
patterns) into those new sections when building the index; ensure the CSS/layout
matches existing sections and that the script’s image discovery logic/filtering
is updated accordingly.

@Tearran Tearran merged commit 0bc409b into main Aug 15, 2025
3 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Aug 21, 2025
@Tearran Tearran deleted the media_kit branch August 21, 2025 19:49
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.

2 participants