We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sonic-theme-papermod默认没有引入第三方评论系统,但我又想使用第三方评论系统,后来发现只要在post.tmpl中引入Artalk即可。
{{- define "sonic_theme_paper_mod/post" -}} <!DOCTYPE html> <html lang="zh" dir="auto"> <head> <title>{{ .post.Title }} - {{ .blog_title }}</title> {{ template "sonic_theme_paper_mod/module/head" .}} </head> <body id="top"> {{template "sonic_theme_paper_mod/module/header" .}} <main class="main"> <article class="post-single"> <h1 class="post-title"><a href="{{ .post.FullPath }}">{{ .post.Title }}</a></h1> <div class="post-meta"> <div class="post-info"> Create Time: {{ unix_milli_time_format "2006-01-02 15:04:05" .post.CreateTime }} Words: {{ .post.WordCount }} </div> </div> <div class="post-content"> <hr> {{noescape .post.Content}} <hr> </div> <footer class="post-footer"> <nav class="paginav"> {{if .prevPost}} <a class="prev" href="{{.prevPost.FullPath}}"> <span class="title">« Prev</span> <br> <span>{{.prevPost.Title}}</span> </a> {{end}} {{if .nextPost}} <a class="next" href="{{.nextPost.FullPath}}"> <span class="title">Next »</span> <br> <span>{{.nextPost.Title}}</span> </a> {{end}} </nav> <br> </footer> </article> <link href="//cdn.staticfile.org/artalk/2.8.3/ArtalkLite.css" rel="stylesheet" /> <script src="//cdn.staticfile.org/artalk/2.8.3/ArtalkLite.js"></script> <!-- Artalk --> <div id="Comments"></div> <script> Artalk.init({ el: '#Comments', pageKey: '{{ .post.FullPath }}', pageTitle: '{{ .post.Title }}', server: 'https://Artalk地址', site: '{{ .settings.header_title }}', }) </script> </main> {{template "sonic_theme_paper_mod/module/footer" .}} </body> </html> {{end}}
原文:Sonic的PaperMod主题启用Artalk评论
The text was updated successfully, but these errors were encountered:
pageKey: '{{ .post.FullPath }}',
可以设置为
pageKey: '{{ .blog_url }}{{ .post.FullPath }}',
获取完整网页。
Sorry, something went wrong.
No branches or pull requests
sonic-theme-papermod默认没有引入第三方评论系统,但我又想使用第三方评论系统,后来发现只要在post.tmpl中引入Artalk即可。
参考代码
原文:Sonic的PaperMod主题启用Artalk评论
The text was updated successfully, but these errors were encountered: