Skip to content

Commit

Permalink
modules: namespace Core module
Browse files Browse the repository at this point in the history
Hugo does not namespace modules by default, leading to conflicts. Hence, load partials from a namespaced sub-folder to prevent conflicts with similarly named files in other modules.
  • Loading branch information
gcushen committed Nov 1, 2023
1 parent 7b61e2f commit 5f086c6
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 14 deletions.
5 changes: 2 additions & 3 deletions modules/wowchemy/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy/v5
go 1.15

require (
github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-core v0.2.0
github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-seo v0.1.0
github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-core v0.2.1-0.20231101183733-7b61e2f369e6
github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-seo v0.1.1-0.20231101183733-7b61e2f369e6
)

2 changes: 1 addition & 1 deletion modules/wowchemy/layouts/partials/blocks/collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

{{/* Sort */}}
{{ $sort_by := $block.content.sort_by | default "Date" }}
{{ $sort_by = partial "functions/get_sort_by_parameter" $sort_by }}
{{ $sort_by = partial "wowchemy-core/functions/get_sort_by_parameter" $sort_by }}
{{ $sort_ascending := $block.content.sort_ascending | default (eq $block.content.order "asc") | default false }}
{{ $sort_order := cond $sort_ascending "asc" "desc" }}
{{ $query = sort $query $sort_by $sort_order }}
Expand Down
2 changes: 1 addition & 1 deletion modules/wowchemy/layouts/partials/blocks/portfolio.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

{{/* Sort */}}
{{ $sort_by := $block.content.sort_by | default "Date" }}
{{ $sort_by = partial "functions/get_sort_by_parameter" $sort_by }}
{{ $sort_by = partial "wowchemy-core/functions/get_sort_by_parameter" $sort_by }}
{{ $sort_ascending := $block.content.sort_ascending | default (eq $block.content.order "asc") | default false }}
{{ $sort_order := cond $sort_ascending "asc" "desc" }}
{{ $query = sort $query $sort_by $sort_order }}
Expand Down
2 changes: 1 addition & 1 deletion modules/wowchemy/layouts/partials/page_header.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ $page := . }}
{{ $featured := partial "functions/get_featured_image.html" $page }}
{{ $featured := partial "wowchemy-core/functions/get_featured_image.html" $page }}

{{ $anchor := $page.Params.image.focal_point | default "Smart" }}

Expand Down
2 changes: 1 addition & 1 deletion modules/wowchemy/layouts/partials/site_footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<footer class="site-footer">

{{ partial "functions/get_hook" (dict "hook" "footer-start" "context" .) }}
{{ partial "wowchemy-core/functions/get_hook" (dict "hook" "footer-start" "context" .) }}

{{/* Load footer block */}}
{{ $footer_section_name := site.Params.footer.block | default "minimal" }}
Expand Down
6 changes: 3 additions & 3 deletions modules/wowchemy/layouts/partials/site_head.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{ end }}

{{/* EXTENSIBILITY HOOK: HEAD-START */}}
{{ partial "functions/get_hook" (dict "hook" "head-start" "context" .) }}
{{ partial "wowchemy-core/functions/get_hook" (dict "hook" "head-start" "context" .) }}

{{/* Parse theme and font */}}
{{ partial "functions/parse_theme" . }}
Expand Down Expand Up @@ -210,13 +210,13 @@

{{ partial "cookie_consent" . }}

{{ $title := partial "functions/get_page_title" . }}
{{ $title := partial "wowchemy-core/functions/get_page_title" . }}
<title>{{$title}}</title>

{{/* EXTENSIBILITY HOOK: HEAD-END */}}
{{/* Deprecated custom_head hook */}}
{{ if templates.Exists "partials/custom_head.html" }}
{{ partial "custom_head" . }}
{{ end }}
{{ partial "functions/get_hook" (dict "hook" "head-end" "context" .) }}
{{ partial "wowchemy-core/functions/get_hook" (dict "hook" "head-end" "context" .) }}
</head>
2 changes: 1 addition & 1 deletion modules/wowchemy/layouts/partials/site_js.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,4 @@
{{ if templates.Exists "partials/custom_js.html" }}
{{ partial "custom_js" . }}
{{ end }}
{{ partial "functions/get_hook" (dict "hook" "body-end" "context" .) }}
{{ partial "wowchemy-core/functions/get_hook" (dict "hook" "body-end" "context" .) }}
2 changes: 1 addition & 1 deletion modules/wowchemy/layouts/partials/views/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{{ partial "page_metadata" (dict "page" $item "is_list" 1) }}
{{ end }}

{{ $resource := partial "functions/get_featured_image.html" $item }}
{{ $resource := partial "wowchemy-core/functions/get_featured_image.html" $item }}
{{ $anchor := $item.Params.image.focal_point | default "Smart" }}
{{ with $resource }}
{{ $image := .Fill (printf "808x455 %s" $anchor) }}
Expand Down
2 changes: 1 addition & 1 deletion modules/wowchemy/layouts/partials/views/compact.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

</div>
<div class="ml-3">
{{ $resource := partial "functions/get_featured_image.html" $item }}
{{ $resource := partial "wowchemy-core/functions/get_featured_image.html" $item }}
{{ with $resource }}
{{ $image := .Resize "150x" }}
{{ if ne $image.MediaType.SubType "gif" }}{{ $image = $image.Process "webp" }}{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion modules/wowchemy/layouts/partials/views/showcase.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

</div>
<div class="col-12 col-md-6 order-first {{$order}}">
{{ $resource := partial "functions/get_featured_image.html" $item }}
{{ $resource := partial "wowchemy-core/functions/get_featured_image.html" $item }}

{{ with $resource }}
{{/* Use CSS to expand images to consistent widths rather than just Hugo as Hugo can significantly increase the
Expand Down

0 comments on commit 5f086c6

Please sign in to comment.