Closed ghost closed 4 years ago
Hi @jakehell!
Thank you for letting me know about that and PR! I really appreciate your help, but I want to know more details about that issue.
Could you show me your config.toml
when doesn't generate google analytics script in the index.html
?
@matsuyoshi30
https://github.com/jakehell/blog/blob/f9b9443baaf1d0e121052c91f73ce42154cd651c/config.toml
This is what it looked like.
@jakehell
Thank you for sharing, and I figured out what happens. If you set top-level configuration like google analytics, you need to move your top-level options in config.toml to the beginning of the config file.
theme = "harbor"
[markup.goldmark.renderer]
unsafe = true
googleAnalytics = "XXXX"
You change config.toml
like below.
theme = "harbor"
googleAnalytics = "XXXX"
[markup.goldmark.renderer]
unsafe = true
Please try it! If you still have a problem, let me know.
I see, thanks for the information. I will close this issue and the PR.
@jakehell
I updated README from your issue. https://github.com/matsuyoshi30/harbor/commit/454f24eeb3687a516d27878ea655afb790c1cf29
Thank you for letting me know!
I set my tracking key using
googleAnalytics = "<key>"
in theconfig.toml
file.However, there's no google analytics
<script>
in the generatedindex.html
.If I add this in
config.toml
:And change
analytics.html
to:The google analytics
<script
> is added correctly.