2.3 KiB
2.3 KiB
Icon Naming Process
Files Created:
icons.csv- Updated with "icon_name" columnicon_viewer.html- Web interface to view and name iconspopulate_icon_names.js- Script to add names to CSV
Step-by-Step Process:
1. View the Icons
- Open
icon_viewer.htmlin your web browser - You'll see all 138 icons in a grid layout
- Each icon shows its number and has an input field for naming
2. Name the Icons
- Look at each icon and enter appropriate names in the input fields
- The progress counter shows how many you've named
- Names should be descriptive (e.g., "hamburger", "pizza", "coffee", "delivery")
3. Export Named Icons (Optional)
- Click "Export Named Icons" to download a CSV of only the named icons
- This helps you review your naming before finalizing
4. Update the Main CSV
- Edit
populate_icon_names.js - Replace the placeholder names in the
iconNamesarray with your actual names - Run the script:
node populate_icon_names.js
Example Icon Names:
- Food items: "pizza", "burger", "pasta", "salad"
- Drinks: "coffee", "soda", "juice", "beer"
- Categories: "fast_food", "italian", "asian", "desserts"
- Actions: "delivery", "pickup", "favorite", "cart"
Tips:
- Use consistent naming conventions (snake_case or camelCase)
- Keep names short but descriptive
- Group similar icons with consistent prefixes if applicable
- Review all names before running the populate script
The final CSV will have all original columns plus the new "icon_name" column with your custom names.
Import named icons into the database
To insert icons from named_icons.csv into the icons table:
-
Ensure your database is running and
.envin the project root hasDB_HOST,DB_PORT,DB_NAME,DB_USER, andDB_PASS(same as fordump-icons.sh/restore-icons.sh). -
Optional: Set which icon group to attach icons to:
ICON_GROUP_ID(default:01KD7DG4VCTWZRSA54M3PEJ6NW— پک آیکون 1). Use an existingicon_groups.idfrom your DB.
-
From the project root, run:
node dump/import-named-icons.jsThe script reads
dump/named_icons.csv(columns: Index, Name, URL) and inserts one row per URL intoiconswith generated ULID and timestamps. The Name column is not stored (theiconstable has no name column); only URL and group_id are used.