Browse Source

Related articles feature and some improvements

pull/18/head
Özcan Oğuz 4 months ago
parent
commit
3430643870
Signed by: ooguz <ozcan@oyd.org.tr> GPG Key ID: 2D33E2BD3D975818
7 changed files with 48 additions and 3 deletions
  1. +19
    -0
      config.toml
  2. +3
    -0
      i18n/en.toml
  3. +4
    -1
      i18n/tr.toml
  4. +4
    -2
      layouts/_default/baseof.html
  5. +3
    -0
      layouts/_default/single.html
  6. +10
    -0
      layouts/partials/related.html
  7. +5
    -0
      static/css/style.css

+ 19
- 0
config.toml View File

@@ -155,5 +155,24 @@ ignoreFiles = ["\\.Rmd$", "_files$", "_cache$"]
MathJaxCDN = "//cdn.bootcss.com"
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]
unsafe= true


+ 3
- 0
i18n/en.toml View File

@@ -30,3 +30,6 @@ other = "Source code"

[gorsel]
other = "Photo: "

[related]
other = "More articles you may like"

+ 4
- 1
i18n/tr.toml View File

@@ -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"

[gorsel]
other = "Görsel: "
other = "Görsel: "

[related]
other = "İlginizi çekebilecek diğer yazılar"

+ 4
- 2
layouts/_default/baseof.html View File

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


+ 3
- 0
layouts/_default/single.html View File

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


+ 10
- 0
layouts/partials/related.html View File

@@ -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 }}

+ 5
- 0
static/css/style.css View File

@@ -186,6 +186,10 @@ article hr:last-child {
display: none;
}

article hr {
color: #4c2447;
}

.list-title {
font-size: 1.2rem;
}
@@ -930,3 +934,4 @@ table {
display: none;
}
}


Loading…
Cancel
Save