Update toha theme to v4
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Marko Korhonen 2024-01-26 22:28:35 +02:00
parent 00bb334293
commit 7bdd8253d3
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
15 changed files with 4362 additions and 350 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
public/
resources/
node_modules/

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "themes/toha"]
path = themes/toha
url = https://github.com/hugo-toha/toha.git

View file

@ -1,13 +1,11 @@
steps:
submodules:
image: alpine/git
commands:
- git submodule update --init --recursive
build:
image: klakegg/hugo:ext-asciidoctor-ci
commands:
- hugo mod tidy
- hugo mod npm pack
- npm install
- rm -rf /korhonen.cc/*
- hugo -d /korhonen.cc
- hugo --gc -d /korhonen.cc
volumes:
- /var/www/korhonen.cc:/korhonen.cc

View file

@ -1,11 +1,8 @@
baseURL = 'https://korhonen.cc'
languageCode = 'en-us'
title = 'Marko Korhonen'
theme = 'toha'
enableEmoji = true
enableGitInfo = true
urls = ['.*']
staticDir = "assets"

View file

@ -0,0 +1,18 @@
[[imports]]
path = "github.com/hugo-toha/toha/v4"
[[mounts]]
source = "static/files"
target = "static/files"
[[mounts]]
source = "./node_modules/flag-icon-css/flags"
target = "static/flags"
[[mounts]]
source = "./node_modules/@fontsource/mulish/files"
target = "static/files"
[[mounts]]
source = "./node_modules/katex/dist/fonts"
target = "static/fonts"

View file

@ -1,6 +1,4 @@
enableBlogPost = true
enableTOC = true
background = "images/vincentiu-solomon-ln5drpv_ImI-unsplash.jpg"
background = "/images/vincentiu-solomon-ln5drpv_ImI-unsplash.jpg"
description = "Personal website and portfolio"
gitRepo = "https://git.korhonen.cc/FunctionalHacker/korhonen.cc"
@ -10,20 +8,20 @@ gitForge = "gitea"
[newsletter]
enable = false
[darkMode]
provider = "darkreader"
enable = true
default = "system"
[logo]
main = "images/marko.png"
inverted = "images/marko.png"
favicon = "favicon-32x32.png"
main = "/images/marko.png"
inverted = "/images/marko.png"
favicon = "/favicon-32x32.png"
[features.toc]
enable = true
[features.darkMode]
enable = true
[features.comment]
enable = true
[features.comment.giscus]
[features.comment.services.giscus]
repo = "FunctionalHacker/korhonen.cc"
repoID = "R_kgDOHfIUew"
category = "Announcements"
@ -31,11 +29,10 @@ categoryID = "DIC_kwDOHfIUe84CPnO-"
theme = "preferred_color_scheme"
[features.support]
enabled = true
enabled = false
[features.blog]
enable = true
[features.blog.sharebuttons]
facebook = true
twitter = true

5
go.mod Normal file
View file

@ -0,0 +1,5 @@
module git.korhonen.cc/FunctionalHacker/korhonen.cc
go 1.21.6
require github.com/hugo-toha/toha/v4 v4.1.1 // indirect

2
go.sum Normal file
View file

@ -0,0 +1,2 @@
github.com/hugo-toha/toha/v4 v4.1.1 h1:KbCWZRkHewaO6hsKxnlkyO9RjmBwIUbVh7KY+VfiNaU=
github.com/hugo-toha/toha/v4 v4.1.1/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ=

View file

@ -1,212 +0,0 @@
{{/* variables for enabling/disabling parts of the footer */}}
{{ $footerEnabled := site.Params.footer.enable | default true }}
{{ $navigationEnabled := site.Params.footer.navigation.enable | default true }}
{{ $customMenusEnabled := site.Params.footer.navigation.customMenus | default true }}
{{ $contactMeEnabled := site.Params.footer.contactMe.enable | default true }}
{{ $newsletterEnabled := site.Params.footer.newsletter.enable | default true }}
{{ $credentialsEnabled := site.Params.footer.credentials.enable | default true }}
{{ $disclaimerEnabled := site.Params.footer.disclaimer.enable | default false }}
{{/* Keep backward compatibility for the newsletter function */}}
{{ if site.Params.newsletter }}
{{ if site.Params.newsletter.enable }}
{{ $newsletterEnabled = true }}
{{ else }}
{{ $newsletterEnabled = false }}
{{ end }}
{{ end }}
{{ if $footerEnabled }}
{{ $author:= site.Data.author }}
{{ if (index site.Data site.Language.Lang).author }}
{{ $author = (index site.Data site.Language.Lang).author }}
{{ end }}
{{ $sections:= site.Data.sections }}
{{ if (index site.Data site.Language.Lang).sections }}
{{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }}
{{ $customMenus := site.Params.customMenus }}
{{ if (index site.Data site.Language.Lang).site.customMenus }}
{{ $customMenus = (index site.Data site.Language.Lang).site.customMenus }}
{{ end }}
{{ $copyrightNotice := now.Format "2006" | printf "© %s Copyright."}}
{{ if (index site.Data site.Language.Lang).site }}
{{ $siteConfig := (index site.Data site.Language.Lang).site }}
{{ if $siteConfig.copyright }}
{{ $copyrightNotice = $siteConfig.copyright }}
{{ end }}
{{ end }}
{{ $disclaimer := "" }}
{{ $siteConfig := (index site.Data site.Language.Lang).site }}
{{ if $siteConfig.disclaimer }}
{{ $disclaimer = $siteConfig.disclaimer }}
{{ end }}
{{/* footer logos */}}
{{ $themeLogo := "/images/theme-logo.png" }}
{{ $hugoLogo := "/images/hugo-logo.svg" }}
{{/* resize the logos. don't resize svg because it is not supported */}}
{{ $themeLogo:= resources.Get $themeLogo}}
{{ if and $themeLogo (ne $themeLogo.MediaType.SubType "svg") }}
{{ $themeLogo = $themeLogo.Resize "32x" }}
{{ end }}
{{ $themeLogo = $themeLogo.RelPermalink}}
{{ $hugoLogo:= resources.Get $hugoLogo}}
{{ if and $hugoLogo (ne $hugoLogo.MediaType.SubType "svg")}}
{{ $hugoLogo = $hugoLogo.Resize "32x" }}
{{ end }}
{{ $hugoLogo = $hugoLogo.RelPermalink}}
<footer id="footer" class="container-fluid text-center align-content-center footer pb-2">
<div class="container pt-5">
<div class="row text-left">
{{ if $navigationEnabled }}
<div class="col-md-4 col-sm-12">
<h5>{{ i18n "navigation" }}</h5>
{{ if $sections }}
<ul>
{{- range sort $sections "section.weight" }}
{{ if and (.section.enable) (.section.showOnNavbar)}}
{{ $sectionID := replace (lower .section.name) " " "-" }}
{{ if .section.id }}
{{ $sectionID = .section.id }}
{{ end }}
<li class="nav-item">
<a class="smooth-scroll" href="{{ "" | absLangURL }}#{{ $sectionID }}">{{ .section.name }}</a>
</li>
{{ end }}
{{- end }}
{{ if $customMenusEnabled }}
{{ range $customMenus }}
{{ if .showOnFooter }}
<li class="nav-item">
<a class="smooth-scroll" href="{{ .url }}">{{ .name }}</a>
</li>
{{ end }}
{{ end }}
{{ end }}
</ul>
{{ end }}
</div>
{{ end }}
{{ if (and $contactMeEnabled $author) }}
<div class="col-md-4 col-sm-12">
<h5>{{ i18n "contact_me" }}</h5>
<ul>
{{ range $key,$value:= $author.contactInfo }}
{{ if (eq $key "email") }}
<li><a href={{ printf "mailto:%s" $value }} target="_blank" rel="me">
<span><i class="fas fa-envelope"></i></span> <span>{{ $value }}</span>
</a></li>
{{ else if (eq $key "phone") }}
<li><a href={{ printf "tel:%s" $value }} target="_blank" rel="me">
<span><i class="fas fa-phone-alt"></i></span> <span>{{ $value }}</span>
</a></li>
{{ else if (eq $key "linkedin") }}
<li><a href={{ printf "https://www.linkedin.com/in/%s" $value }} target="_blank" rel="noopener">
<span><i class="fab fa-linkedin"></i></span> <span>{{ $author.name }}</span>
</a></li>
{{ else if (eq $key "github") }}
<li><a href={{ printf "https://github.com/%s" $value }} target="_blank" rel="noopener">
<span><i class="fab fa-github"></i></span> <span>{{ $value }}</span>
</a></li>
{{ else }}
<li><span>{{ title $key }}: </span> <span>{{ $value }}</span></li>
{{ end }}
{{ end }}
</ul>
</div>
{{ end }}
<!-------------- Newsletter --------------->
{{ if $newsletterEnabled }}
{{ $provider := site.Params.footer.newsletter.provider }}
<div class="col-md-4 col-sm-12">
<p>{{ i18n "newsletter_text" }}</p>
{{ if and (eq $provider "mailchimp") site.Params.footer.newsletter.mailchimpURL }} <!-- mailchimp -->
<form
action="{{ site.Params.footer.newsletter.mailchimpURL }}"
method="post"
id="mc-embedded-subscribe-form"
name="mc-embedded-subscribe-form"
class="validate"
target="_blank"
novalidate >
<div class="form-group">
<input
type="email"
class="form-control"
id="mce-EMAIL"
name="EMAIL"
aria-describedby="emailHelp"
placeholder="{{ i18n "newsletter_input_placeholder" }}"
/>
<small id="emailHelp" class="form-text text-muted"
>{{ i18n "newsletter_warning" }}</small
>
</div>
<button type="submit" class="btn btn-info">{{ i18n "submit" }}</button>
</form>
{{ else }}
<form method='post' action='https://blogtrottr.com'>
<div class="form-group">
<input type='email' class="form-control" name='btr_email' placeholder="{{ i18n "newsletter_input_placeholder" }}"/><br />
<input type='hidden' name='btr_url' value='{{ "" | absLangURL }}index.xml' />
<input type='hidden' name='schedule_type' value='1' />
<small id="emailHelp" class="form-text text-muted">{{ i18n "newsletter_warning" }}</small>
<button type="submit" class="btn btn-info"> {{ i18n "submit" }} </button>
</div>
</form>
{{ end }}
</div>
{{ end }}
</div>
</div>
{{ if and $disclaimerEnabled $disclaimer}}
<hr />
<div class="container">
<p id="disclaimer"><strong>{{ i18n "disclaimer_text" }}:</strong> {{ $disclaimer | markdownify }}</p>
</div>
{{ end }}
{{ if $credentialsEnabled }}
<hr />
<div class="container">
<div class="row text-left">
<div class="col-md-4">
<a id="theme" href="https://github.com/hossainemruz/toha" target="_blank" rel="noopener">
<img src="{{ $themeLogo }}" alt="Toha Theme Logo">
Toha
</a>
</div>
<div class="col-md-4 text-center">{{ replace $copyrightNotice "{year}" now.Year | markdownify }}</div>
<div class="col-md-4 text-right">
<a id="hugo" href="https://gohugo.io/" target="_blank" rel="noopener">{{ i18n "hugoAttributionText" }}
<img
src="{{ $hugoLogo }}"
alt="Hugo Logo"
height="18"
/>
</a>
</div>
</div>
</div>
{{ end }}
<!-- ==== Add ServiceWorker for PWA support ===== -->
<script>
if('serviceWorker' in navigator) {
navigator.serviceWorker
.register('/sw.js', { scope: '/' });
}
</script>
</footer>
<!-- umami analytics -->
<script async defer data-website-id="d79111e4-25ee-43d8-be20-5cd3a845a8cf" src="https://umami.korhonen.cc/ua9quuaW.js"></script>
{{end}}

