feat: add new section for personal writings

This commit is contained in:
log101 2024-01-02 05:57:25 +00:00
parent 95742f4009
commit c58f254a11
23 changed files with 212 additions and 37 deletions

1
assets/js/main.js Normal file
View File

@ -0,0 +1 @@

View File

@ -58,13 +58,19 @@ body {
} }
.pagination { .pagination {
display: flex; /* Enable flexbox layout */ display: flex;
list-style: none; /* Remove default list styling */ /* Enable flexbox layout */
padding: 0; /* Remove default padding */ list-style: none;
margin: 0; /* Adjust margin as needed */ /* Remove default list styling */
justify-content: center; /* Center the pagination items */ padding: 0;
/* Remove default padding */
margin: 0;
/* Adjust margin as needed */
justify-content: center;
/* Center the pagination items */
align-items: center; align-items: center;
font-family: Inter; font-family: Inter;
a { a {
text-decoration: none; text-decoration: none;
color: #252525; color: #252525;
@ -72,13 +78,17 @@ body {
} }
.pagination .page-item { .pagination .page-item {
margin: 0; /* Adjust margin between items as needed */ margin: 0;
/* Adjust margin between items as needed */
} }
.pagination .page-link { .pagination .page-link {
display: block; /* Make the link fill the li element */ display: block;
padding: 5px 10px; /* Adjust padding as needed */ /* Make the link fill the li element */
margin: 0 2px; /* Space out the page links */ padding: 5px 10px;
/* Adjust padding as needed */
margin: 0 2px;
/* Space out the page links */
} }
#site-footer { #site-footer {
@ -94,7 +104,7 @@ body {
[aria-disabled="true"] { [aria-disabled="true"] {
text-decoration: none !important; text-decoration: none !important;
} }
.page-item { .page-item {
&.active { &.active {
@ -120,4 +130,4 @@ blockquote {
content: "—— "; content: "—— ";
} }
} }
} }

View File

@ -117,10 +117,12 @@ staticDir = ['static']
weight = 40 weight = 40
[[menu.main]] [[menu.main]]
identifier = 'stories' identifier = 'journals'
name = "Hikayeler 🚧" name = "Hususi"
url = "#/" url = "journals/"
weight = 50 weight = 45
[menu.main.params]
id = "caution-menu"
[[menu.main]] [[menu.main]]
identifier = 'running' identifier = 'running'

View File

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

Before

Width:  |  Height:  |  Size: 502 KiB

After

Width:  |  Height:  |  Size: 502 KiB

View File

Before

Width:  |  Height:  |  Size: 845 KiB

After

Width:  |  Height:  |  Size: 845 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

Before

Width:  |  Height:  |  Size: 1012 KiB

After

Width:  |  Height:  |  Size: 1012 KiB

View File

@ -1,7 +1,9 @@
- id: about - id: about
translation: "About" translation: "About"
- id: posts - id: posts
translation: "Posts" translation: "Posts 🚧"
- id: journals
translation: "Personal"
- id: projects - id: projects
translation: "Projects" translation: "Projects"
- id: stories - id: stories

View File

@ -1,8 +1,10 @@
- id: backTitle - id: backTitle
translation: "🞀 Anasayfaya Dön" translation: "🞀 Anasayfaya Dön"
- id: posts - id: posts
translation: "Yazılar" translation: "Yazılar 🚧"
- id: tags - id: tags
translation: "Etiketler" translation: "Etiketler"
- id: back-to-posts - id: back-to-posts
translation: "🞀 Yazılara Dön" translation: "🞀 Yazılara Dön"
- id: journals
translation: "Hususi"

View File

@ -0,0 +1,7 @@
<h1>{{ .Title }}</h1>
<p>{{ .Summary }}</p>
<div>
{{ range .Pages }}
{{ .Render "li" }}
{{ end }}
</div>

View File

@ -11,3 +11,18 @@
</div> </div>
</main> </main>
{{ end }} {{ end }}
{{ define "footer" }}
{{ with resources.Get "js/main.js" }}
{{ if hugo.IsDevelopment }}
{{ with . | js.Build }}
<script src="{{ .RelPermalink }}"></script>
{{ end }}
{{ else }}
{{ $opts := dict "minify" true }}
{{ with . | js.Build $opts | fingerprint }}
<script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ end }}
{{ end }}
{{ end }}

View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="{{.Site.LanguageCode}}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
{{- with .Site.Params.themeColor }}
<meta name="theme-color" content="{{.}}">
<meta name="msapplication-TileColor" content="{{.}}">
{{- end }}
{{- partial "structured-data.html" . }}
{{- partial "favicons.html" }}
<title>{{.Title}}</title>
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Title | safeHTML }}
{{ end -}}
{{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}}
<link rel="stylesheet" href="{{ $style.Permalink }}" {{ printf "integrity=%q" $style.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous">
{{- block "head" . -}}{{- end }}
{{- range .Site.Params.customCSS }}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}
{{ if .IsTranslated }}
{{ range .Translations }}
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}">
{{ end }}
{{ end }}
{{- if templates.Exists "partials/extra-head.html" -}}
{{ partial "extra-head.html" . }}
{{- end }}
</head>
<body id="posts-body">
{{ block "header" . -}}{{ end -}}
{{ block "main" . -}}{{ end -}}
{{ block "footer" . -}}{{ end }}
</body>
</html>

View File

@ -0,0 +1,27 @@
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
{{ define "main" }}
<main id="posts-list">
{{- if .Content }}
<div class="content">
{{ .Content }}
</div>
{{- end }}
{{ range (.Paginate .Pages.ByPublishDate ).Pages }}
<p class="post-item">
<a href="{{.Permalink}}">
<span class="post-title">{{.Title}}</span>
</a>
</p>
{{ end }}
</main>
{{ end }}
{{ define "footer" }}
<div id="posts-footer">
{{ partial "pagination.html" . }}
{{ partial "footer.html" . }}
</div>
{{ end }}

27
layouts/journals/rss.xml Normal file
View File

@ -0,0 +1,27 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end -}}
{{ range .Pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | html }}</description>
<content type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content>
</item>
{{ end }}
</channel>
</rss>

View File

@ -0,0 +1,38 @@
{{ define "header" }}
{{ partial "post/header.html" . }}
{{ end }}
{{ define "main" }}
<main class="site-main section-inner animated fadeIn faster">
<article class="thin">
<header class="post-header">
{{- with .Params.tags }}
<div class="post-tags">
{{- range . -}}
<span class="tag"><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">#{{.}}</a></span>
{{- end }}
</div>
{{- end }}
</header>
{{- if (or .Params.images .Params.featuredImg) }}
<div class="featured-image">
<img src="{{.Params.featuredImg}}">
</div>
{{- end }}
<div class="post-content">
{{ .Content | safeHTML }}
</div>
{{- if .Site.Params.relatedPosts }}
{{- partial "related-posts.html" . -}}
{{- end }}
<hr class="post-end">
<a class="post-to-top-link" href="#">⮝ Başa dön</a>
</article>
</main>
{{ end }}
{{ define "footer" }}
{{ partialCached "footer.html" . }}
{{ end }}

View File

@ -1,12 +1,16 @@
{{- range .Site.Menus.main }} {{- range .Site.Menus.main }}
{{- if .HasChildren }} {{- if .HasChildren }}
<a href="{{ .URL | absLangURL }}" class="has-children">{{ or (T .Identifier) .Name | safeHTML }}</a> <a href="{{ .URL | absLangURL }}" class="has-children">{{ or (T .Identifier) .Name | safeHTML }}</a>
<span class="sub-menu"> <span class="sub-menu">
{{- range .Children }} {{- range .Children }}
<a href="{{ .URL | absLangURL }}">{{ or (T .Identifier) .Name | safeHTML }}</a> <a href="{{ .URL | absLangURL }}">{{ or (T .Identifier) .Name |
{{- end }} safeHTML }}</a>
</span>
{{- else }}
<a href="{{ .URL | absLangURL }}">{{ or (T .Identifier) .Name | safeHTML }}</a>
{{- end }}
{{- end }} {{- end }}
</span>
{{- else }}
<a {{ with .Params -}} class="{{ .class }}" id="{{ .id }}" {{ end -}} href="{{ .URL | absLangURL }}">{{ or (T
.Identifier) .Name |
safeHTML }}</a>
{{ .Post }}
{{- end }}
{{- end }}

View File

@ -1,6 +1,6 @@
<header id="post-header"> <header id="post-header">
{{ $link := "posts/" }} {{ $link := "posts/" }}
<a href="{{ $link | absLangURL }}">{{ i18n "back-to-posts" | safeHTML }}</a> <a href="{{ .Section | absLangURL }}">🞀 {{ i18n .Section | safeHTML }}</a>
<h1 id="post-title">{{ .Title }}</h1> <h1 id="post-title">{{ .Title }}</h1>
<div class="post-meta"><span>{{ time.Format .Site.Params.dateform .Date }}</span></div> <div class="post-meta"><span>{{ time.Format .Site.Params.dateform .Date }}</span></div>
</header> </header>