Update config, menu and sidebar

This commit is contained in:
Salar Rahmanian 2022-10-15 18:20:48 -07:00
parent d51269a9cf
commit bd7902f127
17 changed files with 166 additions and 167 deletions

View file

@ -14,5 +14,8 @@ figurePositionShow = false
keywords = []
tags = []
categories = []
showReadTime = true
showShare = true
showRelatedInArticle = false
+++

View file

@ -18,19 +18,14 @@ DefaultContentLanguage = "en"
# [menus]
# config/_default/menus/menu.xx.toml
# [outputs]
# home = ["HTML", "RSS", "JSON"]
# page = ["html"]
[taxonomies]
category = "categories"
tag = "tags"
series = "series"
[outputs]
home = ["html", "jsonfeed","rss"]
page = ["html"]
[outputFormats]
[outputFormats.jsonfeed]
mediaType = "application/json"
baseName = "feed"
isPlainText = true
home = ["HTML", "RSS", "JSON"]
page = ["html"]
[sitemap]
changefreq = "weekly"

View file

@ -2,11 +2,6 @@ timeout = 30000
enableInlineShortcodes = true
footnoteReturnLinkContents = "^"
[taxonomies]
category = "categories"
tag = "tags"
series = "series"
[privacy]
[privacy.vimeo]

View file

@ -1,6 +1,6 @@
[en]
title = "Clarity"
title = "Salar Rahmanian"
LanguageName = "English"
weight = 1

View file

@ -1,7 +1,7 @@
[[main]]
name = "Salar Rahmanian"
url = ""
weight = -110
# [[main]]
# name = "Home"
# url = ""
# weight = -110
[[main]]
name = "About"
@ -66,12 +66,16 @@
weight = 5
url = "https://softin.io/youtube"
[[social]]
name = "mastedon"
name = "matrix"
weight = 6
url = "https://matrix.to/#/@softinio:matrix.org"
[[social]]
name = "mastedon"
weight = 7
url = "https://fosstodon.org/@softinio"
[[social]]
name = "rss"
weight = 7
weight = 8
url = "index.xml"
# other supported social links

View file