View file

@ -1,40 +0,0 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<!-- ==== Add manifest for PWA support ===== -->
<link rel="manifest" href="/site.webmanifest" />
<!-- ============ import common css ========== -->
<link rel="stylesheet" href="{{ "/css/bootstrap.min.css" | relURL }}"/> <link
rel="stylesheet" href="{{ "/css/layouts/main.css" | relURL }}"/> <link
rel="stylesheet" href="{{ "/css/navigators/navbar.css" | relURL }}"/> <link
rel="stylesheet" href="{{ "/css/plyr.css" | relURL }}"/> <link rel="stylesheet"
href="{{ "/css/flag-icon.min.css" | relURL }}"/>
<!--=================== fonts ==============================-->
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Muli:wght@300;400;500;600"
/>
<!--=================== icons ==============================-->
<link rel="stylesheet" href="{{ "/fontawesome/css/all.min.css" | relURL }}"/>
<!--=================== dark mode ==========================-->
{{ if site.Params.darkMode.enable }} <link rel="stylesheet" href="{{
"/css/colortheme/colortheme.css" | relURL }}"/> {{ end }}
<!--================= fab-icon =========================-->
{{/* add favicon only if the site author has provided the the favicon */}} {{ if
site.Params.logo.favicon }} {{ $favicon := site.Params.logo.favicon }} {{/*
resize the favicon. don't resize svg because it is not supported */}} {{
$favicon = resources.Get $favicon }} {{ if and $favicon (ne
$favicon.MediaType.SubType "svg") }} {{ $favicon = $favicon.Resize "42x" }} {{
end }} {{ $favicon = $favicon.RelPermalink}}
<link rel="icon" type="image/png" href="{{ $favicon }}" />
<link rel="pgpkey" href="https://openpgpkey.korhonen.cc/.well-known/openpgpkey/korhonen.cc/hu/u59jwso7wz4bwuizmgx1qfqhr1i9mq6e">
<link rel="openid.delegate" href="https://korhonen.cc" />
<link rel="openid.server" href="https://openid.indieauth.com/openid" />
{{end}}

