A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

98 satır
4.1 KiB

  1. {{define "post"}}<!DOCTYPE HTML>
  2. <html {{if .Language}}lang="{{.Language}}"{{end}} dir="{{.Direction}}">
  3. <head prefix="og: http://ogp.me/ns#">
  4. <meta charset="utf-8">
  5. <title>{{if .Title}}{{.Title}}{{else}}{{.GenTitle}}{{end}} &mdash; {{.SiteName}}</title>
  6. {{if .IsCode}}
  7. <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/mono-blue.min.css">
  8. {{end}}
  9. <link rel="stylesheet" type="text/css" href="/css/write.css" />
  10. <link rel="shortcut icon" href="/favicon.ico" />
  11. <link rel="canonical" href="{{.Host}}/{{.ID}}" />
  12. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  13. <meta name="generator" content="{{.SiteName}}">
  14. <meta name="title" content="{{if .Title}}{{.Title}}{{else}}{{.GenTitle}}{{end}}">
  15. <meta name="description" content="{{.Description}}">
  16. <meta itemprop="name" content="{{.SiteName}}">
  17. <meta itemprop="description" content="{{.Description}}">
  18. <meta name="twitter:card" content="summary">
  19. <meta name="twitter:title" content="{{if .Title}}{{.Title}}{{else}}{{.GenTitle}}{{end}}">
  20. <meta name="twitter:description" content="{{.Description}}">
  21. {{if gt .Views 1}}<meta name="twitter:label1" value="Views">
  22. <meta name="twitter:data1" value="{{largeNumFmt .Views}}">{{end}}
  23. <meta name="twitter:image" content="https://write.as/img/w-sq-light.png">
  24. <meta property="og:title" content="{{if .Title}}{{.Title}}{{else}}{{.GenTitle}}{{end}}" />
  25. <meta property="og:site_name" content="{{.SiteName}}" />
  26. <meta property="og:type" content="article" />
  27. <meta property="og:url" content="https://write.as/{{.ID}}" />
  28. <meta property="og:description" content="{{.Description}}" />
  29. <meta property="og:image" content="https://write.as/img/w-sq-light.png">
  30. {{if .Author}}<meta property="article:author" content="https://{{.Author}}" />{{end}}
  31. </head>
  32. <body id="post">
  33. <header>
  34. <h1 dir="{{.Direction}}"><a href="/">{{.SiteName}}</a></h1>
  35. <nav>
  36. <span class="views{{if not .IsOwner}} owner-visible{{end}}" dir="ltr"><strong>{{largeNumFmt .Views}}</strong> {{pluralize "view" "views" .Views}}</span>
  37. {{if .IsCode}}<a href="/{{.ID}}.txt" rel="noindex" dir="{{.Direction}}">View raw</a>{{end}}
  38. {{ if .Username }}
  39. {{if .IsOwner}}
  40. <a href="/{{.ID}}/edit" dir="{{.Direction}}">Edit</a>
  41. {{end}}
  42. <a class="xtra-feature dash-nav" href="/me/posts/" dir="{{.Direction}}">Drafts</a>
  43. {{ end }}
  44. </nav>
  45. </header>
  46. <article class="{{.Font}} h-entry">{{if .Title}}<h2 id="title" class="p-name">{{.Title}}</h2>{{end}}{{ if .IsPlainText }}<p id="post-body" class="e-content">{{.Content}}</p>{{ else }}<div id="post-body" class="e-content">{{.HTMLContent}}</div>{{ end }}</article>
  47. <footer dir="ltr"><hr><nav><p style="font-size: 0.9em">{{localhtml "published with write.as" .Language}}</p></nav></footer>
  48. </body>
  49. {{if .IsCode}}
  50. <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
  51. <script>
  52. hljs.highlightBlock(document.getElementById('post-body'));
  53. </script>
  54. {{else}}
  55. <script src="/js/h.js"></script>
  56. {{if .IsPlainText}}<script src="/js/twitter-text.min.js"></script>{{end}}
  57. {{end}}
  58. <script type="text/javascript">
  59. try {
  60. WebFontConfig = {
  61. custom: { families: [ 'Lora:400,700:latin'{{if eq .Font "sans"}}, 'Open+Sans:400,700:latin'{{end}} ], urls: [ '/css/fonts.css' ] }
  62. };
  63. (function() {
  64. var wf = document.createElement('script');
  65. wf.src = '/js/webfont.js';
  66. wf.type = 'text/javascript';
  67. wf.async = 'true';
  68. var s = document.getElementsByTagName('script')[0];
  69. s.parentNode.insertBefore(wf, s);
  70. })();
  71. } catch (e) { /* ¯\_(ツ)_/¯ */ }
  72. var posts = localStorage.getItem('posts');
  73. if (posts != null) {
  74. posts = JSON.parse(posts);
  75. var $nav = document.getElementsByTagName('nav')[0];
  76. for (var i=0; i<posts.length; i++) {
  77. if (posts[i].id == "{{.ID}}") {
  78. $nav.innerHTML = $nav.innerHTML + '<a class="xtra-feature" href="/edit/{{.ID}}" dir="{{.Direction}}">Edit</a>';
  79. var $ownerVis = document.querySelectorAll('.owner-visible');
  80. for (var i=0; i<$ownerVis.length; i++) {
  81. $ownerVis[i].classList.remove('owner-visible');
  82. }
  83. break;
  84. }
  85. }
  86. }
  87. </script>
  88. </html>{{end}}