feat: update block config

For arrival of v2 block system.

Close #2883
This commit is contained in:
George Cushen committed 2022-11-26 20:50:09 +00:00
1 parent 45466f563a
commit 712c955024
3 files changed
+12 -11

No files matched your search

+3 -2
View File
@@ -11,9 +11,10 @@
<section id="profile-page" class="pt-5">
<div class="container">
{{/* Show the About widget if an account exists for this user. */}}
{{/* Show the About block if an account exists for this user. */}}
{{/* TODO: remove dependency on v1 blocks. Either migrate to v2 blocks(?) or directly implement layout here. */}}
{{ if .File }}
{{ $widget := "blocks/about.html" }}
{{ $widget := "blocks/v1/about.html" }}
{{ $username := (path.Base .File.Dir) }}{{/* Alternatively, use `index .Params.authors 0` */}}
{{ $params := dict "wcPage" $ "wcBlock" . "author" $username }}
{{ partial $widget $params }}
@@ -1,4 +1,4 @@
{{/* Wowchemy Block Parser */}}
{{/* Wowchemy Block Parser v1 */}}
{{/* Documentation: https://wowchemy.com/blocks/ */}}
{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}}
@@ -101,8 +101,8 @@
{{ $widget_class := printf "wg-%s" (replace (replace $block_type "." "-") "_" "-") }}
{{ $widget_config_file := printf "blocks/%s-config.html" $block_type }}
{{ if templates.Exists $widget_config_file }}
{{ $widget_config_file := printf "blocks/v1/%s-config.html" $block_type }}
{{ if templates.Exists (printf "partials/%s" $widget_config_file) }}
{{ $cfg := partial $widget_config_file $widget_args }}
{{ $use_container = $cfg.use_container }}
{{end}}
@@ -1,4 +1,4 @@
{{/* Wowchemy Block Parser */}}
{{/* Wowchemy Block Parser v2 */}}
{{/* Documentation: https://wowchemy.com/blocks/ */}}
{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}}
@@ -87,6 +87,8 @@
{{ $css_classes := $block.design.css_class | default $block.Params.advanced.css_class | default "" }}
{{ $extra_attributes := "" }}
{{ $use_container := true }}
{{ $columns := $block.design.columns | default "1" }}
{{ $use_cols := in (slice "collection" "experience" "accomplishments" "contact" "markdown" "tag_cloud" "portfolio") $block_type }}
{{/* Special case: Slider widget. */}}
{{ if in (slice "slider") $block_type }}
@@ -98,14 +100,12 @@
{{ $widget_class := printf "wg-%s" (replace (replace $block_type "." "-") "_" "-") }}
{{ $widget_config_file := printf "blocks/%s-config.html" $block_type }}
{{ if templates.Exists $widget_config_file }}
{{ if templates.Exists (printf "partials/%s" $widget_config_file) }}
{{ $cfg := partial $widget_config_file $widget_args }}
{{ $use_container = $cfg.use_container }}
{{ with $cfg.use_container }}{{ $use_container = . }}{{ end }}
{{ with $cfg.inject_section_heading }}{{ $use_cols = . }}{{ end }}
{{end}}
{{ $columns := $block.design.columns | default "2" }}
{{ $use_cols := in (slice "collection" "experience" "accomplishments" "contact" "markdown" "tag_cloud" "portfolio") $block_type }}
{{/* Dedicated child div for bg prevents parallax 100% height issue within new CSS grid page wrapper. */}}
<section id="{{$hash_id}}" class="home-section {{$widget_class}} {{if $bg.text_color_light}}dark{{else if (eq $bg.text_color_light false)}}light{{end}} {{with $css_classes}}{{.}}{{end}}" {{with $style}}style="{{. | safeCSS}}"{{end}} {{print $extra_attributes | safeHTMLAttr}}>
<div class="home-section-bg {{if $bg.image}} bg-image{{if ($bg.image.parallax | default true) }} parallax{{end}}{{end}}" {{with $style_bg}}style="{{. | safeCSS}}"{{end}}>