View file

@ -1,70 +0,0 @@
{{ $sectionID := replace (lower .section.name) " " "-" }}
{{ if .section.id }}
{{ $sectionID = .section.id }}
{{ end }}
{{ $author:= site.Data.author }}
{{ if (index site.Data site.Language.Lang).author }}
{{ $author = (index site.Data site.Language.Lang).author }}
{{ end }}
<div class="container anchor p-lg-5 about-section" id="{{ $sectionID }}">
<div class="row pt-sm-2 pt-md-4 align-self-center">
<!-- summary -->
<!-- takes up full section width if no badges/soft skills are specified -->
{{ if or (.softSkills) (.badges) }} <div class="col-sm-6"> {{ else }} <div class="col-sm-12"> {{ end }}
<h3 class="p-1">{{ $author.name }}</h3>
{{ if .designation }}
<h5 class="p-1">
{{ .designation }}
{{ if .company }}
{{ i18n "at"}} <a href="{{ .company.url }}" title="{{ .company.name }}" target="_blank" rel="noopener">{{ .company.name }}</a>
{{ end }}
</h5>
{{ end }}
<p class="p-1 text-justify">
{{ replace .summary "$workingExperienceYears" (sub now.Year 2020) | markdownify }}
</p>
<div class="text-container ml-auto">
<ul class="social-link d-flex">
{{ range .socialLinks }}
<li>
{{ if eq .name (i18n "email") }}
<a href="mailto:{{ .url }}" title="{{ .name }}" target="_blank" rel="noopener"><i class="{{ .icon }}"></i></a>
{{ else if eq .name (i18n "phone") }}
<a href="tel:{{ .url }}" title="{{ .name }}" target="_blank" rel="noopener"><i class="{{ .icon }}"></i></a>
{{ else if eq .name "GitHub" }}
<a href="{{ .url }}" title="{{ .name }}" target="_blank" rel="me"><i class="{{ .icon }}"></i></a>
{{ else }}
<a href="{{ .url }}" title="{{ .name }}" target="_blank" rel="noopener"><i class="{{ .icon }}"></i></a>
{{ end }}
</li>
{{ end }}
</ul>
</div>
{{ if .resume }}
<a href="{{ .resume | relURL }}" title="{{ i18n "resume"}}" target="#"
><button class="btn btn-dark">{{ i18n "resume"}}</button></a
>
{{ end }}
{{ range .resourceLinks }}
<a href="{{ .url | relURL }}" title="{{ .title }}" target="#"
><button class="btn btn-dark">{{ .title }}</button></a
>
{{ end }}
</div>
<!-- soft skills circular-progressbar -->
<div class="col-sm-6 pt-5 pl-md-4 pl-sm-3 pt-sm-0">
<div class="row">
{{ range .badges }}
{{ partial "misc/badge.html" . }}
{{ end }}
<!-- TODO: Remove this part in version v4+ -->
<!-- Keep backward compatibility with old configuration -->
{{ range .softSkills }}
{{ partial "misc/soft-skills.html" . }}
{{ end }}
</div>
</div>
</div>
</div>