@ -13,9 +13,6 @@ keywords = ["Salar", "Rahmanian", "Salar Rahmanian", "Blog", "python", "scala",
# Google analytics Id
ga_analytics = "G-XZR9K3MDHX"
# Matomo ID
matomo_site_id = "2"
# limit the number of taxonomies links shown on the sidebar of each page by default.
numberOfTagsShown = 14 # Applies for all other default & custom taxonomies. e.g categories, brands see https://gohugo.io/content-management/taxonomies#what-is-a-taxonomy
@ -37,7 +34,7 @@ usePageBundles = false
# the originals to get the files included with Hugo Clarity.
#
# Images:
imagesDir = "img/" # without a leading forward slash
imagesDir = "images/" # without a leading forward slash
# Icons:
iconsDir = "icons/" # without a leading forward slash
# Fonts:
@ -140,10 +137,11 @@ websiteDomain = "example.com" # domain name of your website, most cases same as
# scritpName = "plausible" # default is set to plausible, only required if using a custome name for script
[matomo_analytics]
enable = false # To enable matomo analytics change to `true`.
websiteDomain = "example.com" # Set the domain name of your website, in most cases same as your base URL this is required.
matomoDomain = "matomo.example.com" # Set to Matomo domain
matomoSiteID = "1" # Default is set to 1, change this to the siteid being tracked
enable = true # To enable matomo analytics change to `true`.
websiteDomain = "www.softinio.com" # Set the domain name of your website, in most cases same as your base URL this is required.
matomoDomain = "softinio.dev/matomo/" # Set to Matomo domain
matomoSiteID = "2" # Default is set to 1, change this to the siteid being tracked
[giscus]
enable = true

0
data/.keep Normal file
View file

View file

@ -1,9 +0,0 @@
- name: About
link: about
- name: Resumé
link: resume
- name: Newsletter
link: http://newsletter.softinio.com
- name: Watch
link: https://watch.softinio.com/c/softinio/videos

View file

@ -1,15 +0,0 @@
- item: "gitea"
url: "https://git.softinio.com/softinio"
- item: "github"
url: "https://github.com/softinio"
- item: "twitter"
url: "https://twitter.com/SalarRahmanian"
- item: "linkedin"
url: "https://www.linkedin.com/in/salarrahmanian/"
- item: "youtube"
url: "https://softin.io/youtube"
- item: "mastedon"
url: "https://fosstodon.org/@softinio"
- item: "rss"
url: "index.xml"
internal: true

0
layouts/_default/.keep Normal file
View file

View file

@ -1,39 +0,0 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<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>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
</rss>

View file

@ -1,28 +0,0 @@
{{- define "main" }}
{{- $scratch := newScratch }}
{{- if isset .Params "image" }}
{{- $scratch.Set "image" .Params.image }}
{{- else }}
{{ $scratch.Set "image" .Site.Params.fallBackOgImage }}
{{- end }}
{{- $image := $scratch.Get "image" }}
{{- $bg := (path.Join "images" $image | absLangURL) }}
<div class = 'grid-inverse wrap content'>
<article class='post_content'>
<h1 class='post_title'>{{ .Title }}</h1>
{{- partial "post-meta" . }}
{{ partial "share" . }}
{{ with .Params.featureImage }}
<img src = '{{ . }}' class="image_featured">
{{ end }}
{{ if .Params.toc }}
<h2>Overview</h2>
{{ .TableOfContents }}
{{ end }}
{{- .Content }}
</article>
{{- partial "sidebar" . }}
<!-- Comments -->
{{ partial "comments.html" . }}
</div>
{{- end }}

View file

@ -1,21 +0,0 @@
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ .Site.Title }}",
"home_page_url": {{ .Permalink | jsonify }},
"feed_url": {{ with .OutputFormats.Get "jsonfeed" -}}
{{- .Permalink | jsonify -}}
{{- end }},
"items": [
{{ range $index, $entry := first 10 .Data.Pages }}
{{- if $index }}, {{ end }}
{
"id": {{ .Permalink | jsonify }},
"url": {{ .Permalink | jsonify }},
"title": {{ .Title | jsonify }},
"date_published": {{ .Date.Format "2006-01-02T15:04:05Z07:00" | jsonify }},
"content_html": {{ .Content | jsonify }}
}
{{- end }}
]
}

View file

@ -1,24 +0,0 @@
{{- with .Site.Params.ga_analytics }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ . }}');
</script>
{{- end -}}
{{- with .Site.Params.matomo_site_id }}
<script>
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//softinio.dev/matomo/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', {{.}}]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
{{- end -}}

View file

