Skip to content

Commit b71a44f

Browse files
committed
add theme
1 parent 15279df commit b71a44f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1395
-0
lines changed

config.example.yaml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
baseURL: https://eternity.bora.sh # todo: change site url.
2+
title: Eternity # todo: change site name.
3+
defaultContentLanguage: 'en'
4+
theme: eternity
5+
6+
params:
7+
image: /images/banner.png
8+
subtitle: Eternity is a minimalist Hugo theme designed for portfolio sites with a fresh feel. # todo: change default subtitle for your website.
9+
googleAnalytics: '' # todo: set your analytics id.
10+
copyright: All rights reserved. # todo: set your copyright type.
11+
author: Lovely Author # todo: set your full name.
12+
dontShowSource: false # please, do not do this :)
13+
portfolio:
14+
columns:
15+
desktop:
16+
nature: 4
17+
archive: 6
18+
people: 2
19+
default: 3
20+
mobile:
21+
default: 2
22+
archive: 3
23+
people: 1
24+
socials:
25+
# todo: change these links.
26+
- icon: 'far fa-envelope fa-lg'
27+
url: 'mailto:[email protected]'
28+
landing: true
29+
- icon: 'fab fa-github fa-lg'
30+
url: 'https://github.com/boratanrikulu/eternity'
31+
landing: true
32+
- icon: 'fab fa-instagram fa-lg'
33+
url: 'https://instagram.bora.sh/eternity'
34+
- icon: 'fab fa-linkedin-in fa-lg'
35+
url: 'https://linkedin.bora.sh/in/eternity'
36+
homepage: "/work" # homepage link, mostly same with menu.main[0]
37+
38+
markup:
39+
defaultMarkdownHandler: goldmark
40+
goldmark:
41+
renderer:
42+
unsafe: true
43+
44+
taxonomies:
45+
tag: tags
46+
47+
permalinks:
48+
work: ":filename/"
49+
50+
menu:
51+
main:
52+
- name: work
53+
url: /work/
54+
weight: 1
55+
- name: people
56+
url: /tags/people/
57+
weight: 2
58+
- name: nature
59+
url: /tags/nature/
60+
weight: 3
61+
- name: archive
62+
url: /tags/archive/
63+
weight: 4
64+
- name: about
65+
url: /about/
66+
weight: 5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>

layouts/_default/list.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{ $portfolioScratch := newScratch }}
2+
{{ $portfolioMobileScratch := newScratch }}
3+
{{ partial "slides/columns" (dict "portfolioScratch" $portfolioScratch "portfolioMobileScratch" $portfolioMobileScratch "ctx" .) }}
4+
5+
{{ partial "header.html" . }}
6+
{{ partial "navbar.html" . }}
7+
8+
<section id="desktop" class="section work">
9+
{{ partial "helpers/hidden-menu.html" . }}
10+
{{ partial "slides/slider" (dict "scratch" $portfolioScratch "type" "desktop") }}
11+
</section>
12+
13+
<section id="mobile" class="section work">
14+
{{ partial "helpers/hidden-menu.html" . }}
15+
{{ partial "slides/slider" (dict "scratch" $portfolioMobileScratch "type" "mobile") }}
16+
</section>
17+
18+
{{ partial "slides/slides" $portfolioScratch }}
19+
{{ partial "footer" . }}

layouts/_default/single.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{ partial "header.html" . }}
2+
3+
{{ partial "navbar.html" . }}
4+
5+
<section class="section">
6+
{{ partial "slides/slide.html" (dict "disableFullheight" true "ctx" .) }}
7+
</section>
8+
9+
{{ partial "footer.html" . }}

layouts/index.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html>
3+
{{ partial "header.html" . }}
4+
5+
<section class="hero is-fullheight welcome">
6+
{{ partial "navbar.html" . }}
7+
<div class="hero-body has-text-centered">
8+
<div class="container">
9+
<div class="enter">
10+
<button onclick="window.location.href='{{ relref . .Site.Params.Homepage }}'"
11+
class="button is-white is-large is-outlined">enter</button>
12+
</div>
13+
{{ range $d := .Params.Desc }}
14+
<p>{{ $d }}</p>
15+
{{ end }}
16+
</div>
17+
</div>
18+
<div class="welcome-end">
19+
{{ partial "footer_base.html" . }}
20+
</div>
21+
</section>
22+
23+
{{ partial "footer.html" . }}

layouts/nil/single.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{ partial "header.html" . }}
2+
3+
{{ partial "navbar.html" . }}
4+
<body>
5+
<section class="hero is-fullheight">
6+
<div class="hero-body">
7+
<div class="">
8+
<div class="header-404">
9+
<img src="/eternity.png" alt="">
10+
</div>
11+
<div class="body-404">
12+
<p class="subtitle-404">This is not where you want to be</p>
13+
<p class="title-404">404</p>
14+
<a href="/">Go home</a>
15+
</div>
16+
</div>
17+
</div>
18+
</section>
19+
{{ partial "footer.html" . }}

layouts/partials/footer.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{ if not .IsHome }}
2+
<footer class="footer">
3+
{{ partial "footer_base.html" . }}
4+
</footer>
5+
{{ end }}
6+
</body>
7+
8+
{{ template "_internal/google_analytics.html" . }}
9+
{{ template "_internal/google_analytics_async.html" . }}
10+
</html>

layouts/partials/footer_base.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<div class="content has-text-centered">
2+
<p>
3+
{{ with .Site.Params.Copyright }}
4+
{{ . }} <br>
5+
{{ end }}
6+
{{ with .Site.Params.Author }}
7+
© {{ dateFormat "2006" now }}, {{ . }}.
8+
{{ end }}
9+
</p>
10+
{{ if not .Site.Params.DontShowSource}}
11+
<p>
12+
Made with
13+
<a target="_blank" class="source-love" href="https://github.com/boratanrikulu/eternity">Love</a>
14+
<i class="fa-solid fa-heart"></i>
15+
</p>
16+
{{ end }}
17+
</div>

layouts/partials/head.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<body>
2+
<section class="section">
3+
<div class="container">
4+
<header>
5+
<h1 class="site-title">
6+
<a href="/">{{ .Site.Title }}</a>
7+
</h1>
8+
<p class="subtitle">
9+
{{ .Site.Params.Subtitle | markdownify }}
10+
</p>
11+
</header>

layouts/partials/header.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
9+
{{ if and .Title (not .IsHome) }}
10+
<title>{{ .Title }} {{ if .Params.Subtitle }}- {{ .Params.Subtitle }}{{else}}- {{ .Site.Title }}{{ end }} </title>
11+
{{ else }}
12+
<title>{{ .Site.Title }} </title>
13+
{{ end }}
14+
{{ partial "meta" . }}
15+
16+
<link rel="icon" type="image/png" href=/favicon.ico />
17+
<link rel="stylesheet" href="/css/main.css">
18+
<script src="/js/main.js"></script>
19+
<script src="https://kit.fontawesome.com/bf18cd1a66.js" crossorigin="anonymous"></script>
20+
</head>
21+
22+
<body>

layouts/partials/helpers/exif.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<div class="exif">
2+
<details>
3+
<summary>Exif</summary>
4+
<ul>
5+
{{ with .Date }}<li>Date: {{ .Format "January 2, 2006" }}</li>{{ end }}
6+
{{ with .Tags.Copyright }}<li>Copyright: {{ . }}</li>{{ end }}
7+
{{ with .Tags.ApertureValue }}<li>Aperture: {{ lang.NumFmt 2 . }}</li>{{ end }}
8+
{{ with .Tags.BrightnessValue }}<li>Brightness: {{ lang.NumFmt 2 . }}</li>{{ end }}
9+
{{ with .Tags.ExposureTime }}<li>Exposure Time: {{ . }}</li>{{ end }}
10+
{{ with .Tags.FNumber }}<li>F Number: {{ . }}</li>{{ end }}
11+
{{ with .Tags.FocalLength }}<li>Focal Length: {{ . }}</li>{{ end }}
12+
{{ with .Tags.ISOSpeedRatings }}<li>ISO Speed Ratings: {{ . }}</li>{{ end }}
13+
{{ with .Tags.Model }}<li>Model: {{ . }}</li>{{ end }}
14+
{{ with .Tags.LensModel }}<li>Lens Model: {{ . }}</li>{{ end }}
15+
</ul>
16+
</details>
17+
</div>

layouts/partials/helpers/get.html

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
Returns image by getting from locale or remote.
3+
4+
Example usage;
5+
{{/* $scratch := newScratch */}}
6+
{{/* partial "helpers/get" (dict "scratch" $scratch "row" $row) */}}
7+
{{/* $img := $scratch.Get "img" */}}
8+
9+
Example usage on Post level;
10+
images:
11+
- https://bora.sh/logo.png
12+
- /images/logo.png
13+
Both images will be resized. Remote image will be downloaded while building the hugo site.
14+
-->
15+
16+
{{ if hasPrefix (index $.row.images 0) "/" }}
17+
{{ $.scratch.Set "img" (resources.Get (index $.row.images 0)) }}
18+
{{ else }}
19+
{{ $.scratch.Set "img" (resources.GetRemote (index $.row.images 0)) }}
20+
{{ end }}
21+
22+
{{ if $.row.mainImage }}
23+
{{ if hasPrefix (index $.row.images 0) "/" }}
24+
{{ $.scratch.Set "img" (resources.Get $.row.mainImage) }}
25+
{{ else }}
26+
{{ $.scratch.Set "img" (resources.GetRemote $.row.mainImage) }}
27+
{{ end }}
28+
{{ end }}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div class="center hidden-menu">
2+
{{ $IsNavbarPage := false }}
3+
{{ $currentPage := .Title }}
4+
{{ range $i, $el := .Site.Menus.main }}
5+
{{ if eq $currentPage $el.Name }}
6+
{{ if not $IsNavbarPage }}
7+
{{ $IsNavbarPage = true }}
8+
{{ end }}
9+
{{ end }}
10+
{{ end }}
11+
{{ if not $IsNavbarPage }}
12+
<p>#{{ $currentPage }}</p>
13+
{{ end }}
14+
</div>

