diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b99f3d..37a8c17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,25 +1,40 @@ name: Build and Deploy -on: +on: + pull_request: push: branches: - master jobs: build: - name: Build and Deploy + name: Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - submodules: true - - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: hugo-version: '0.104.3' extended: true + - name: Hugo Build + run: hugo --minify + + deploy: + name: Deploy + runs-on: ubuntu-latest + needs: [build] + if: github.event_name != 'pull_request' + steps: + - uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + - uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.104.3' + extended: true + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -27,8 +42,6 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - - name: Hugo Build - run: hugo --minify - - name: Deploy to S3 run: hugo deploy --maxDeletes -1 --invalidateCDN + diff --git a/archetypes/post.md b/archetypes/post.md index 848ccb8..21bf734 100644 --- a/archetypes/post.md +++ b/archetypes/post.md @@ -14,5 +14,8 @@ figurePositionShow = false keywords = [] tags = [] categories = [] +showReadTime = true +showShare = true +showRelatedInArticle = false +++ diff --git a/config.toml b/config.toml deleted file mode 100644 index b74f4ce..0000000 --- a/config.toml +++ /dev/null @@ -1,90 +0,0 @@ -baseurl = "https://www.softinio.com/" -title = "Salar Rahmanian" -author = "Salar Rahmanian" -enableRobotsTXT = true -enableEmoji = true -paginate = 10 - -[markup] - [markup.highlight] - codeFences = true - guessSyntax = true - hl_Lines = "--" - lineNoStart = 1 - lineNos = true # always set to true # else line numbers won't show at all! even when you toggle them on in the UI - lineNumbersInTable = false # toggling this on (i.e to true) or deleting this line will break the code blocks functionality. Will - noClasses = false - # style = "monokai" - tabWidth = 2 - [markup.goldmark.renderer] - hardWraps = false - unsafe = false # change to true to enable inclusion of rawHTML and math functions - xhtml = false - -[params] -author = "Salar Rahmanian" -twitter = "@SalarRahmanian" -largeTwitterCard = true -introDescription = "Software Engineer based in San Francisco Bay Area." -# ga_analytics = "UA-47014432-1" -ga_analytics = "G-XZR9K3MDHX" -matomo_site_id = "2" -numberOfTagsShown = 14 -fallBackOgImage = "salar.jpg" -codeMaxLines = 10 -codeLineNumbers = false -mainSections = ["post"] -centerLogo = false -# logo = "salar.jpg" -figurePositionShow = false -figurePositionLabel = "Figure" -mobileNavigation = "left" - -description = "Salar Rahmanian" -keywords = ["Salar", "Rahmanian", "Salar Rahmanian", "Blog", "python", "scala", "haskell", "nix", "NixOS"] - -[params.giscus] - enable = true - -[sitemap] - changefreq = "weekly" - priority = 0.5 - filename = "sitemap.xml" - - - -[outputs] - home = ["html", "jsonfeed","rss"] - page = ["html"] - -[outputFormats] - [outputFormats.jsonfeed] - mediaType = "application/json" - baseName = "feed" - isPlainText = true - -[deployment] -order = [".png$", ".jpg$", ".gif$", ".svg$"] - -[[deployment.targets]] -name = "softinio-deploy" -URL = "s3://www.softinio.com?region=us-east-1" -cloudFrontDistributionID = "E1CMSLHG2WR51C" - -[[deployment.matchers]] -# Cache static assets for 1 year. -pattern = "^.+\\.(js|css|svg|ttf)$" -cacheControl = "max-age=31536000, no-transform, public" -gzip = true - -[[deployment.matchers]] -pattern = "^.+\\.(png|jpg)$" -cacheControl = "max-age=31536000, no-transform, public" -gzip = false - -[[deployment.matchers]] -pattern = "^.+\\.(html|xml|json)$" -gzip = true - -[[module.imports]] -path = "github.com/softinio/hugo-clarity" diff --git a/config/_default/config.toml b/config/_default/config.toml new file mode 100644 index 0000000..35b085e --- /dev/null +++ b/config/_default/config.toml @@ -0,0 +1,58 @@ +baseurl = "https://www.softinio.com/" +title = "Salar Rahmanian" +author = "Salar Rahmanian" +enableRobotsTXT = true +enableEmoji = true +paginate = 10 + +# title = "Clarity" # Edit directly from config/_default/languages.toml # alternatively, uncomment this and remove `title` entry from the aforemention file. +# copyright = "Copyright © 2008–2018, Steve Francia and the Hugo Authors; all rights reserved." +# canonifyurls = true +theme = ["github.com/softinio/hugo-clarity"] +# disqusShortname = "" + +DefaultContentLanguage = "en" +# [languages] +# config/_default/languages.toml + +# [menus] +# config/_default/menus/menu.xx.toml + +[taxonomies] +category = "categories" +tag = "tags" +series = "series" + +[outputs] +home = ["HTML", "RSS", "JSON"] +page = ["html"] + +[sitemap] +changefreq = "weekly" +priority = 0.5 +filename = "sitemap.xml" + +[deployment] +order = [".png$", ".jpg$", ".gif$", ".svg$"] + +[[deployment.targets]] +name = "softinio-deploy" +URL = "s3://www.softinio.com?region=us-east-1" +cloudFrontDistributionID = "E1CMSLHG2WR51C" + +[[deployment.matchers]] +# Cache static assets for 1 year. +pattern = "^.+\\.(js|css|svg|ttf)$" +cacheControl = "max-age=31536000, no-transform, public" +gzip = true + +[[deployment.matchers]] +pattern = "^.+\\.(png|jpg)$" +cacheControl = "max-age=31536000, no-transform, public" +gzip = false + +[[deployment.matchers]] +pattern = "^.+\\.(html|xml|json)$" +gzip = true + + diff --git a/configTaxo.toml b/config/_default/configTaxo.toml similarity index 77% rename from configTaxo.toml rename to config/_default/configTaxo.toml index a6acc92..beb5961 100644 --- a/configTaxo.toml +++ b/config/_default/configTaxo.toml @@ -2,11 +2,6 @@ timeout = 30000 enableInlineShortcodes = true footnoteReturnLinkContents = "^" -[taxonomies] -category = "categories" -tag = "tags" -series = "series" - [privacy] [privacy.vimeo] @@ -25,4 +20,5 @@ simple = true [privacy.youtube] disabled = false -privacyEnhanced = true \ No newline at end of file +privacyEnhanced = true + diff --git a/config/_default/languages.toml b/config/_default/languages.toml new file mode 100644 index 0000000..b3ff308 --- /dev/null +++ b/config/_default/languages.toml @@ -0,0 +1,6 @@ + +[en] + title = "Salar Rahmanian" + LanguageName = "English" + weight = 1 + diff --git a/config/_default/markup.toml b/config/_default/markup.toml new file mode 100644 index 0000000..6a3b397 --- /dev/null +++ b/config/_default/markup.toml @@ -0,0 +1,17 @@ +[goldmark] + [goldmark.renderer] + hardWraps = false + unsafe = false # change to false to disable inclusion of rawHTML and math functions + xhtml = false + [goldmark.extensions] + typographer = false + [highlight] + codeFences = true + guessSyntax = true + hl_Lines = "--" + lineNoStart = 1 + lineNos = true # always set to true # else line numbers won't show at all! even when you toggle them on in the UI + lineNumbersInTable = false # toggling this on (i.e to true) or deleting this line will break the code blocks functionality. Will + noClasses = false + # style = "monokai" + tabWidth = 2 diff --git a/config/_default/menus/menu.en.toml b/config/_default/menus/menu.en.toml new file mode 100644 index 0000000..160e20f --- /dev/null +++ b/config/_default/menus/menu.en.toml @@ -0,0 +1,93 @@ +# [[main]] +# name = "Home" +# url = "" +# weight = -110 + +[[main]] + name = "About" + url = "about/" + weight = -109 + +[[main]] + name = "Resume" + url = "resume/" + weight = -108 + +[[main]] + name = "Newsletter" + url = "http://newsletter.softinio.com" + weight = -107 + +[[main]] + name = "Watch" + url = "https://watch.softinio.com/c/softinio/videos" + weight = -106 + +# Submenus are done this way: parent -> identifier +# [[main]] +# name = "Links" +# identifier = "Links" +# weight = -108 +# [[main]] +# parent = "Links" +# name = "LinkedIn" +# url = "https://www.linkedin.com/" +# [[main]] +# parent = "Links" +# name = "Twitter" +# url = "https://twitter.com/" + +# [[main]] +# name = "About" +# url = "about/" +# weight = -107 + +# social menu links + +[[social]] + name = "gitea" + weight = 1 + url = "https://git.softinio.com/softinio" +[[social]] + name = "github" + type = "social" + weight = 2 + url = "https://github.com/softinio" +[[social]] + name = "twitter" + weight = 3 + url = "https://twitter.com/SalarRahmanian" +[[social]] + name = "linkedin" + weight = 4 + url = "https://www.linkedin.com/in/salarrahmanian" +[[social]] + name = "youtube" + weight = 5 + url = "https://softin.io/youtube" +[[social]] + 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 = 8 + url = "index.xml" + +# other supported social links +# name = "youtube" +# url = "https://www.youtube.com/#" +# name = "facebook" +# url = "https://facebook.com/#" +# name = "instagram" +# url = "https://instagram.com/#" +# name = "stackoverflow" +# url = "https://stackoverflow.com/#" +# name = "gitlab" +# url = "https://gitlab.com/#" +# name = "discord" +# url = "https://discord.gg/#" diff --git a/config/_default/params.toml b/config/_default/params.toml new file mode 100644 index 0000000..53a7d35 --- /dev/null +++ b/config/_default/params.toml @@ -0,0 +1,148 @@ +# enable search +enableSearch = true + +# socials +twitter = "@SalarRahmanian" +largeTwitterCard = true +introDescription = "Software Engineer based in San Francisco Bay Area." +description = "Salar Rahmanian" +keywords = ["Salar", "Rahmanian", "Salar Rahmanian", "Blog", "python", "scala", "haskell", "nix", "NixOS"] + +# showShare = false # Uncomment to not show share buttons on each post. Also available in each post's front matter. + +# Google analytics Id +ga_analytics = "G-XZR9K3MDHX" + +# 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 + +# Whether to default to storing images and other assets in the `static` directory, or use Hugo page bundles. +# Switch to `true` if you'd like to group assets with the post itself (as a "leaf bundle"). +# This can be overridden at the page level; what is set below acts as the default if no page variable is set. +# Details on page bundles: https://gohugo.io/content-management/page-bundles/#leaf-bundles +usePageBundles = false + +# Path variables +# +# By default, each of these directories are children of the `static` directory. +# +# In some Apache server installs, these directory names could conflict and you +# may want to change them. See: +# https://github.com/chipzoller/hugo-clarity/issues/74 +# +# If you change the names of these directories, be sure to copy the contents of +# the originals to get the files included with Hugo Clarity. +# +# Images: +imagesDir = "images/" # without a leading forward slash +# Icons: +iconsDir = "icons/" # without a leading forward slash +# Fonts: +fontsDir = "fonts/" # without a leading forward slash + +# Social media sharing image: Will be used on Twitter, Facebook, LinkedIn, etc. +# when a given page has no other image present. +fallBackOgImage = "salar.jpg" + +# Logo image +# logo = "salar.jpg" + +# center logo on navbar +centerLogo = false # Set to "true" for centering or "false" for left aligned. + +# sets the maximum number of lines per codeblock. The codeblock will however be scrollable and expandable. +codeMaxLines = 10 + +# disable showing line numbers by default. Switch to `true` if you'd rather have them on. +codeLineNumbers = false + +# enable math notation. Switch to `true` to enable mathjax in your site. +enableMathNotation = false + +# directory(s) where your articles are located +mainSections = ["post"] # see config details here https://gohugo.io/functions/where/#mainsections + +# Label Non inline images on an article body +figurePositionShow = false # toggle on or off globally +# you can toggle this behaviour on or off on per page using the same variable inside your articles frontmatter +figurePositionLabel = "Figure" # the text before image number e.g Figure 1.0 + +# Set the collapsed mobile navigation to either appear from the left or the right +mobileNavigation = "left" # if you prefer right change to 'right' + +# some site owners want to decide how they would like their sites to be introduced users. These settings give you as a site owner to decide how the user will view your site for the first time. + +# please note that you cannot enforce both modes at the same time. i.e by enforcing one mode, you priotise it over the other (by setting it to true). enforceDarkMode will be commented out + +# please also not that mode toggle UI will remain in place. That way, if a user prefers darkmode, they can have their way. + +enforceLightMode = false +# enforceDarkMode = false + +# customize footer icon. see issue https://github.com/chipzoller/hugo-clarity/issues/77 +# footerLogo = "icons/copy.svg" + +# Customize Sidebar Disclaimer Text +# sidebardisclaimer = true +# disclaimerText = "The opinions expressed on this site are my own personal opinions and do not represent my employer’s view in any way." + +# Text for the languages menu. +languageMenuName = "🌐" + +# Title separator, default to |. +# titleSeparator = "|" + +# Enable or disable comments globally. Default to true. +# comments = false + +# Enable or disable Utterances (https://github.com/utterance/utterances) Github Issue-Based Commenting +# utterances = true #Run the utterances script in the single.html layout to load https://utteranc.es comments +# utterancesRepo = "GHUsername/Repository.Name" # Utterances is enabled when this param is set +# utterancesTheme = "github-light" # Default: github-dark +# utterancesIssueTerm = "pathname" # Default: pathname + +# Maximum number of recent posts. (default: 8) +# numberOfRecentPosts = 8 + +# Maximum number of featured posts. (default: 8) +# numberOfFeaturedPosts = 8 + +# Pin featured posts in list. +# pinFeatured = true + +# Maximum number of pinned featured posts. (default: 8) +# numberOfPinnedPosts = 8 + +# Date format. Checkout https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference for details. +# dateFormat = "2006-01-02" # Default to "Jan 2, 2006". +# customFonts = false # toggle to true if you want to use custom fonts only. + +# The year when ths website was created, this value is used in the copyright +# notice of the footer. +# since = 2016 + +# Show related content at the end of an article based on the 'series' taxonomy. Can be set in post front matter. +# showRelatedInArticle = false +# showRelatedInSidebar = false + +# website author +[author] +name = "Salar Rahmanian" +photo = "salar.jpg" + +[plausible_analytics] +enable = false # to enable plausible analytics set to true. +websiteDomain = "example.com" # domain name of your website, most cases same as your base url +# plausibleDomain = "plausible.io" # default is set to plausible.io, only required if plausible is selfhosted +# scritpName = "plausible" # default is set to plausible, only required if using a custome name for script + +[matomo_analytics] +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 + diff --git a/data/.keep b/data/.keep new file mode 100644 index 0000000..e69de29 diff --git a/data/menu.yaml b/data/menu.yaml deleted file mode 100644 index 4077b6e..0000000 --- a/data/menu.yaml +++ /dev/null @@ -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 - diff --git a/data/social.yaml b/data/social.yaml deleted file mode 100644 index 28979ec..0000000 --- a/data/social.yaml +++ /dev/null @@ -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 diff --git a/layouts/_default/.keep b/layouts/_default/.keep new file mode 100644 index 0000000..e69de29 diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml deleted file mode 100644 index e49c966..0000000 --- a/layouts/_default/rss.xml +++ /dev/null @@ -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 "" | safeHTML }} - - - {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} - {{ .Permalink }} - Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} - Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} - {{.}}{{end}}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} - {{- with .OutputFormats.Get "RSS" -}} - {{ printf "" .Permalink .MediaType | safeHTML }} - {{- end -}} - {{ range $pages }} - - {{ .Title }} - {{ .Permalink }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} - {{ .Permalink }} - {{ .Content | html }} - - {{ end }} - - diff --git a/layouts/_default/single.html b/layouts/_default/single.html deleted file mode 100644 index c802773..0000000 --- a/layouts/_default/single.html +++ /dev/null @@ -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) }} -
-
-

