Repository: gohugoio/hugo (language: go)

Issue:
W3C validator warning on the internal GA templates: The type attribute is unnecessary for JavaScript resources
Hi,

I have a warning with the [W3C validator](https://validator.w3.org): "*The type attribute is unnecessary for JavaScript resources*" when I use the internal template for Google Analytics.

Could you remove the `type="application/javascript"` attribute from the `script` html tag of the  internal GA templates?
```html
<script type="application/javascript">...</script> <!--Bad-->
<script>...</script> <!--Good-->
```

I found this if it could help you:
- [google_analytics_async](https://github.com/gohugoio/hugo/blob/755d1ffe7a22d8ad83485240ff78cf25d501602f/tpl/tplimpl/embedded/templates/google_analytics_async.html#L4)
- [google_analytics](https://github.com/gohugoio/hugo/blob/755d1ffe7a22d8ad83485240ff78cf25d501602f/tpl/tplimpl/embedded/templates/google_analytics.html#L4)

> certainly other templates will be concerned, at least Disqus.

```shell
> hugo version
Hugo Static Site Generator v0.57.2/extended darwin/amd64 BuildDate: unknown
```
> thank you for your work, Hugo is a great Static Site Generator!


Discussion / hints:
>The type attribute is unnecessary for JavaScript resources

Unless you somehow need it.

I think we've had this discussion before, as the minifier we use uses `type` to determine how to minify.

What does W3C say about this?

```html
<script type="text/vbscript">
document.write("Hello World!")
</script>
```

If someone can confirm that the minifier defaults to JS for script tags, then fine.
It seems that "_application/javascript_" [is the default value](https://www.w3schools.com/tags/att_script_type.asp) for `type` attribute.
Poked around in [tdewolff/minify](https://github.com/tdewolff/minify) for a few seconds and it does appear like it treats both `<script type="text/javascript">` and `<script type="application/javascript">` the same as `<script>`.

In [`html_test.go`](https://github.com/tdewolff/minify/blob/303fb6e837db77706400a601fd174468642bb5b4/html/html_test.go#L61):

```go
{`<script type="text/javascript">js</script>`, `<script>js</script>`},
{`<script type="application/javascript">js</script>`, `<script>js</script>`},
```

I could be wrong, though...
@jakejarvis you are correct. If the `<script>` tag does not contain a `type` attribute, it is automatically assumed to be JavaScript. The minifier assumes so as well.
My 2 cents: A "warning" is not an error. Being "unnecessary" is not an error. The check of your site starts with a "This tool is an ongoing experiment in better HTML checking, and its behavior remains subject to change".

```
<script type="application/javascript">...</script> <!--Bad-->
```

is a false assumption. It's not bad. It's just not as short as possible. It's not wrong. It's just like a politician who is unable to say "This house is red." and instead says "This house, and I say that with my full conviction, is, as it refers to it's color, red, with the most redish values I have ever seen.". That is annoying, but it's in the end not an issue, not a bug, not an error. It's a possible value.

This is a "religious" debate. Not a technical issue.

Fix patch:
diff --git a/tpl/tplimpl/embedded/templates/disqus.html b/tpl/tplimpl/embedded/templates/disqus.html
index d90a525864c..19fcb7fda68 100644
--- a/tpl/tplimpl/embedded/templates/disqus.html
+++ b/tpl/tplimpl/embedded/templates/disqus.html
@@ -1,7 +1,7 @@
 {{- $pc := .Site.Config.Privacy.Disqus -}}
 {{- if not $pc.Disable -}}
 {{ if .Site.Config.Services.Disqus.Shortname }}<div id="disqus_thread"></div>
-<script type="application/javascript">
+<script>
     window.disqus_config = function () {
     {{with .Params.disqus_identifier }}this.page.identifier = '{{ . }}';{{end}}
     {{with .Params.disqus_title }}this.page.title = '{{ . }}';{{end}}
diff --git a/tpl/tplimpl/embedded/templates/google_analytics.html b/tpl/tplimpl/embedded/templates/google_analytics.html
index ad88ae92490..c9a12e8e9d3 100644
--- a/tpl/tplimpl/embedded/templates/google_analytics.html
+++ b/tpl/tplimpl/embedded/templates/google_analytics.html
@@ -12,7 +12,7 @@
 }
 </script>
 {{ else if hasPrefix . "UA-" }}
-<script type="application/javascript">
+<script>
 {{ template "__ga_js_set_doNotTrack" $ }}
 if (!doNotTrack) {
 	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
diff --git a/tpl/tplimpl/embedded/templates/google_analytics_async.html b/tpl/tplimpl/embedded/templates/google_analytics_async.html
index c9ba8a2b3f5..93ecb753d22 100644
--- a/tpl/tplimpl/embedded/templates/google_analytics_async.html
+++ b/tpl/tplimpl/embedded/templates/google_analytics_async.html
@@ -2,7 +2,7 @@
 {{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
 {{- if not $pc.Disable -}}
 {{ with .Site.Config.Services.GoogleAnalytics.ID }}
-<script type="application/javascript">
+<script>
 {{ template "__ga_js_set_doNotTrack" $ }}
 if (!doNotTrack) {
 	window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
diff --git a/tpl/tplimpl/embedded/templates/shortcodes/gist.html b/tpl/tplimpl/embedded/templates/shortcodes/gist.html
index 781b265678e..5f754f6514b 100644
--- a/tpl/tplimpl/embedded/templates/shortcodes/gist.html
+++ b/tpl/tplimpl/embedded/templates/shortcodes/gist.html
@@ -1,1 +1,1 @@
-<script type="application/javascript" src="https://gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script>
+<script src="https://gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script>


Test patch: