Related articles feature and some improvements

remotes/1726754216782406552/master
Özcan Oğuz 4 years ago
parent 85de2d294d
commit 3430643870
Signed by untrusted user: ooguz
GPG Key ID: 2D33E2BD3D975818
  1. 19
      config.toml
  2. 3
      i18n/en.toml
  3. 5
      i18n/tr.toml
  4. 6
      layouts/_default/baseof.html
  5. 3
      layouts/_default/single.html
  6. 10
      layouts/partials/related.html
  7. 5
      static/css/style.css

@ -155,5 +155,24 @@ ignoreFiles = ["\\.Rmd$", "_files$", "_cache$"]
MathJaxCDN = "//cdn.bootcss.com" MathJaxCDN = "//cdn.bootcss.com"
MathJaxVersion = "2.7.1" MathJaxVersion = "2.7.1"
[related]
includeNewer = false
threshold = 80
toLower = false
[[related.indices]]
name = "keywords"
weight = 100
[[related.indices]]
name = "categories"
weight = 100
[[related.indices]]
name = "date"
weight = 10
[markup.goldmark.renderer] [markup.goldmark.renderer]
unsafe= true unsafe= true

@ -30,3 +30,6 @@ other = "Source code"
[gorsel] [gorsel]
other = "Photo: " other = "Photo: "
[related]
other = "More articles you may like"

@ -29,4 +29,7 @@ other = "Özgür Yazılım Derneği, özgür yazılım hareketini ve tüm insanl
other = "Kaynak kodu" other = "Kaynak kodu"
[gorsel] [gorsel]
other = "Görsel: " other = "Görsel: "
[related]
other = "İlginizi çekebilecek diğer yazılar"

@ -2,15 +2,16 @@
<html lang="{{ .Site.Language.Lang }}"> <html lang="{{ .Site.Language.Lang }}">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="description" content="{{ i18n "desc_summary" }}" />
<meta name="robots" content="index, follow" /> <meta name="robots" content="index, follow" />
<link rel="canonical" href="http://www.oyd.org.tr/" /> <link rel="canonical" href="http://www.oyd.org.tr/" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
{{ if .IsPage }} {{ if .IsPage }}
<meta name="description" content="{{ .Page.Summary }}" />
<meta property="og:title" content="{{ .Page.Title }} - {{ .Site.Title }}" /> <meta property="og:title" content="{{ .Page.Title }} - {{ .Site.Title }}" />
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:url" content="https://www.oyd.org.tr" /> <meta property="og:url" content="https://www.oyd.org.tr" />
<meta property="og:description" content="{{ .Description }}" /> <meta property="og:description" content="{{ .Page.Summary }}" />
<meta property="og:image" content="/oyd_social.png?v=2" /> <meta property="og:image" content="/oyd_social.png?v=2" />
<meta property="og:site_name" content="Özgür Yazılım Derneği" /> <meta property="og:site_name" content="Özgür Yazılım Derneği" />
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
@ -20,6 +21,7 @@
<meta name="twitter:creator" content="@oydorgtr" /> <meta name="twitter:creator" content="@oydorgtr" />
<meta name="twitter:image" content="https://oyd.org.tr/oyd_social.png?4812354"> <meta name="twitter:image" content="https://oyd.org.tr/oyd_social.png?4812354">
{{ else }} {{ else }}
<meta name="description" content="{{ i18n "desc_summary" }}" />
<meta property="og:title" content="{{ .Site.Title }}" /> <meta property="og:title" content="{{ .Site.Title }}" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:url" content="https://www.oyd.org.tr" /> <meta property="og:url" content="https://www.oyd.org.tr" />

@ -12,6 +12,9 @@
</div> </div>
{{ end }} {{ end }}
{{ .Content }} {{ .Content }}
{{ if (or (eq .Section "yazilar") (eq .Section "articles")) }}
{{ partial "related" . }}
{{ end }}
</article> </article>
<aside class="sidebar"> <aside class="sidebar">
<h2 class="title">{{ i18n "etkinlikler" }}</h2> <h2 class="title">{{ i18n "etkinlikler" }}</h2>

@ -0,0 +1,10 @@
<hr>
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<h3>{{ i18n "related" }}</h3>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}

@ -186,6 +186,10 @@ article hr:last-child {
display: none; display: none;
} }
article hr {
color: #4c2447;
}
.list-title { .list-title {
font-size: 1.2rem; font-size: 1.2rem;
} }
@ -930,3 +934,4 @@ table {
display: none; display: none;
} }
} }

Loading…
Cancel
Save