#86, Add google analytics to readme, move GA and enable Open Graph in head

This commit is contained in:
Alex Shpak 2019-10-03 14:10:03 +02:00
parent 397ebbc2a4
commit 22ff783d86
5 changed files with 21 additions and 14 deletions

View file

@ -100,7 +100,8 @@ And Enable it by settings `BookMenuBundle: /menu` in Site configuration
## Blog ## Blog
Simple blog supported for section `posts` Simple blog supported for section `posts`.
Blog is not primary use case so book theme so it has only minimal features
## Configuration ## Configuration
@ -156,7 +157,7 @@ BookEditPath = 'edit/master/exampleSite/content'
# - In blog posts # - In blog posts
BookDateFormat = 'Jan 2, 2006' BookDateFormat = 'Jan 2, 2006'
# (Optional, default true) Enables search function with lunr.js, # (Optional, default true) Enables search function with lunr.js,
# Index is built on fly, therefore it might slowdown your website. # Index is built on fly, therefore it might slowdown your website.
BookSearch = true BookSearch = true
``` ```
@ -202,6 +203,13 @@ There are few empty partials you can override in `layouts/partials/`
| `assets/_custom.scss` | Customise or override scss styles | | `assets/_custom.scss` | Customise or override scss styles |
| `assets/_fonts.scss` | Replace default font with custom fonts (e.g. local files or remote like google fonts) | | `assets/_fonts.scss` | Replace default font with custom fonts (e.g. local files or remote like google fonts) |
### Hugo Internal Templates
There are few hugo tempaltes inserted in `<head>`
- [Google Analytics](https://gohugo.io/templates/internal/#google-analytics)
- [Open Graph](https://gohugo.io/templates/internal/#open-graph)
## Shortcodes ## Shortcodes
### Expand ### Expand
@ -231,18 +239,16 @@ Useful if you want to show alternative information per platform or setting.
Organize text in 2 or more columns to use space efficiently. Organize text in 2 or more columns to use space efficiently.
```html ```html
{{< columns >}} <!-- begin columns block --> {{< columns >}}
<!-- begin columns block -->
# Left Content Lorem markdownum insigne... # Left Content Lorem markdownum insigne... <--->
<!-- magic sparator, between columns -->
<---> <!-- magic sparator, between columns --> # Mid Content Lorem markdownum insigne... <--->
<!-- magic sparator, between columns -->
# Mid Content Lorem markdownum insigne... # Right Content Lorem markdownum insigne... {{< /columns >}}
<---> <!-- magic sparator, between columns -->
# Right Content Lorem markdownum insigne...
{{< /columns >}}
``` ```
### Mermaid Charts ### Mermaid Charts

View file

@ -25,7 +25,6 @@
</main> </main>
{{ partial "docs/inject/body" . }} {{ partial "docs/inject/body" . }}
{{ template "_internal/google_analytics_async.html" . }}
</body> </body>
</html> </html>

View file

@ -22,7 +22,6 @@ You can override this page in:
</main> </main>
{{ partial "docs/inject/body" . }} {{ partial "docs/inject/body" . }}
{{ template "_internal/google_analytics_async.html" . }}
</body> </body>
</html> </html>

View file

@ -1,5 +1,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
{{- template "_internal/opengraph.html" . -}}
<title>{{ partial "docs/title" . }} | {{ .Site.Title -}}</title> <title>{{ partial "docs/title" . }} | {{ .Site.Title -}}</title>
<!-- Theme stylesheet, you can customize scss by creating `assets/custom.scss` in your website --> <!-- Theme stylesheet, you can customize scss by creating `assets/custom.scss` in your website -->
@ -23,3 +25,5 @@
Made with Book Theme Made with Book Theme
https://github.com/alex-shpak/hugo-book https://github.com/alex-shpak/hugo-book
{{ "-->" | safeHTML }} {{ "-->" | safeHTML }}
{{ template "_internal/google_analytics_async.html" . }}

View file

@ -25,7 +25,6 @@
</main> </main>
{{ partial "docs/inject/body" . }} {{ partial "docs/inject/body" . }}
{{ template "_internal/google_analytics_async.html" . }}
</body> </body>
</html> </html>