Skip to content

Commit

Permalink
chore: add a deprecated warning message for preview_styles parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Dec 3, 2023
1 parent 64cba79 commit cde1a18
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/decap-cms/init.js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
{{- $css := resources.Get "decap-cms/scss/index.scss" }}
{{- $css = $css | toCSS (dict "targetPath" "css/decap-cms.css" "outputStyle" (cond hugo.IsProduction "compressed" "")) }}
{{- printf `CMS.registerPreviewStyle("%s");` $css.Permalink }}
{{/* TODO: remove preview_styles in future versions. */}}
{{- if isset site.Params.decap_cms "preview_styles" }}
{{- warnf `[decap-cms] the "preview_styles" is deprecated, rename it to "_preview_styles" instead.` }}
{{- end }}
{{- range default slice (default site.Params.decap_cms._preview_styles site.Params.decap_cms.preview_styles) }}
{{- printf `CMS.registerPreviewStyle("%s");` (absURL .) }}
{{- end }}
Expand Down

0 comments on commit cde1a18

Please sign in to comment.