jungvonmatt / wekit

A Jamstack kit for Contentful, Hugo and Netlify.
https://www.wekit.dev
MIT License
14 stars 4 forks source link

Investigate c-icon #74

Open dlemm opened 11 months ago

dlemm commented 11 months ago

In the c-icon there is a not (always) working condition. We should investigate if this is still necessary. In a project svgs sometimes were rendered as an image instead of a svg. I removed it with just use "utils/svg/icon" because there it is also possible to render the icon as an image. The whole c-icon, asset, svg structure and what renders what and when is kind of confusing. We should write a short documentation for it.

{{- with partial "utils/asset" (dict
  "context" $params
  "globals" $globals
  "options" (dict "class_name" $class)
) -}}
  {{- . -}}
{{- else -}}
  {{- partial "utils/svg/icon" (dict
    "context" $params
    "globals" $globals
    "options" (dict "class_name" $class)
  ) -}}
{{- end -}}