From 1745c99ab8bb525f8ead4431016f9907f974ec47 Mon Sep 17 00:00:00 2001 From: razonyang Date: Mon, 19 Jun 2023 16:36:09 +0800 Subject: [PATCH] feat: add the full_width parameter to take full width --- hugo.toml | 4 ++++ .../hugopress/modules/hb-blog/attributes/hb-main.html | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 layouts/partials/hugopress/modules/hb-blog/attributes/hb-main.html diff --git a/hugo.toml b/hugo.toml index 1d94e648..1f7d7922 100644 --- a/hugo.toml +++ b/hugo.toml @@ -19,10 +19,14 @@ path = "github.com/hugomods/icons/vendors/bootstrap" [[module.imports]] path = "github.com/hugomods/images" +[params.hugopress.modules.hb-blog.attributes.hb-main] +cacheable = true + [params.hb.terms] paginate = 9 [params.hb.blog] +full_width = false paginate = 12 post_date_format = ':date_long' post_thumbnail = true diff --git a/layouts/partials/hugopress/modules/hb-blog/attributes/hb-main.html b/layouts/partials/hugopress/modules/hb-blog/attributes/hb-main.html new file mode 100644 index 00000000..dfc4e83a --- /dev/null +++ b/layouts/partials/hugopress/modules/hb-blog/attributes/hb-main.html @@ -0,0 +1,5 @@ +{{- $class := "hb-main container" }} +{{- if site.Params.hb.blog.full_width }} + {{- $class = "hb-main container-fluid" }} +{{- end }} +{{- return dict "class" $class }}