@ -54,5 +54,14 @@
<path d="M622.7 149.8c-4.1-4.1-9.6-4-9.6-4s-117.2 6.6-177.9 8c-13.3.3-26.5.6-39.6.7v117.2c-5.5-2.6-11.1-5.3-16.6-7.9 0-36.4-.1-109.2-.1-109.2-29 .4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5c-9.8-.6-22.5-2.1-39 1.5-8.7 1.8-33.5 7.4-53.8 26.9C-4.9 212.4 6.6 276.2 8 285.8c1.7 11.7 6.9 44.2 31.7 72.5 45.8 56.1 144.4 54.8 144.4 54.8s12.1 28.9 30.6 55.5c25 33.1 50.7 58.9 75.7 62 63 0 188.9-.1 188.9-.1s12 .1 28.3-10.3c14-8.5 26.5-23.4 26.5-23.4S547 483 565 451.5c5.5-9.7 10.1-19.1 14.1-28 0 0 55.2-117.1 55.2-231.1-1.1-34.5-9.6-40.6-11.6-42.6zM125.6 353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6 321.8 60 295.4c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5 38.5-30c13.8-3.7 31-3.1 31-3.1s7.1 59.4 15.7 94.2c7.2 29.2 24.8 77.7 24.8 77.7s-26.1-3.1-43-9.1zm300.3 107.6s-6.1 14.5-19.6 15.4c-5.8.4-10.3-1.2-10.3-1.2s-.3-.1-5.3-2.1l-112.9-55s-10.9-5.7-12.8-15.6c-2.2-8.1 2.7-18.1 2.7-18.1L322 273s4.8-9.7 12.2-13c.6-.3 2.3-1 4.5-1.5 8.1-2.1 18 2.8 18 2.8L467.4 315s12.6 5.7 15.3 16.2c1.9 7.4-.5 14-1.8 17.2-6.3 15.4-55 113.1-55 113.1z"/>
<path d="M326.8 380.1c-8.2.1-15.4 5.8-17.3 13.8-1.9 8 2 16.3 9.1 20 7.7 4 17.5 1.8 22.7-5.4 5.1-7.1 4.3-16.9-1.8-23.1l24-49.1c1.5.1 3.7.2 6.2-.5 4.1-.9 7.1-3.6 7.1-3.6 4.2 1.8 8.6 3.8 13.2 6.1 4.8 2.4 9.3 4.9 13.4 7.3.9.5 1.8 1.1 2.8 1.9 1.6 1.3 3.4 3.1 4.7 5.5 1.9 5.5-1.9 14.9-1.9 14.9-2.3 7.6-18.4 40.6-18.4 40.6-8.1-.2-15.3 5-17.7 12.5-2.6 8.1 1.1 17.3 8.9 21.3 7.8 4 17.4 1.7 22.5-5.3 5-6.8 4.6-16.3-1.1-22.6 1.9-3.7 3.7-7.4 5.6-11.3 5-10.4 13.5-30.4 13.5-30.4.9-1.7 5.7-10.3 2.7-21.3-2.5-11.4-12.6-16.7-12.6-16.7-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3 4.7-9.7 9.4-19.3 14.1-29-4.1-2-8.1-4-12.2-6.1-4.8 9.8-9.7 19.7-14.5 29.5-6.7-.1-12.9 3.5-16.1 9.4-3.4 6.3-2.7 14.1 1.9 19.8l-24.6 50.4z"/>
</g>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 612 612" id="to-top">
<path d="M604.501 440.509L325.398 134.956c-5.331-5.357-12.423-7.627-19.386-7.27-6.989-.357-14.056 1.913-19.387 7.27L7.499 440.509c-9.999 10.024-9.999 26.298 0 36.323s26.223 10.024 36.222 0l262.293-287.164L568.28 476.832c9.999 10.024 26.222 10.024 36.221 0 9.999-10.023 9.999-26.298 0-36.323z"></path>
</symbol>
<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 71 55" id="discord">
<path d="M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z"/>
</symbol>
<symbol id="matrix" viewBox="0 0 24 24" id=".05226047285077895" xmlns="http://www.w3.org/2000/svg">
<path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033a3.312 3.312 0 0 1 1.117-1.024c.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.481.314.448.208.785.582 1.02 1.108.254-.374.6-.706 1.034-.992.434-.287.95-.43 1.546-.43.453 0 .872.056 1.26.167.388.11.716.286.993.53.276.245.489.559.646.951.152.392.23.863.23 1.417v5.728h-2.349V11.52c0-.286-.01-.559-.032-.812a1.755 1.755 0 0 0-.18-.66 1.106 1.106 0 0 0-.438-.448c-.194-.11-.457-.166-.785-.166-.332 0-.6.064-.803.189a1.38 1.38 0 0 0-.48.499 1.946 1.946 0 0 0-.231.696 5.56 5.56 0 0 0-.06.785v4.768h-2.35v-4.8c0-.254-.004-.503-.018-.752a2.074 2.074 0 0 0-.143-.688 1.052 1.052 0 0 0-.415-.503c-.194-.125-.476-.19-.854-.19-.111 0-.259.024-.439.074-.18.051-.36.143-.53.282a1.637 1.637 0 0 0-.439.595c-.12.259-.18.6-.18 1.02v4.966H5.46V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,6 @@
<h2>Subscribe</h2>
<div>
Subscribe to my newsletter
</div>
<a href="http://newsletter.softinio.com" class="button mt-1" role="button">subscribe</a>

View file

