Copy Repo Button Customization
About 251 wordsLess than 1 minute
Customize the appearance of the Copy Repo button to make your template repository more appealing.
Use Cases
Customize the Copy Repo button for template or example repositories, guide users to quickly copy the repository, and enhance user experience with personalized hover images.
Prerequisites
The "Copy Repo" button is not displayed by default on the repository homepage. To enable it, add the example tag in the repository description editor on the right side of the homepage. It is recommended for template or example repositories.
Clicking this button provides a quick way to copy the repository.
Configuration
Add the copyRepo configuration to .cnb/settings.yml:
.cnb/settings.yml
# Copy Repo button configuration, reads the .cnb/settings.yml configuration from the repository's default branch
copyRepo:
# Customize the "Copy Repo" button
button:
# Button description
description: Your repo is great, now it's mine
# Image displayed on hover
# 1. Use images from the repository's default branch, specify the path relative to the repository root directory, e.g., .cnb/copy-hover.png;
# 2. Use the raw file address under the current domain name, for example: https://cnb.cool/my/test/-/git/raw/main/.cnb/copy-hover.png
# Maximum image size: 10MB
hoverImage: ".cnb/copy-hover.png"Parameter Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
copyRepo.button.description | string | - | The description text of the Copy Repo button |
copyRepo.button.hoverImage | string | - | Image displayed on hover. Supports repository relative path or raw URL, max 10MB |