mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-01-06 19:25:14 +01:00
Compare commits
3 commits
824ef0dbf0
...
190577cbbe
Author | SHA1 | Date | |
---|---|---|---|
|
190577cbbe | ||
|
b290b27077 | ||
|
1bc54d5d14 |
37 changed files with 122 additions and 47 deletions
27
modules/blox-analytics/README.md
Normal file
27
modules/blox-analytics/README.md
Normal 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/)
|
3
modules/blox-analytics/go.mod
Normal file
3
modules/blox-analytics/go.mod
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
module github.com/HugoBlox/hugo-blox-builder/modules/blox-analytics
|
||||||
|
|
||||||
|
go 1.15
|
4
modules/blox-analytics/hugo.yaml
Normal file
4
modules/blox-analytics/hugo.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
module:
|
||||||
|
mounts:
|
||||||
|
- source: layouts
|
||||||
|
target: layouts
|
|
@ -0,0 +1,9 @@
|
||||||
|
{{/* HUGO BLOX: MARKETING MODULE */}}
|
||||||
|
|
||||||
|
{{/* VERIFICATIONS */}}
|
||||||
|
|
||||||
|
{{ partial "blox-analytics/verification" . }}
|
||||||
|
|
||||||
|
{{/* ANALYTICS */}}
|
||||||
|
|
||||||
|
{{ partial "blox-analytics/services/index" . }}
|
|
@ -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" . }}
|
|
@ -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 -}}
|
|
@ -1,4 +1,4 @@
|
||||||
.blox-biography {
|
.blox-resume-biography {
|
||||||
#profile {
|
#profile {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 30px 10px;
|
padding: 30px 10px;
|
||||||
|
@ -76,8 +76,6 @@
|
||||||
/* color: rgba(0, 0, 0, 0.6); */
|
/* color: rgba(0, 0, 0, 0.6); */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.network-icon .big-icon {
|
.network-icon .big-icon {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
4
modules/blox-tailwind/assets/dist/wc.min.css
vendored
4
modules/blox-tailwind/assets/dist/wc.min.css
vendored
File diff suppressed because one or more lines are too long
11
modules/blox-tailwind/data/blox_aliases.yaml
Normal file
11
modules/blox-tailwind/data/blox_aliases.yaml
Normal 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
|
|
@ -1,3 +1,5 @@
|
||||||
module github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind
|
module github.com/HugoBlox/hugo-blox-builder/modules/blox-tailwind
|
||||||
|
|
||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
|
require github.com/HugoBlox/hugo-blox-builder/modules/blox-analytics v0.1.0
|
||||||
|
|
|
@ -26,6 +26,8 @@ module:
|
||||||
hugoVersion:
|
hugoVersion:
|
||||||
min: '0.119.0'
|
min: '0.119.0'
|
||||||
extended: true
|
extended: true
|
||||||
|
imports:
|
||||||
|
- path: github.com/HugoBlox/hugo-blox-builder/modules/blox-analytics
|
||||||
mounts:
|
mounts:
|
||||||
- source: content
|
- source: content
|
||||||
target: content
|
target: content
|
|
@ -5,7 +5,10 @@
|
||||||
{{ $page := .page }}
|
{{ $page := .page }}
|
||||||
{{ $block := .block }}
|
{{ $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 }}
|
{{ $block_path := printf "blox/%s.html" $block_type }}
|
||||||
{{ if not (templates.Exists (printf "partials/%s" $block_path)) }}
|
{{ 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 }}
|
{{ 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 }}
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
{{/* Mermaid */}}
|
{{/* Mermaid */}}
|
||||||
{{ if (.Page.Store.Get "has_mermaid") }}
|
{{ if (.Page.Store.Get "has_mermaid") }}
|
||||||
{{ $mermaid_js := resources.Get "dist/lib/mermaid/mermaid.min.js" }}
|
{{ $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_config_js = $mermaid_config_js | resources.Minify }}
|
||||||
{{ $mermaid_bundle := slice $mermaid_js $mermaid_config_js | resources.Concat "js/mermaid.bundle.js" | resources.Fingerprint "sha256" }}
|
{{ $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>
|
<script defer src="{{ $mermaid_bundle.RelPermalink }}" integrity="{{ $mermaid_bundle.Data.Integrity }}"></script>
|
||||||
|
|
|
@ -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" . }}
|
|
|
@ -69,6 +69,11 @@
|
||||||
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
|
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if fileExists "assets/css/custom.css" }}
|
||||||
|
{{ $styles := resources.Get "css/custom.css" | minify | fingerprint "sha256" }}
|
||||||
|
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/* Hugo Blox JS Global Init */
|
/* Hugo Blox JS Global Init */
|
||||||
window.hbb = {
|
window.hbb = {
|
||||||
|
@ -118,8 +123,8 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{{/* Marketing */}}
|
{{/* Analytics & Verification */}}
|
||||||
{{ partial "marketing/index" . }}
|
{{ partial "blox-analytics/index" . }}
|
||||||
|
|
||||||
{{/* RSS Feed */}}
|
{{/* RSS Feed */}}
|
||||||
{{ with .OutputFormats.Get "RSS" }}
|
{{ with .OutputFormats.Get "RSS" }}
|
||||||
|
@ -243,9 +248,9 @@
|
||||||
{{ $js_bundle_head := $js_license | resources.FromString "js/bundle-head.js" }}
|
{{ $js_bundle_head := $js_license | resources.FromString "js/bundle-head.js" }}
|
||||||
{{ $i18n := dict "copy" (i18n "btn_copy") "copied" (i18n "btn_copied" | default "Copied") }}
|
{{ $i18n := dict "copy" (i18n "btn_copy") "copied" (i18n "btn_copied" | default "Copied") }}
|
||||||
{{ $js_params := dict "hugoEnvironment" hugo.Environment "i18n" $i18n }}
|
{{ $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_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_lang := resources.Get "js/hb-i18n.js" | resources.Minify -}}
|
||||||
{{- $js_nav := resources.Get "js/hb-nav.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) }}
|
{{ $js_bundle := slice $js_bundle_head $js_academic $js_theme $js_lang $js_nav | resources.Concat (printf "js/hugo-blox-%s.min.js" .Lang) }}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
<div class="bilibili">
|
{{- $video_id := cond .IsNamedParams (.Get `id`) (.Get 0) -}}
|
||||||
<iframe src="//player.bilibili.com/player.html?bvid={{ .Get `id` }}&page={{ .Get `p` | default 1 }}" allow="fullscreen"></iframe>
|
{{- $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>
|
</div>
|
|
@ -13,7 +13,7 @@
|
||||||
<div id="chart-{{$id}}" class="chart"></div>
|
<div id="chart-{{$id}}" class="chart"></div>
|
||||||
<script>
|
<script>
|
||||||
async function fetchChartJSON() {
|
async function fetchChartJSON() {
|
||||||
console.debug('Wowchemy fetching chart JSON...')
|
console.debug('Hugo Blox fetching chart JSON...')
|
||||||
const response = await fetch('{{$json}}');
|
const response = await fetch('{{$json}}');
|
||||||
return await response.json();
|
return await response.json();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ title: 'Home'
|
||||||
date: 2023-10-24
|
date: 2023-10-24
|
||||||
type: landing
|
type: landing
|
||||||
sections:
|
sections:
|
||||||
- block: biography
|
- block: resume-biography
|
||||||
content:
|
content:
|
||||||
# The user's folder name in content/authors/
|
# The user's folder name in content/authors/
|
||||||
username: admin
|
username: admin
|
||||||
|
|
|
@ -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:
|
Teach your course by sharing videos with your students. Choose from one of the following approaches:
|
||||||
|
|
||||||
{{< youtube D2vj0WcvH5c >}}
|
|
||||||
|
|
||||||
**Youtube**:
|
**Youtube**:
|
||||||
|
|
||||||
{{</* youtube w7Ft2ymGmfc */>}}
|
{{</* youtube D2vj0WcvH5c */>}}
|
||||||
|
|
||||||
|
{{< youtube D2vj0WcvH5c >}}
|
||||||
|
|
||||||
**Bilibili**:
|
**Bilibili**:
|
||||||
|
|
||||||
{{</* bilibili id="BV1WV4y1r7DF" */>}}
|
{{</* bilibili BV1WV4y1r7DF */>}}
|
||||||
|
|
||||||
|
{{< bilibili BV1WV4y1r7DF >}}
|
||||||
|
|
||||||
**Video file**
|
**Video file**
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,5 @@ go 1.19
|
||||||
|
|
||||||
require (
|
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-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
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
publish = "public"
|
publish = "public"
|
||||||
|
|
||||||
[build.environment]
|
[build.environment]
|
||||||
HUGO_VERSION = "0.119.0"
|
HUGO_VERSION = "0.121.1"
|
||||||
HUGO_ENABLEGITINFO = "true"
|
GO_VERSION = "1.21.5"
|
||||||
NODE_VERSION = "21.1.0"
|
NODE_VERSION = "21.1.0"
|
||||||
|
HUGO_ENABLEGITINFO = "true"
|
||||||
|
|
||||||
[context.production.environment]
|
[context.production.environment]
|
||||||
HUGO_ENV = "production"
|
HUGO_ENV = "production"
|
||||||
|
|
Loading…
Reference in a new issue