@ -0,0 +1,125 @@
{{ $s := site.Params }}
<aside class="sidebar">
<section class="sidebar_inner">
<br>
{{ partial "search/widget" . }}
{{- $introDescription := $s.introDescription }}
{{- with .Params.introDescription }}
{{- $introDescription = . }}
{{- end }}
{{- if $introDescription }}
{{- $author := $s.Author }}
{{- $showAuthorPhoto := false }}
{{- $fullAuthor := reflect.IsMap $author }}
{{- if $fullAuthor }}
{{- if $author.photo }}
{{- $showAuthorPhoto = true }}
{{- end }}
{{- end }}
{{- if $showAuthorPhoto }}
<div class="author_header">
<img src="{{ absURL $author.photo }}" alt="{{ $author.name }} photo">
<h2>{{ $author.name }}</h2>
</div>
{{- else }}
<h2>{{ if $fullAuthor }}{{ $author.name }}{{ else }}{{ $author }}{{ end }}</h2>
{{- end }}
<div class="author_bio">
{{ markdownify $introDescription }}
</div>
{{- if ( ne $s.introURL false ) }}
{{- $r := T "read_more" }}
<a href='{{ absLangURL (default "about/" $s.introURL) }}' class="button mt-1" role="button" title='{{ $r }}'>{{ $r }}</a>
<!-- salar_custom: Only change from themes sidebar was to add this partial -->
{{ partial "newsletter" . }}
<!-- end_salar_custom -->
{{- end }}
{{- end }}
{{ if .Site.Params.sidebardisclaimer }}
<div class="sidebardisclaimer">
<h2 class="mt-4">Disclaimer</h2>
{{ .Site.Params.disclaimerText }}
</div>
{{ end }}
{{- $relatedInSidebar := true }}
{{- if eq $s.showRelatedInSidebar false }}
{{ $relatedInSidebar = false }}
{{- end }}
{{ if (and ($relatedInSidebar) (isset .Params "series") ) }}
{{$related := where .Site.RegularPages ".Params.series" "eq" .Params.series }}
<h2 class="mt-4">{{ T "series_posts" }}</h2>
<ul>
{{ range $related }}
<li>
<a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
{{ end }}
{{- $posts := where .Site.RegularPages "Type" "in" $s.mainSections }}
{{- $featured := default 8 $s.numberOfFeaturedPosts }}
{{- $featuredPosts := first $featured (where $posts "Params.featured" true)}}
{{- with $featuredPosts }}
<h2 class="mt-4">{{ T "featured_posts" }}</h2>
<ul>
{{- range . }}
<li>
<a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
</li>
{{- end }}
</ul>
{{- end }}
<h2 class="mt-4">{{ T "recent_posts" }}</h2>
<ul class="flex-column">
{{- $recent := default 8 $s.numberOfRecentPosts }}
{{- range first $recent $posts | symdiff $featuredPosts }}
<li>
<a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
</li>
{{- end }}
</ul>
{{- $tagsLimit := (default 100 $s.numberOfTagsShown) }}
{{- range $key, $value := .Site.Taxonomies }}
{{- if gt $value 0 }}
<div>
<h2 class="mt-4 taxonomy" id="{{ $key }}-section">{{ T $key }}</h2>
<nav class="tags_nav">
{{- $onPageTags := $.Page.Params.tags }}
{{- $slicedTags := ($value.ByCount | first $tagsLimit) }}
{{- range $slicedTags }}
<a href='{{ absLangURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/' class="post_tag button button_translucent" title="{{ .Name }}">
{{ upper .Name }}
<span class="button_tally">{{ .Count }}</span>
</a>
{{ end }}
{{ if gt (len $value.ByCount) $tagsLimit }}
<br>
<div class="post_tags_toggle button">{{ T (printf "all_%s" (lower $key)) }}</div>
{{- $tagsInfo := newScratch }}
<div class="post_tags">
<div class="tags_list">
{{- range $value.Alphabetical }}
{{ $tagsInfo.Add "tagsInfo" (slice .Name .Count)}}
<a href='{{ absLangURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/' class=" post_tag button button_translucent" data-position={{ .Count }} title="{{ .Name }}">
{{- upper .Name -}}
<span class="button_tally">{{ .Count }}</span>
</a>
{{ end }}
<div class="tags_sort"><span title="sort alphabetically">[A~Z]</span><span title="sort by count">[0~9]</span>
</div>
<span class="tags_hide"><svg class="icon">
<use xlink:href="#closeme"></use>
</svg></span>
</div>
</div>
{{- end }}
</nav>
</div>
{{- end }}
{{- end }}
</section>
</aside>