mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-01-04 18:35:16 +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 {
|
||||
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;
|
||||
}
|
||||
|
|
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
|
||||
|
||||
go 1.19
|
||||
|
||||
require github.com/HugoBlox/hugo-blox-builder/modules/blox-analytics v0.1.0
|
||||
|
|
|
@ -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
|
|
@ -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 }}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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" />
|
||||
{{ 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) }}
|
||||
|
|
|
@ -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>
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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**
|
||||
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue