Compare commits

...

3 commits

Author SHA1 Message Date
George Cushen 190577cbbe starters(blog): show BiliBili example 2023-12-29 23:38:24 +00:00
George Cushen b290b27077 feat(tailwind): port custom.css feature
Also:

-improve BiliBili shortcode responsive style
-prefix resume blox names in backwards compatible way
-use blox-analytics
-rename module config.yaml to hugo.yaml
2023-12-29 23:34:33 +00:00
George Cushen 1bc54d5d14 feat: port analytics to blox-analytics 2023-12-29 22:59:55 +00:00
37 changed files with 122 additions and 47 deletions

View file

@ -0,0 +1,27 @@
# blox-analytics
**A Hugo module (plugin) for website analytics and search engine verification.**
Are you using the `blox-tailwind` module? The analytics module is already included, so you do not need to install it. For all other sites, refer to the installation guide below.
## Install
Get analytics and verification for your Hugo site by following the guide below:
1. Add the module to your `config/_default/hugo.yaml`:
```yaml
module:
imports:
- path: github.com/HugoBlox/hugo-blox-builder/modules/blox-analytics
```
2. Load the module in your site's `<head>` with:
```go
{{ partial "blox_analytics/index" . }}
```
## Usage
[View the documentation](https://docs.hugoblox.com/reference/analytics/)

View file

@ -0,0 +1,3 @@
module github.com/HugoBlox/hugo-blox-builder/modules/blox-analytics
go 1.15

View file

@ -0,0 +1,4 @@
module:
mounts:
- source: layouts
target: layouts

View file

@ -0,0 +1,9 @@
{{/* HUGO BLOX: MARKETING MODULE */}}
{{/* VERIFICATIONS */}}
{{ partial "blox-analytics/verification" . }}
{{/* ANALYTICS */}}
{{ partial "blox-analytics/services/index" . }}

View file

@ -0,0 +1,7 @@
{{ partial "blox-analytics/services/google_analytics" . }}
{{ partial "blox-analytics/services/google_tag_manager" . }}
{{ partial "blox-analytics/services/microsoft_clarity" . }}
{{ partial "blox-analytics/services/baidu_tongji" . }}
{{ partial "blox-analytics/services/plausible" . }}
{{ partial "blox-analytics/services/fathom" . }}
{{ partial "blox-analytics/services/pirsch" . }}

View file

@ -0,0 +1,21 @@
{{/* Site Verification with Third Party Services */}}
{{- with site.Params.marketing.verification.google -}}
<meta name="google-site-verification" content="{{ . }}" />
{{- end -}}
{{- with site.Params.marketing.verification.bing -}}
<meta name="msvalidate.01" content="{{ . }}" />
{{- end -}}
{{- with site.Params.marketing.verification.yandex -}}
<meta name="yandex-verification" content="{{ . }}" />
{{- end -}}
{{- with site.Params.marketing.verification.pinterest -}}
<meta name="p:domain_verify" content="{{ . }}" />
{{- end -}}
{{- with site.Params.marketing.verification.baidu -}}
<meta name="baidu-site-verification" content="{{ . }}" />
{{- end -}}

View file

@ -1,4 +1,4 @@
.blox-biography {
.blox-resume-biography {
#profile {
text-align: center;
padding: 30px 10px;
@ -76,8 +76,6 @@
/* color: rgba(0, 0, 0, 0.6); */
}
.network-icon .big-icon {
font-size: 1.5rem;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,11 @@
renames:
- old: awards
new: resume-awards
- old: biography
new: resume-biography
- old: experience
new: resume-experience
- old: languages
new: resume-languages
- old: skills
new: resume-skills

View file

@ -1,3 +1,5 @@
module github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind
go 1.19
require github.com/HugoBlox/hugo-blox-builder/modules/blox-analytics v0.1.0

View file

@ -26,6 +26,8 @@ module:
hugoVersion:
min: '0.119.0'
extended: true
imports:
- path: github.com/HugoBlox/hugo-blox-builder/modules/blox-analytics
mounts:
- source: content
target: content

View file

@ -5,7 +5,10 @@
{{ $page := .page }}
{{ $block := .block }}
{{ $block_type := lower $block.block | default "markdown" }}
{{ $block_type := lower ($block.blox | default $block.block) | default "markdown" }}
{{ range $r := site.Data.blox_aliases.renames }}
{{ $block_type = cond (eq $block_type $r.old) $r.new $block_type }}
{{ end }}
{{ $block_path := printf "blox/%s.html" $block_type }}
{{ if not (templates.Exists (printf "partials/%s" $block_path)) }}
{{ errorf "%s uses a `%s` block but the `%s` block was not found at `layouts/partials/%s`" $block.File.Path $block_type $block_type $block_path }}

View file

@ -53,7 +53,7 @@
{{/* Mermaid */}}
{{ if (.Page.Store.Get "has_mermaid") }}
{{ $mermaid_js := resources.Get "dist/lib/mermaid/mermaid.min.js" }}
{{ $mermaid_config_js := resources.Get "js/wowchemy-mermaid-config.js" }}
{{ $mermaid_config_js := resources.Get "js/hb-mermaid-config.js" }}
{{ $mermaid_config_js = $mermaid_config_js | resources.Minify }}
{{ $mermaid_bundle := slice $mermaid_js $mermaid_config_js | resources.Concat "js/mermaid.bundle.js" | resources.Fingerprint "sha256" }}
<script defer src="{{ $mermaid_bundle.RelPermalink }}" integrity="{{ $mermaid_bundle.Data.Integrity }}"></script>

View file

@ -1,25 +0,0 @@
{{/* HUGO BLOX: MARKETING MODULE */}}
{{/* VERIFICATIONS */}}
{{ with site.Params.marketing.verification.google }}
<meta name="google-site-verification" content="{{ . }}" />
{{- end -}}
{{ with site.Params.marketing.verification.baidu }}
<meta name="baidu-site-verification" content="{{ . }}" />
{{- end -}}
{{ with site.Params.marketing.verification.bing }}
<meta name="msvalidate.01" content="{{ . }}" />
{{- end -}}
{{/* ANALYTICS */}}
{{ partial "marketing/google_analytics" . }}
{{ partial "marketing/google_tag_manager" . }}
{{ partial "marketing/microsoft_clarity" . }}
{{ partial "marketing/baidu_tongji" . }}
{{ partial "marketing/plausible" . }}
{{ partial "marketing/fathom" . }}
{{ partial "marketing/pirsch" . }}

View file

@ -69,6 +69,11 @@
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
{{ end }}
{{ if fileExists "assets/css/custom.css" }}
{{ $styles := resources.Get "css/custom.css" | minify | fingerprint "sha256" }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
{{ end }}
<script>
/* Hugo Blox JS Global Init */
window.hbb = {
@ -118,8 +123,8 @@
});
</script>
{{/* Marketing */}}
{{ partial "marketing/index" . }}
{{/* Analytics & Verification */}}
{{ partial "blox-analytics/index" . }}
{{/* RSS Feed */}}
{{ with .OutputFormats.Get "RSS" }}
@ -243,9 +248,9 @@
{{ $js_bundle_head := $js_license | resources.FromString "js/bundle-head.js" }}
{{ $i18n := dict "copy" (i18n "btn_copy") "copied" (i18n "btn_copied" | default "Copied") }}
{{ $js_params := dict "hugoEnvironment" hugo.Environment "i18n" $i18n }}
{{ $js_academic := resources.Get "js/wowchemy-code-copy.js" | js.Build (dict "targetPath" (printf "js/wow-core-%s.js" .Lang ) "params" $js_params) }}
{{ $js_academic := resources.Get "js/hb-code-copy.js" | js.Build (dict "targetPath" (printf "js/wow-core-%s.js" .Lang ) "params" $js_params) }}
{{ $js_academic := $js_academic | resources.Minify }}
{{- $js_theme := resources.Get "js/wowchemy-theme.js" | resources.Minify -}}
{{- $js_theme := resources.Get "js/hb-theme.js" | resources.Minify -}}
{{- $js_lang := resources.Get "js/hb-i18n.js" | resources.Minify -}}
{{- $js_nav := resources.Get "js/hb-nav.js" | resources.Minify -}}
{{ $js_bundle := slice $js_bundle_head $js_academic $js_theme $js_lang $js_nav | resources.Concat (printf "js/hugo-blox-%s.min.js" .Lang) }}

View file

@ -1,3 +1,8 @@
<div class="bilibili">
<iframe src="//player.bilibili.com/player.html?bvid={{ .Get `id` }}&page={{ .Get `p` | default 1 }}" allow="fullscreen"></iframe>
{{- $video_id := cond .IsNamedParams (.Get `id`) (.Get 0) -}}
{{- $video_page := (cond .IsNamedParams (.Get `p`) (.Get 1)) | default 1 -}}
<div class="w-full h-auto aspect-video relative">
<iframe src="//player.bilibili.com/player.html?bvid={{ $video_id }}&page={{ $video_page }}"
allow="accelerometer; clipboard-write; encrypted-media; gyroscope; fullscreen; picture-in-picture;"
class="w-full h-full"
></iframe>
</div>

View file

@ -13,7 +13,7 @@
<div id="chart-{{$id}}" class="chart"></div>
<script>
async function fetchChartJSON() {
console.debug('Wowchemy fetching chart JSON...')
console.debug('Hugo Blox fetching chart JSON...')
const response = await fetch('{{$json}}');
return await response.json();
}

View file

@ -3,7 +3,7 @@ title: 'Home'
date: 2023-10-24
type: landing
sections:
- block: biography
- block: resume-biography
content:
# The user's folder name in content/authors/
username: admin

View file

@ -23,15 +23,17 @@ On this page, you'll find some examples of the types of technical content that c
Teach your course by sharing videos with your students. Choose from one of the following approaches:
{{< youtube D2vj0WcvH5c >}}
**Youtube**:
{{</* youtube w7Ft2ymGmfc */>}}
{{</* youtube D2vj0WcvH5c */>}}
{{< youtube D2vj0WcvH5c >}}
**Bilibili**:
{{</* bilibili id="BV1WV4y1r7DF" */>}}
{{</* bilibili BV1WV4y1r7DF */>}}
{{< bilibili BV1WV4y1r7DF >}}
**Video file**

View file

@ -4,5 +4,5 @@ go 1.19
require (
github.com/HugoBlox/hugo-blox-builder/modules/blox-plugin-netlify v1.1.2-0.20231125204555-f431a4a2c705
github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind v0.1.2-0.20231217135217-f1e179b23dc3
github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind v0.1.2-0.20231229233433-b290b27077b8
)

View file

@ -3,9 +3,10 @@
publish = "public"
[build.environment]
HUGO_VERSION = "0.119.0"
HUGO_ENABLEGITINFO = "true"
HUGO_VERSION = "0.121.1"
GO_VERSION = "1.21.5"
NODE_VERSION = "21.1.0"
HUGO_ENABLEGITINFO = "true"
[context.production.environment]
HUGO_ENV = "production"