{{ .Title }}

- {{- partial "post-meta" . }} - {{ partial "share" . }} - {{ with .Params.featureImage }} - - {{ end }} - {{ if .Params.toc }} -

Overview

- {{ .TableOfContents }} - {{ end }} - {{- .Content }} -
- {{- partial "sidebar" . }} - -{{ partial "comments.html" . }} -
-{{- end }} diff --git a/layouts/index.jsonfeed.json b/layouts/index.jsonfeed.json deleted file mode 100644 index 1e0d890..0000000 --- a/layouts/index.jsonfeed.json +++ /dev/null @@ -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 }} - ] -} - diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html deleted file mode 100644 index f8673f4..0000000 --- a/layouts/partials/analytics.html +++ /dev/null @@ -1,24 +0,0 @@ -{{- with .Site.Params.ga_analytics }} - - -{{- end -}} -{{- with .Site.Params.matomo_site_id }} - -{{- end -}} - diff --git a/layouts/partials/head.html b/layouts/partials/head.html deleted file mode 100644 index 5e449b8..0000000 --- a/layouts/partials/head.html +++ /dev/null @@ -1,64 +0,0 @@ -{{- $params := site.Params }} -{{- $separator := default "|" $params.titleSeparator }} -{{- $title := "" }} -{{- if and .Title (ne (trim (lower .Site.Title) "") (trim (lower .Title) "")) }} - {{- if eq .Kind "taxonomy" }} - {{- $title = default .Title ( T (lower .Title) ) }} - {{- else }} - {{- $title = .Title }} - {{- end }} -{{- end }} - {{ if and .Title (ne (trim (lower .Site.Title) "") (trim (lower .Title) "")) }}{{ .Title }} | {{ end }}{{ .Site.Title }} - - {{ hugo.Generator }} - {{- with .Site.Params.ga_verify }} - - {{- end }} - - - {{- if (ne hugo.Environment "development") }} - {{- partial "analytics.html" . }} - {{- end }} - {{- partial "opengraph.html" . }} - {{- partial "favicon.html" . }} - -{{ range .AlternativeOutputFormats -}} - {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} -{{ end -}} - - -{{ $styles := partialCached "func/getStylesBundle" . }} - - - -{{ $bundle := partialCached "func/getJavascriptBundle" . }} - - - - - -{{- with $params.customCSS }} - {{- range . -}} - - {{- end }} -{{- end }} - - - -{{- if .Description -}} - -{{ else if .IsPage }} - -{{ else if .Site.Params.description }} - -{{- end -}} - -{{- if .Keywords -}} - {{ $length := len .Keywords | add -1 -}} - -{{ else if .Site.Params.keywords }} - {{ $length := len .Site.Params.keywords | add -1 -}} - -{{- end }} -Mastodon diff --git a/layouts/partials/icons.html b/layouts/partials/icons.html index 8650aab..897ea7b 100644 --- a/layouts/partials/icons.html +++ b/layouts/partials/icons.html @@ -54,5 +54,14 @@ + + + + + + + + + diff --git a/layouts/partials/newsletter.html b/layouts/partials/newsletter.html new file mode 100644 index 0000000..5827cb8 --- /dev/null +++ b/layouts/partials/newsletter.html @@ -0,0 +1,6 @@ +

Subscribe

+
+Subscribe to my newsletter +
+subscribe + diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 0c4e3d2..ee89e91 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -1,60 +1,109 @@ -{{ $s := .Site.Params }} +{{ $s := site.Params }} + diff --git a/static/img/techstack.png b/static/img/techstack.png new file mode 100644 index 0000000..e6e4536 Binary files /dev/null and b/static/img/techstack.png differ