diff --git a/modules/sidebar/profile/assets/hb/modules/blog-sidebar-profile/scss/index.scss b/modules/sidebar/profile/assets/hb/modules/blog-sidebar-profile/scss/index.scss new file mode 100644 index 00000000..072d98a9 --- /dev/null +++ b/modules/sidebar/profile/assets/hb/modules/blog-sidebar-profile/scss/index.scss @@ -0,0 +1,4 @@ +.hb-blog-sidebar-profile-img { + height: #{$hb-blog-sidebar-profile-avatar-size}px; + width: #{$hb-blog-sidebar-profile-avatar-size}px; +} diff --git a/modules/sidebar/profile/assets/hb/modules/blog-sidebar-profile/scss/variables.tmpl.scss b/modules/sidebar/profile/assets/hb/modules/blog-sidebar-profile/scss/variables.tmpl.scss new file mode 100644 index 00000000..ad9b934e --- /dev/null +++ b/modules/sidebar/profile/assets/hb/modules/blog-sidebar-profile/scss/variables.tmpl.scss @@ -0,0 +1,2 @@ +{{- $params := site.Params.hb.blog.sidebar.profile }} +$hb-blog-sidebar-profile-avatar-size: {{ default 100 $params.avatar_size }}; diff --git a/modules/sidebar/profile/go.mod b/modules/sidebar/profile/go.mod new file mode 100644 index 00000000..766243d9 --- /dev/null +++ b/modules/sidebar/profile/go.mod @@ -0,0 +1,3 @@ +module github.com/hbstack/blog/modules/sidebar/profile + +go 1.19 diff --git a/modules/sidebar/profile/hugo.toml b/modules/sidebar/profile/hugo.toml new file mode 100644 index 00000000..700bb686 --- /dev/null +++ b/modules/sidebar/profile/hugo.toml @@ -0,0 +1,20 @@ +[[module.imports]] +path = "github.com/hbstack/blog" + +[[module.imports]] +path = "github.com/hbstack/socials" + +[[module.imports]] +path = "github.com/hugomods/icons/vendors/bootstrap" + +[params.hugopress.modules.hb-blog-sidebar-profile.hooks.hb-blog-sidebar] +cacheable = true +weight = 1 + +[params.hb.blog.sidebar.profile] +avatar = "/images/logo.png" +avatar_size = 100 +title = "" # default to site title. +description = "" # default to site description. +company = "" +location = "" diff --git a/modules/sidebar/profile/layouts/partials/hugopress/modules/hb-blog-sidebar-profile/hooks/hb-blog-sidebar.html b/modules/sidebar/profile/layouts/partials/hugopress/modules/hb-blog-sidebar-profile/hooks/hb-blog-sidebar.html new file mode 100644 index 00000000..909e7ddd --- /dev/null +++ b/modules/sidebar/profile/layouts/partials/hugopress/modules/hb-blog-sidebar-profile/hooks/hb-blog-sidebar.html @@ -0,0 +1,52 @@ +{{- with site.Params.hb.blog.sidebar.profile }} +
+ {{- $avatarSize := default 100 .avatar_size }} + {{- with .avatar }} + {{ partial "images/image" (dict + "Filename" (printf "%s?height=%d&width=%d" . $avatarSize) + "ClassName" "hb-blog-sidebar-profile-img rounded-circle img-fluid mb-3") + }} + {{- end }} +

+ {{ default site.Title .title | markdownify }} +

+

+ {{ default site.Params.description .description | markdownify }} +

+

+ {{- with .company }} + + {{- partial "icons/icon" (dict "vendor" "bootstrap" "name" "building" "className" "me-1") -}} + {{- . | markdownify -}} + + {{- end }} + {{- with .location }} + + {{- partial "icons/icon" (dict "vendor" "bootstrap" "name" "geo-alt" "className" "me-1") -}} + {{- . | markdownify -}} + + {{- end }} +

+ {{- with .socials }} + {{- $color := default true ._color }} + + {{- end }} +
+{{- end }} diff --git a/release-please-config.json b/release-please-config.json index 4ec5514b..32061a22 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -47,6 +47,9 @@ "modules/sidebar/posts": { "component": "modules/sidebar/posts" }, + "modules/sidebar/profile": { + "component": "modules/sidebar/profile" + }, "modules/sidebar/taxonomies": { "component": "modules/sidebar/taxonomies" },