4252
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

4
package.hugo.json Normal file
View file

@ -0,0 +1,4 @@
{
"name": "korhonen.cc",
"version": "0.1.0"
}

64
package.json Normal file
View file

@ -0,0 +1,64 @@
{
"comments": {
"dependencies": {},
"devDependencies": {
"@fontsource/mulish": "github.com/hugo-toha/toha/v4",
"@fortawesome/fontawesome-free": "github.com/hugo-toha/toha/v4",
"autoprefixer": "github.com/hugo-toha/toha/v4",
"bootstrap": "github.com/hugo-toha/toha/v4",
"eslint": "github.com/hugo-toha/toha/v4",
"eslint-config-prettier": "github.com/hugo-toha/toha/v4",
"eslint-config-standard": "github.com/hugo-toha/toha/v4",
"eslint-plugin-import": "github.com/hugo-toha/toha/v4",
"eslint-plugin-n": "github.com/hugo-toha/toha/v4",
"eslint-plugin-no-jquery": "github.com/hugo-toha/toha/v4",
"eslint-plugin-promise": "github.com/hugo-toha/toha/v4",
"feather-icons": "github.com/hugo-toha/toha/v4",
"filterizr": "github.com/hugo-toha/toha/v4",
"flag-icon-css": "github.com/hugo-toha/toha/v4",
"fuse.js": "github.com/hugo-toha/toha/v4",
"highlight.js": "github.com/hugo-toha/toha/v4",
"imagesloaded": "github.com/hugo-toha/toha/v4",
"include-media": "github.com/hugo-toha/toha/v4",
"ityped": "github.com/hugo-toha/toha/v4",
"katex": "github.com/hugo-toha/toha/v4",
"mark.js": "github.com/hugo-toha/toha/v4",
"mermaid": "github.com/hugo-toha/toha/v4",
"plyr": "github.com/hugo-toha/toha/v4",
"popper.js": "github.com/hugo-toha/toha/v4",
"postcss": "github.com/hugo-toha/toha/v4",
"postcss-cli": "github.com/hugo-toha/toha/v4"
}
},
"dependencies": {},
"devDependencies": {
"@fontsource/mulish": "4.5.13",
"@fortawesome/fontawesome-free": "^6.2.0",
"autoprefixer": "^10.4.13",
"bootstrap": "^4.6.2",
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.6.0",
"eslint-plugin-no-jquery": "^2.7.0",
"eslint-plugin-promise": "^6.1.1",
"feather-icons": "^4.29.1",
"filterizr": "^2.2.4",
"flag-icon-css": "^4.1.7",
"fuse.js": "^6.6.2",
"highlight.js": "^11.6.0",
"imagesloaded": "^5.0.0",
"include-media": "^1.4.10",
"ityped": "^1.0.3",
"katex": "^0.16.3",
"mark.js": "^8.11.1",
"mermaid": "^9.2.1",
"plyr": "^3.7.2",
"popper.js": "^1.16.1",
"postcss": "^8.4.21",
"postcss-cli": "^8.3.1"
},
"name": "korhonen.cc",
"version": "0.1.0"
}

@ -1 +0,0 @@
Subproject commit 6704952afa1983f4583f3c3a431a2ae571d972bc