Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstratton committed Aug 10, 2022
2 parents 82a953b + 87fd1bb commit fad8502
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dist
.DS_Store
.Ulysses-Group.plist
public/
.hugo_build.lock
1 change: 1 addition & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ buildFuture = true
url = "https://www.google.com"

[params]
googleAnalytics_UA = ""
mainSections = ["episode"]
episode_number_style = "brackets"
episode_number_prefix = "CWC"
Expand Down
111 changes: 53 additions & 58 deletions layouts/partials/footer_scripts.html
Original file line number Diff line number Diff line change
@@ -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>
14 changes: 14 additions & 0 deletions layouts/partials/google-analytics-ua.html
Original file line number Diff line number Diff line change
@@ -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>
13 changes: 0 additions & 13 deletions layouts/partials/google-analytics.html

This file was deleted.

9 changes: 9 additions & 0 deletions layouts/partials/head_includes.html
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit fad8502

Please sign in to comment.