Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mattstratton/castanet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott McAllister <stmcallister@gmail.com>2022-08-10 20:37:18 +0300
committerGitHub <noreply@github.com>2022-08-10 20:37:18 +0300
commit87fd1bbaa35be2666da36469d861aedf45307c63 (patch)
tree1c414716409c0e7627b33c8697496f15bf9be06d
parente6744bb30475fed4e4144f1ad487207b7a1ac032 (diff)
Update Hugo to version 0.91.2 (#389)
-rw-r--r--.circleci/config.yml2
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--.gitignore1
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/footer_scripts.html111
-rw-r--r--layouts/partials/google-analytics-ua.html14
-rw-r--r--layouts/partials/google-analytics.html13
-rw-r--r--layouts/partials/head_includes.html9
-rw-r--r--netlify.toml6
9 files changed, 83 insertions, 76 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index d605421..2162cdf 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -2,7 +2,7 @@ version: 2.1
executors:
castanet-tests:
docker:
- - image: cibuilds/hugo:0.76.5
+ - image: cibuilds/hugo:0.91.2
auth:
username: mattstratton
password: $DOCKERHUB_PASSWORD
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index eb6cbe9..a8b1afc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,7 +14,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
- hugo-version: '0.75.1'
+ hugo-version: '0.91.2'
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
diff --git a/.gitignore b/.gitignore
index a0f080b..f6593a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@ dist
.DS_Store
.Ulysses-Group.plist
public/
+.hugo_build.lock
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index b05c2c5..82c011d 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -72,6 +72,7 @@ buildFuture = true
url = "https://www.google.com"
[params]
+googleAnalytics_UA = ""
mainSections = ["episode"]
episode_number_style = "brackets"
episode_number_prefix = "CWC"
diff --git a/layouts/partials/footer_scripts.html b/layouts/partials/footer_scripts.html
index bf2c464..5f82776 100644
--- a/layouts/partials/footer_scripts.html
+++ b/layouts/partials/footer_scripts.html
@@ -1,70 +1,65 @@
<script src='{{ "js/castanet-min.js" | absURL }}'></script>
<script>
- $("#share").jsSocials({
- shares: [
- {
- share: "facebook",
- logo: "fab fa-facebook",
- },
- {
- share: "twitter", // name of share
- label: "Tweet", // share button text (optional)
- logo: "fab fa-twitter",
- // The twitter link can be based in short ("arresteddevops") or
- // long form ("https://twitter.com/arresteddevops")
- // In long form we need to strip everything but the twitter handle
- // for the 'via' parameter
- {{ if (isset .Site.Params.social "twitter" )}}
- {{ if gt (len (urls.Parse .Site.Params.social.twitter).Scheme) 0 }}
- via: "{{ trim ((urls.Parse .Site.Params.social.twitter).Path) "/" }}", // custom twitter sharing param 'via' (optional)
- {{ else }}
- via: "{{ .Site.Params.social.twitter }}", // custom twitter sharing param 'via' (optional)
- {{ end }}
+ $("#share").jsSocials({
+ shares: [
+ {
+ share: "facebook",
+ logo: "fab fa-facebook",
+ },
+ {
+ share: "twitter", // name of share
+ label: "Tweet", // share button text (optional)
+ logo: "fab fa-twitter",
+ // The twitter link can be based in short ("arresteddevops") or
+ // long form ("https://twitter.com/arresteddevops")
+ // In long form we need to strip everything but the twitter handle
+ // for the 'via' parameter
+ {{ if (isset .Site.Params.social "twitter" )}}
+ {{ if gt (len (urls.Parse .Site.Params.social.twitter).Scheme) 0 }}
+ via: "{{ trim ((urls.Parse .Site.Params.social.twitter).Path) "/" }}", // custom twitter sharing param 'via' (optional)
+ {{ else }}
+ via: "{{ .Site.Params.social.twitter }}", // custom twitter sharing param 'via' (optional)
{{ end }}
- url: "{{ .Permalink }}",
- text: "{{ title .Title }}"
- },
- {
- share: "linkedin",
- logo: "fab fa-linkedin"
- },
- {
- share: "pinterest",
- logo: "fab fa-pinterest"
- }
- ],
- });
+ {{ end }}
+ url: "{{ .Permalink }}",
+ text: "{{ title .Title }}"
+ },
+ {
+ share: "linkedin",
+ logo: "fab fa-linkedin"
+ },
+ {
+ share: "pinterest",
+ logo: "fab fa-pinterest"
+ }
+ ],
+ });
</script>
<script>
- $(document).ready(function() {
-
- $('.transcript').hide();
- $(".hide_transcript").hide();
- $(".hide_transcript").click(function () {
- $(".transcript").hide("fast");
- $(".show_transcript").show();
- $(".hide_transcript").hide();
- });
+ $(document).ready(function() {
- $(".show_transcript").click(function () {
- $(".transcript").show(500);
- $(".hide_transcript").show();
- $(".show_transcript").hide();
- });
+ $('.transcript').hide();
+ $(".hide_transcript").hide();
+ $(".hide_transcript").click(function() {
+ $(".transcript").hide("fast");
+ $(".show_transcript").show();
+ $(".hide_transcript").hide();
+ });
- });
+ $(".show_transcript").click(function() {
+ $(".transcript").show(500);
+ $(".hide_transcript").show();
+ $(".show_transcript").hide();
+ });
+ });
</script>
<script>
- var player = new MediaElementPlayer('player2', {
- features: ['playpause', 'current', 'progress', 'duration', 'volume','speed'],
- defaultSpeed: 1.0,
- // other configuration elements
- });
-</script>
-
-
-
-{{ template "_internal/google_analytics_async.html" . }}
+ var player = new MediaElementPlayer('player2', {
+ features: ['playpause', 'current', 'progress', 'duration', 'volume', 'speed'],
+ defaultSpeed: 1.0,
+ // other configuration elements
+ });
+</script> \ No newline at end of file
diff --git a/layouts/partials/google-analytics-ua.html b/layouts/partials/google-analytics-ua.html
new file mode 100644
index 0000000..7a2cb50
--- /dev/null
+++ b/layouts/partials/google-analytics-ua.html
@@ -0,0 +1,14 @@
+<!-- Google Analytics UA -->
+<script type="application/javascript">
+ var doNotTrack = false;
+ if (!doNotTrack) {
+ window.ga = window.ga || function() {
+ (ga.q = ga.q || []).push(arguments)
+ };
+ ga.l = +new Date;
+ ga('create', '{{ .Site.Params.GoogleAnalytics_UA }}', 'auto');
+
+ ga('send', 'pageview');
+ }
+</script>
+<script async src='https://www.google-analytics.com/analytics.js'></script> \ No newline at end of file
diff --git a/layouts/partials/google-analytics.html b/layouts/partials/google-analytics.html
deleted file mode 100644
index 1526a23..0000000
--- a/layouts/partials/google-analytics.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!-- Google Analytics -->
-{{ if .Site.Params.GATracker }}
-<script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
- ga('create', '{{ .Site.Params.GATracker }}', 'auto');
- ga('send', 'pageview');
-
-</script>
-{{ end }}
diff --git a/layouts/partials/head_includes.html b/layouts/partials/head_includes.html
index 75ede81..5f79212 100644
--- a/layouts/partials/head_includes.html
+++ b/layouts/partials/head_includes.html
@@ -1,3 +1,12 @@
+<!------------
+ The following logic allows for both the GA4 support using Google Tag Manager and the legacy UA Google Analytics tag
+ to be used together. There may be situations where a organization support both tag methods simultaneously.
+------------->
+<!-- Check for the Global GoogleAnalytics variable to use the Hugo internal google_analytics template -->
+{{ if .Site.GoogleAnalytics }} {{ template "_internal/google_analytics.html" . }} {{ end }}
+<!-- Check for googleAnalytics_UA param to use the google-analytics-ua partial -->
+{{ if .Site.Params.googleAnalytics_UA }} {{ partial "google-analytics-ua.html" . }} {{ end }}
+
{{ if isset $.Site.Params "favicon"}}
<link rel="icon" href="{{ $.Site.Params.favicon | absURL }}">
{{ else }}
diff --git a/netlify.toml b/netlify.toml
index 3ac8fdf..ba90216 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -13,10 +13,10 @@
command = "bin/netlify.sh"
[context.production.environment]
- HUGO_VERSION = "0.76.5"
+ HUGO_VERSION = "0.91.2"
[context.deploy-preview.environment]
- HUGO_VERSION = "0.76.5"
+ HUGO_VERSION = "0.91.2"
[context.branch-deploy.environment]
- HUGO_VERSION = "0.76.5"
+ HUGO_VERSION = "0.91.2"