layouts/partials/meta.html

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<meta name="description" content="{{ if .Params.Subtitle }}{{ .Params.Subtitle }}{{else}}{{ .Site.Params.Subtitle }}{{ end }}" />
2+
3+
<title itemprop="name">{{ default .Site.Title .Title }}</title>
4+
<meta property="og:title" content="{{ default .Site.Title .Title }}" />
5+
<meta name="twitter:title" content="{{ default .Site.Title .Title }}" />
6+
<meta itemprop="name" content="{{ default .Site.Title .Title }}" />
7+
<meta property="og:site_name" content="{{ .Site.Params.sitename }}" />
8+
<meta name="description" content="{{ default .Site.Params.Subtitle .Params.Subtitle }}" />
9+
<meta itemprop="description" content="{{ default .Site.Params.Subtitle .Params.Subtitle }}" />
10+
<meta property="og:description" content="{{ default .Site.Params.Subtitle .Params.Subtitle }}" />
11+
<meta name="twitter:description" content="{{ default .Site.Params.Subtitle .Params.Subtitle }}" />
12+
<base href="{{ .RelPermalink }}">
13+
<link rel="canonical" href="{{ .Permalink }}" itemprop="url" />
14+
<meta name="url" content="{{ .Permalink }}" />
15+
<meta property="og:url" content="{{ .Permalink }}" />
16+
<meta name="twitter:url" content="{{ .Permalink }}" />
17+
<meta name="twitter:card" content="summary" />
18+
{{ with .Site.Params.Author }}
19+
<meta name="twitter:creator" content="{{ . }}" />
20+
{{ end }}
21+
{{ $img := slice }}
22+
{{ if and .Params.images (gt (len .Params.images) 0) }}
23+
{{ $scratch := newScratch }}
24+
{{ partial "helpers/get" (dict "scratch" $scratch "row" .Params ) }}
25+
{{ $img = $scratch.Get "img" }}
26+
{{ $img = $img.Resize "1000x" }}
27+
{{ else if .Site.Params.image }}
28+
{{ $scratch := newScratch }}
29+
{{ $row := dict "images" (slice .Site.Params.image) }}
30+
{{ partial "helpers/get" (dict "scratch" $scratch "row" $row) }}
31+
{{ $img = $scratch.Get "img" }}
32+
{{ $img = $img.Resize "1000x" }}
33+
{{ end }}
34+
{{ with $img }}
35+
<meta itemprop="image" content="{{ .Permalink }}" />
36+
<meta property="og:image" content="{{ .Permalink }}" />
37+
<meta name="twitter:image" content="{{ .Permalink }}" />
38+
{{ end }}
39+
<meta property="og:locale" content="{{ .Language.Lang }}">

layouts/partials/navbar.html

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{{ $homeLink := .Site.Params.Homepage }}
2+
{{ if .IsHome }}
3+
{{ $homeLink = "/" }}
4+
{{ end }}
5+
<nav class="navbar" role="navigation" aria-label="main navigation">
6+
<div class="navbar-start">
7+
<div class="logo">
8+
<a href={{ relref . $homeLink }}>
9+
<img class="logo" src="/logo.png">
10+
</a>
11+
</div>
12+
</div>
13+
<div class="navbar-middle">
14+
<a class="a-clean" href={{ relref . $homeLink }}><p class="welcome-title">{{ .Site.Title }}</p></a>
15+
{{ if not .IsHome }}
16+
{{ if and .Site.Menus .Site.Menus.main }}
17+
<div class="menu">
18+
{{ $lastIndex := sub (len .Site.Menus.main) 1 }}
19+
{{ $currentPage := .RelPermalink }}
20+
{{ range $i, $el := .Site.Menus.main }}
21+
{{ $active := "" }}
22+
{{ if eq $el.URL $currentPage }}
23+
{{ $active = "active" }}
24+
{{ end }}
25+
<a class="{{ $active }}" href="{{ $el.URL }}">{{ $el.Name }}</a>
26+
{{ if ne $i $lastIndex }} / {{ end }}
27+
{{ end }}
28+
</div>
29+
{{ end }}
30+
{{ end }}
31+
</div>
32+
<div class="navbar-end">
33+
<div class="socials">
34+
{{ $socials := .Site.Params.socials }}
35+
{{ if and .IsHome $socials }}
36+
{{ $socials = where $socials "landing" true }}
37+
{{ end }}
38+
{{ range $el := $socials }}
39+
<div class="social">
40+
<a href="{{ $el.url }}" target="_blank">
41+
<i class="{{ $el.icon }}"></i>
42+
</a>
43+
</div>
44+
{{ end }}
45+
</div>
46+
</div>
47+
</nav>

0 commit comments

Comments
 (0)