diff --git a/README.md b/README.md index 2cdee04..2a4c42c 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@ The website is styled using the [tailwindcss](https://tailwindcss.com/) pacakge. ## Project Structure -The site runs based on three primary files: +The site runs based on four primary files: -* `index.html`: The main HTML file that provides the structure of the webpage and links to the CSS and JavaScript files, though it still has some manual color/style definitions. -* `style.css`: Custom styling for the application, including color schemes, layout, and animations. - * **Note:** Color defined in `index.html` for specific portions of the site will overwrite those defined in this file. +* `config.js`: **Configuration file** - Contains all customizable settings including organization names, colors, branding, and API settings. This is the main file to edit for personalization. +* `index.html`: The main HTML file that provides the structure of the webpage and links to the CSS and JavaScript files. Config values are applied dynamically from `config.js`. +* `style.css`: Custom styling for the application, including color schemes, layout, and animations. Colors are set via CSS custom properties that are populated from `config.js`. * `main.js`: Handles the application's logic, including API calls, data filtering, sorting, and dynamic rendering of the catalog items. * **Note:** Model API calls do ***not*** return `cardData` unless explicitly fetched *by model*, so there is extra logic required to fetch Model metadata. This was not accounted for until [commit a8d3000](https://github.com/Imageomics/catalog/commit/a8d30009f58a11e708f36d54b9bf4a228bdf1538), as it took updates related to issue #3 to discover. @@ -34,6 +34,50 @@ The site runs based on three primary files: * **Wrap Line Length:** 120 * **Rules:** Remove trailing whitespace and empty tabs. +## How to Use This Template + +This Catalog is set up as a template repository. To build a personalized version of the Catalog, select "Use this Template" at the top of the repo to generate your own version. This will create a new repository (generated from the template repo) that does not share the commit history of the template. Updates can still be added from the template upstream through `git cherry-pick`.[^1] +[^1]: We recommend following the [Git Cherry-pick Guide](https://imageomics.github.io/Collaborative-distributed-science-guide/wiki-guide/Git-Cherry-Pick-Guide/) from the [Collaborative Distributed Science Guide](https://imageomics.github.io/Collaborative-distributed-science-guide/) for those unfamiliar with this process. + +### Personalizing Your Catalog + +Welcome to your new catalog repo! The primary way to personalize this catalog is through the `config.js` file, which contains all customizable settings. After using the template, you'll need to update the following: + +#### Primary Configuration File + +**`config.js`**: This is the main file to edit. It contains all configuration options with inline comments explaining each setting: + +* **Organization & Repository Settings:** + * `ORGANIZATION_NAME`: Your GitHub/Hugging Face organization name (lowercase for API calls) + * `GITHUB_ORG_NAME`: Display name for your organization (can differ from API name) + * `CATALOG_REPO_NAME`: Repository name for the catalog itself (used for stats badge) + +* **Branding:** + * `CATALOG_TITLE`: Page title and main heading + * `CATALOG_DESCRIPTION`: Subtitle/description text displayed under the title + * `LOGO_URL`: URL to your organization's logo image (used in `main.js` line 565) + * `FAVICON_URL`: URL to your favicon image (used in `index.html` line 80) + + For both `LOGO_URL` and `FAVICON_URL`, you can use an external URL, a relative path if the image is in your repo (e.g., `./images/logo.png` or `images/logo.png`), or GitHub's raw URL format (e.g., `https://github.com/username/repo/raw/branch/path/to/image.png`) + +* **Colors:** + * `COLORS.primary`: Primary brand color (used for heading) + * `COLORS.secondary`: Secondary brand color (used for borders, GitHub ribbon) + * `COLORS.accent`: Accent color (used for links, focus states, "New" badge) + * `COLORS.accentDark`: Dark mode accent color (used for link hover states in dark mode) + * `COLORS.tag`: Tag background color + +* **API & Behavior Settings:** + * `API_BASE_URL`: Hugging Face API base URL (default: `"https://huggingface.co/api/"`) + * `REFRESH_INTERVAL_DAYS`: Number of days to consider an item "new" (default: `30`) + * `MAX_ITEMS`: Maximum number of items to fetch per category (default: `100`) + * `FORKED_REPOS`: Array of forked repository names to include (non-forks are included by default). Use `[]` if there are none you wish to include + +* **Typography:** + * `FONT_FAMILY`: Font family for the site (default: `"Inter"`) + +After modifying `config.js`, refresh your browser to see changes. The color scheme will automatically apply to all UI elements throughout the site. + ## Local Testing In the repo root, run diff --git a/config.js b/config.js new file mode 100644 index 0000000..148ac67 --- /dev/null +++ b/config.js @@ -0,0 +1,39 @@ +// Configuration file for Catalog Template +// Customize these values to personalize the catalog for your organization + +const CONFIG = { + // Organization & Repository Settings + ORGANIZATION_NAME: "imageomics", // GitHub/Hugging Face organization name (lowercase for API calls) + GITHUB_ORG_NAME: "Imageomics", // Display name for GitHub organization (can differ from API name) + CATALOG_REPO_NAME: "catalog", // Repository name for the catalog itself (used for stats badge) + + // Branding + CATALOG_TITLE: "Imageomics Catalog", // Page title and main heading + CATALOG_DESCRIPTION: "Explore and discover public code, datasets, models, and spaces.", // Subtitle/description text + LOGO_URL: "https://github.com/Imageomics/Imageomics-guide/raw/3478acc0068a87a5604069d04a29bdb0795c2045/docs/logos/Imageomics_logo_butterfly.png", // Organization logo URL + FAVICON_URL: "https://github.com/Imageomics/Imageomics-guide/raw/3478acc0068a87a5604069d04a29bdb0795c2045/docs/logos/Imageomics_logo_butterfly.png", // Favicon URL + + // Colors (CSS custom properties) + COLORS: { + primary: "#92991c", // Primary brand color (Imageomics Green) + secondary: "#5d8095", // Secondary brand color (Imageomics Blue) + accent: "#0097b2", // Accent color (Dark Teal) + accentDark: "#4fd1eb", // Dark mode accent color (Light Cyan) + tag: "#9bcb5e" // Tag background color (Light Green) + }, + + // API & Behavior Settings + API_BASE_URL: "https://huggingface.co/api/", // Hugging Face API base URL + REFRESH_INTERVAL_DAYS: 30, // Number of days to consider an item "new" + MAX_ITEMS: 100, // Maximum number of items to fetch per category + FORKED_REPOS: [ + // Array of forked repository names to include (non-forks are included by default) + "Fish-Vista", + "PhyloNN", + "telemetry-dashboard", + "docker-workshop" + ], + + // Typography + FONT_FAMILY: "Inter" // Font family for the site +}; diff --git a/index.html b/index.html index d2451c9..11cf272 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,43 @@
-