mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-06 22:14:55 +00:00
modules: namespace Core module
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.
This commit is contained in:
1 parent
53a94b591e
commit
7b61e2f369
8 files changed
+36
-23
No files matched your search
@@ -2,6 +2,4 @@ module github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-reveal
|
||||
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-core v0.1.0
|
||||
)
|
||||
require github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-core v0.2.1-0.20231101183355-53a94b591ea8
|
||||
@@ -16,8 +16,8 @@
|
||||
<link rel="manifest" href="{{ .RelPermalink }}">
|
||||
{{ end }}
|
||||
|
||||
<link rel="icon" type="image/png" href="{{(partial "functions/get_icon" 32).RelPermalink}}">
|
||||
<link rel="apple-touch-icon" type="image/png" href="{{(partial "functions/get_icon" 192).RelPermalink}}">
|
||||
<link rel="icon" type="image/png" href="{{(partial "wowchemy-core/functions/get_icon" 32).RelPermalink}}">
|
||||
<link rel="apple-touch-icon" type="image/png" href="{{(partial "wowchemy-core/functions/get_icon" 192).RelPermalink}}">
|
||||
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
|
||||
|
||||
@@ -2,6 +2,4 @@ module github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-seo
|
||||
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-core v0.1.0
|
||||
)
|
||||
require github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-core v0.2.1-0.20231101183355-53a94b591ea8
|
||||
@@ -7,11 +7,11 @@
|
||||
"theme_color": "{{ $theme_color }}",
|
||||
"background_color": "{{ $theme_color }}",
|
||||
"icons": [{
|
||||
"src": "{{ (partial "functions/get_icon" 192).RelPermalink }}",
|
||||
"src": "{{ (partial "wowchemy-core/functions/get_icon" 192).RelPermalink }}",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
}, {
|
||||
"src": "{{ (partial "functions/get_icon" 512).RelPermalink }}",
|
||||
"src": "{{ (partial "wowchemy-core/functions/get_icon" 512).RelPermalink }}",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{- $page := .page }}
|
||||
{{ $summary := .summary }}
|
||||
{{ $featured_image := partial "functions/get_featured_image.html" $page }}
|
||||
{{ $featured_image := partial "wowchemy-core/functions/get_featured_image.html" $page }}
|
||||
|
||||
{{/* Get schema type. */}}
|
||||
{{ $schema := "Article" }}
|
||||
@@ -8,9 +8,9 @@
|
||||
{{ $schema = "BlogPosting" }}
|
||||
{{ end }}
|
||||
|
||||
{{ $author := partial "functions/get_author_name" $page }}
|
||||
{{ $author := partial "wowchemy-core/functions/get_author_name" $page }}
|
||||
{{ $publisher := site.Params.marketing.seo.org_name | default site.Title }}
|
||||
{{ $logo_url := partial "functions/get_logo_url" $page -}}
|
||||
{{ $logo_url := partial "wowchemy-core/functions/get_logo_url" $page -}}
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"@type": {{site.Params.marketing.seo.site_type | default site.Params.marketing.seo.site_type}},
|
||||
"@id": {{site.BaseURL}},
|
||||
"name": {{site.Params.marketing.seo.org_name | default site.Title}},
|
||||
"logo": {{ partial "functions/get_logo_url" . }},
|
||||
"logo": {{ partial "wowchemy-core/functions/get_logo_url" . }},
|
||||
{{with $sharing_image}}"image": {{.Permalink}},{{end}}
|
||||
{{ if (eq site.Params.marketing.seo.site_type "LocalBusiness") | and site.Params.marketing.seo.coordinates }}
|
||||
"geo": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{ $page := .page }}
|
||||
{{ $summary := .summary }}
|
||||
{{ $featured_image := partial "functions/get_featured_image.html" $page }}
|
||||
{{ $author := partial "functions/get_author_name" $page }}
|
||||
{{ $featured_image := partial "wowchemy-core/functions/get_featured_image.html" $page }}
|
||||
{{ $author := partial "wowchemy-core/functions/get_author_name" $page }}
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
{{- end -}}
|
||||
|
||||
{{/* Attempt to load superuser (the main site author). */}}
|
||||
{{ $superuser := index (first 1 (where (where site.Pages "Section" "authors") "Params.superuser" true)) 0 }}
|
||||
{{ $superuser_name := "" }}
|
||||
{{ $superuser_username := "" }}
|
||||
{{ $superuser_role := "" }}
|
||||
{{ range first 1 (where (where site.Pages "Section" "authors") "Params.superuser" true) }}
|
||||
{{ with $superuser }}
|
||||
{{ $superuser_name = .Title }}
|
||||
{{ $superuser_username = path.Base .File.Dir }}
|
||||
{{ $superuser_role = .Params.role }}
|
||||
@@ -50,15 +51,15 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Progressive Web App (PWA) Icon */}}
|
||||
<link rel="icon" type="image/png" href="{{ (partial "functions/get_icon" 32).RelPermalink }}" />
|
||||
<link rel="apple-touch-icon" type="image/png" href="{{ (partial "functions/get_icon" 180).RelPermalink }}" />
|
||||
<link rel="icon" type="image/png" href="{{ (partial "wowchemy-core/functions/get_icon" 32).RelPermalink }}" />
|
||||
<link rel="apple-touch-icon" type="image/png" href="{{ (partial "wowchemy-core/functions/get_icon" 180).RelPermalink }}" />
|
||||
{{ $theme_color := ($scr.Get "primary") | default site.Params.appearance.primary_color | default "#fff" }}
|
||||
<meta name="theme-color" content="{{ $theme_color }}" />
|
||||
|
||||
{{/* Get page image for social sharing. */}}
|
||||
{{ $sharing_image := resources.GetMatch (path.Join "media" "sharing.*") }}
|
||||
{{/* Search for an image "*featured*" in post folder */}}
|
||||
{{ $featured_image := partial "functions/get_featured_image.html" . }}
|
||||
{{ $featured_image := partial "wowchemy-core/functions/get_featured_image.html" . }}
|
||||
{{ $avatar_image := (.Resources.ByType "image").GetMatch "avatar*" }}
|
||||
{{ $has_logo := fileExists "assets/media/logo.png" | or (fileExists "assets/media/logo.svg") }}
|
||||
{{ $og_image := "" }}
|
||||
@@ -72,15 +73,15 @@
|
||||
{{ else if $sharing_image }}
|
||||
{{ $og_image = $sharing_image.Permalink }}
|
||||
{{ else if $has_logo }}
|
||||
{{ $og_image = (partial "functions/get_logo" (dict "constraint" "fit" "size" 300)).Permalink }}
|
||||
{{ $og_image = (partial "wowchemy-core/functions/get_logo" (dict "constraint" "fit" "size" 300)).Permalink }}
|
||||
{{ $twitter_card = "summary" }}
|
||||
{{ else }}
|
||||
{{ $og_image = (partial "functions/get_icon" 512).Permalink }}
|
||||
{{ $og_image = (partial "wowchemy-core/functions/get_icon" 512).Permalink }}
|
||||
{{ $twitter_card = "summary" }}
|
||||
{{ end }}
|
||||
{{ $scr.Set "og_image" $og_image }}{{/* Set `og_image` globally for `rss.xml`. */}}
|
||||
|
||||
{{ $title := partial "functions/get_page_title" . }}
|
||||
{{ $title := partial "wowchemy-core/functions/get_page_title" . }}
|
||||
|
||||
{{/* Twitter metadata. */}}
|
||||
<meta property="twitter:card" content="{{ $twitter_card }}" />
|
||||
@@ -93,6 +94,22 @@
|
||||
{{- end -}}
|
||||
|
||||
{{/* Open Graph metadata. */}}
|
||||
{{ $site_type := lower (site.Params.marketing.seo.site_type | default "Person") }}
|
||||
{{ $og_type := "website" }}
|
||||
{{ if .IsHome }}
|
||||
{{ if eq $site_type "person" }}
|
||||
{{ $og_type = "profile" }}
|
||||
{{ with $superuser.Params.first_name }}<meta property="profile:first_name" content="{{ . }}">{{end}}
|
||||
{{ with $superuser.Params.last_name }}<meta property="profile:last_name" content="{{ . }}">{{end}}
|
||||
{{ else }}
|
||||
{{ $og_type = "website" }}
|
||||
{{ end }}
|
||||
{{ else if .IsPage | and (in (slice "post" "publication" "project" "book") .Type ) }}
|
||||
{{ $og_type = "article" }}
|
||||
{{ else }}
|
||||
{{ $og_type = "website" }}
|
||||
{{ end }}
|
||||
<meta property="og:type" content="{{ $og_type }}" />
|
||||
<meta property="og:site_name" content="{{ site.Title }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
<meta property="og:title" content="{{ $title }}" />
|
||||
|
||||
Reference in new issue
Block a user