Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Food group slugs contain special characters #83

Open
oliverroick opened this issue Oct 22, 2024 · 0 comments
Open

Food group slugs contain special characters #83

oliverroick opened this issue Oct 22, 2024 · 0 comments

Comments

@oliverroick
Copy link
Collaborator

The slugs for food groups contain special characters so they can't be used in CSS classes in the frontend.

           name           |           slug           
--------------------------+--------------------------
 Vegetable Oils           | vegetable_oils
 Meat                     | meat
 Spices                   | spices
 Pulses                   | pulses
 Fruits - Excluding Wine  | fruits_-_excluding_wine
 Fish, Seafood            | fish,_seafood
 Sweetners                | sweetners
 Starchy Roots            | starchy_roots
 Alcoholic Beverages      | alcoholic_beverages
 Animal Fats              | animal_fats
 Stimulants               | stimulants
 Treenuts                 | treenuts
 Milk - Excluding Butter  | milk_-_excluding_butter
 Vegetables               | vegetables
 Offals                   | offals
 Eggs                     | eggs
 Cereals - Excluding Beer | cereals_-_excluding_beer
 Oilcrops                 | oilcrops
 Sugar Crops              | sugar_crops
 Fruits, other            | fruits,_other

To make the slugs compatible with CSS naming conventions, I suggest to:

  • Convert to lowercase
  • Remove all special characters
  • Replace white spaces with n-dashes (-)
  • Conflate any subsequent n-dashes to just one

For example:

  • Fruits - Excluding Wine becomes fruits-excluding-wine
  • Fish, Seafood becomes fish-seafood
  • Milk - Excluding Butter becomes milk-excluding-butter
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

No branches or pull requests

1 participant