Skip to main content

Public Logo CDN Setup

This guide shows how to upload a logo (SVG or PNG) to the cdn repository so it can be served as a public CDN asset. Since everyone on the team has write access, you can upload directly without forking.

Why This Matters

  • Stack Component Icon Issue: The Stack Component page currently cannot display icons for newly uploaded SVG or PNG files.
  • Ephemeral URLs: GitHub no longer generates direct public URLs for images uploaded in comments or issues. Now, it generates links like https://private-user-images.githubusercontent.com/..., which are restricted and may expire.
  • Inconsistent Access: These URLs are not reliable for documentation or production use since they can change or stop working over time.

To ensure consistency and reliability, we host public logos directly in our repository and access them via GitHub's raw CDN.

Prerequisites

  • Write access to the CDN repository (no fork needed).
  • Git installed and configured with your GitHub credentials.

Icon Requirements

  • File Format: Prefer SVG for sharp, scalable logos. PNG files also work.
  • File Naming: Use lowercase letters with hyphens (e.g., my-company-logo.svg) for consistency.
  • Updates: When updating the logo, the URL remains unchanged. Simply open a new PR to overwrite the existing file.

Follow the steps below to upload a logo and use it as a CDN asset.

  1. Clone the repository and create a feature branch

    git clone https://github.com/devsentient/cdn.git
    cd cdn
    git checkout -b add-my-logo
  2. Copy your logo into the repository

    cp ~/Downloads/my-logo.svg stack-component-logos/
  3. Commit and push your changes

    git add stack-component-logos/my-logo.svg
    git commit -m "Add my logo to stack-component-logos"
    git push -u origin add-my-logo
  4. Open a pull request

    Go to https://github.com/devsentient/cdn/pulls and open a new PR from add-my-logo into main.
    Provide a clear title and description so reviewers understand the change.

  5. Merge and Publish

    Once your PR is merged, your logo will be publicly accessible at:

    https://github.com/devsentient/cdn/blob/main/stack-component-logos/my-logo.svg
  6. Get the Raw URL

    When you view the file on GitHub, you'll see a Raw button near the top right of the file preview. Clicking it will load the file’s contents directly (with the browser URL updated):

    https://raw.githubusercontent.com/devsentient/cdn/main/stack-component-logos/my-logo.svg

    This is the URL you should use for embedding the image as a CDN asset.


Tips

  • Prefer SVG for crisp, infinitely‑scalable logos. PNG also works.
  • If you ever update the file, the URL stays the same—just overwrite the asset in a new PR.
  • Keep filenames lowercase and hyphen‑separated for consistency (e.g., my-company-logo.svg).