diff options
Diffstat (limited to 'Just-Read/templates')
-rw-r--r-- | Just-Read/templates/article.html | 35 | ||||
-rw-r--r-- | Just-Read/templates/base.html | 38 |
2 files changed, 52 insertions, 21 deletions
diff --git a/Just-Read/templates/article.html b/Just-Read/templates/article.html index c68487c..038eb3b 100644 --- a/Just-Read/templates/article.html +++ b/Just-Read/templates/article.html @@ -6,26 +6,31 @@ <div class="post wrapper"> <h1>{{ article.title }}</h1> {{ article.content }} - + <a href="https://twitter.com/share" class="twitter-share-button" data-via="{{ TWITTER_USERNAME }}" data-lang="en" data-size="large" data-related="{{ TWITTER_USERNAME }}">Tweet</a> - <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> - + <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> {% if DISQUS_SITENAME %} <div class="comments"> - <h2>Comments !</h2> - <div id="disqus_thread"></div> - <script type="text/javascript"> - var disqus_identifier = "{{ article.url }}"; - (function() { - var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'https://{{ DISQUS_SITENAME }}.disqus.com/embed.js'; - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); - })(); - </script> + <h2>Comments !</h2> + <div id="disqus_thread"></div> + <script> + var disqus_config = function () { + this.page.url = "{{ SITEURL }}/{{ article.url }}"; + this.page.identifier = "{{ article.slug }}"; + this.page.title = "{{ article.title }}"; + }; + (function() { + var d = document, + s = d.createElement('script'); + s.src = 'https://{{ DISQUS_SITENAME }}.disqus.com/embed.js'; + s.setAttribute('data-timestamp', +new Date()); + (d.head || d.body).appendChild(s); + })(); + </script> + <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </div> - {% endif %} + {% endif %} </div> - {% include 'metadata.html' %} </article> </div> diff --git a/Just-Read/templates/base.html b/Just-Read/templates/base.html index a61b22b..8b980b5 100644 --- a/Just-Read/templates/base.html +++ b/Just-Read/templates/base.html @@ -14,9 +14,7 @@ <meta name="author" content="{{ AUTHOR }}" /> <meta name="copyright" content="{{ AUTHOR }}" /> {% endif %} - <meta property="og:site_name" content="{{SITENAME}}" /> - {% if GOOGLE_PLUS_PROFILE_URL %} <link rel="author" href={{GOOGLE_PLUS_PROFILE_URL}} /> {% endif %} @@ -24,9 +22,8 @@ <meta name="twitter:site" content="@{{TWITTER_USERNAME}}" /> <meta name="twitter:creator" content="@{{TWITTER_USERNAME}}" /> {% endif %} - - {%if article %} <meta name="twitter:card" content="summary" /> + {%if article %} <meta name="twitter:title" content="{{article.title}}" /> <meta name="date" content="{{article.date}}" /> <meta property="og:type" content="article" /> @@ -34,7 +31,7 @@ <meta property="og:published_time" content="{{article.date}}" /> <meta property="og:title" content="{{article.title}}" /> <meta property="og:url" content="{{SITEURL}}/{{ article.url }}" /> - {% if article.featured_image %} + {% if article.featured_image %} <meta property="og:image" content="{{ article.featured_image }}" /> {% endif %} {%if DESCRIPTION %} @@ -47,8 +44,37 @@ {%if FACEBOOK_PROFILE_URL %} <meta property="article:author" content="{{FACEBOOK_PROFILE_URL}}" /> {% endif %} + {% elif page %} + <meta name="twitter:title" content="{{page.title}}" /> + <meta name="date" content="{{page.date}}" /> + <meta property="og:type" content="website" /> + <meta property="og:locale" content="{{page.lang}}" /> + <meta property="og:published_time" content="{{page.date}}" /> + <meta property="og:title" content="{{page.title}}" /> + <meta property="og:url" content="{{SITEURL}}/{{ page.url }}" /> + {% if page.featured_image %} + <meta property="og:image" content="{{ page.featured_image }}" /> + {% endif %} + {%if DESCRIPTION %} + <meta property="og:description" content="{{DESCRIPTION}} " /> + <meta name="description" content="{{DESCRIPTION}}" /> + {%else %} + <meta property="og:description" content="{{page.summary|striptags}}" /> + <meta name="description" content="{{page.summary|striptags}}" /> + {% endif %} + {% else %} + <meta name="twitter:title" content="{{SITENAME}}" /> + <meta property="og:type" content="website" /> + {% if DEFAULT_LANG %} + <meta property="og:locale" content="{{DEFAULT_LANG}}" /> + {% endif %} + <meta property="og:title" content="{{SITENAME}}" /> + <meta property="og:url" content="{{SITEURL}}/{{ output_file }}" /> + {%if DESCRIPTION %} + <meta property="og:description" content="{{DESCRIPTION}} " /> + <meta name="description" content="{{DESCRIPTION}}" /> + {% endif %} {% endif %} - <meta name="HandheldFriendly" content="True" /> <meta name="MobileOptimized" content="320" /> <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0" /> |