From c7fe2b30637dada40258c36d5aa35ce94509a499 Mon Sep 17 00:00:00 2001 From: Amir Pourmand Date: Sat, 28 Jan 2023 14:35:47 +0330 Subject: [PATCH 01/10] fix _img file (executable) --- .pre-commit-config.yaml | 5 +++++ layouts/partials/modules/responsive-images/_img.html | 0 2 files changed, 5 insertions(+) mode change 100755 => 100644 layouts/partials/modules/responsive-images/_img.html diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fbfa347a..a4110cc9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,11 @@ repos: - id: check-xml - id: check-yaml - id: end-of-file-fixer + - id: check-case-conflict + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: detect-private-key - id: mixed-line-ending - id: trailing-whitespace args: [--markdown-linebreak-ext=md] diff --git a/layouts/partials/modules/responsive-images/_img.html b/layouts/partials/modules/responsive-images/_img.html old mode 100755 new mode 100644 From 597c15f9272fa0ae6186500bc57678a4e828f900 Mon Sep 17 00:00:00 2001 From: Amir Pourmand Date: Sat, 28 Jan 2023 21:49:30 +0330 Subject: [PATCH 02/10] add formatter for gohtml --- .pre-commit-config.yaml | 10 ++++++++++ .prettierrc | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .prettierrc diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a4110cc9..e5041c7c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,7 @@ repos: - id: check-shebang-scripts-are-executable - id: detect-private-key - id: mixed-line-ending + args: [--fix=lf] - id: trailing-whitespace args: [--markdown-linebreak-ext=md] @@ -39,3 +40,12 @@ repos: hooks: - id: prettier files: \.(js|ts|jsx|tsx|css|less|json|markdown|md|scss)$ + +- repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.3.0 + hooks: + - id: prettier + files: \.(html)$ + additional_dependencies: + - prettier@2.3.0 + - prettier-plugin-go-template@0.0.13 diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..c99d7d5d --- /dev/null +++ b/.prettierrc @@ -0,0 +1,10 @@ +{ + "overrides": [ + { + "files": ["*.html"], + "options": { + "parser": "go-template" + } + } + ] +} From f13387fd1aa5b78a116bb3230e0674eab74140a0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 28 Jan 2023 18:22:02 +0000 Subject: [PATCH 03/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 6 +- assets/css/_base.scss | 28 +- assets/css/_themes.scss | 58 +- content/news/announcement1.md | 2 +- content/news/announcement2.md | 2 +- content/posts/all-markdown-features.md | 16 +- content/posts/socialism.md | 12 +- content/teaching.md | 2 +- layouts/404.html | 11 +- layouts/_default/baseof.html | 35 +- layouts/_default/list.html | 37 +- layouts/_default/single.html | 27 +- layouts/index.html | 104 +- layouts/partials/footer.html | 24 +- layouts/partials/head.html | 67 +- layouts/partials/list.html | 28 +- layouts/partials/metadata.html | 23 +- .../modules/responsive-images/__img.html | 21 +- .../modules/responsive-images/_img.html | 58 +- .../modules/responsive-images/img.html | 19 +- layouts/partials/modules/svg-icons/_svg.html | 82 +- layouts/partials/modules/svg-icons/svg.html | 2 +- layouts/partials/news/recents.html | 28 +- layouts/partials/posts/list.html | 89 +- layouts/partials/posts/recents.html | 28 +- layouts/partials/scripts/cloakemail.html | 11 +- layouts/partials/scripts/hamburger.html | 14 +- layouts/partials/scripts/katex.html | 22 +- layouts/partials/scripts/theme.html | 24 +- layouts/partials/social.html | 26 +- layouts/partials/styles/cloakemail.html | 12 +- layouts/partials/taxonomy/list.html | 6 +- layouts/partials/themes/parse.html | 42 +- layouts/partials/themes/variables.html | 5 +- layouts/posts/list.html | 43 +- layouts/posts/single.html | 93 +- package-lock.json | 3822 ++++++++--------- package.json | 34 +- postcss.config.js | 10 +- prettier.config.js | 8 +- tailwind.config.js | 28 +- 41 files changed, 2548 insertions(+), 2461 deletions(-) diff --git a/README.md b/README.md index 502d43c8..bbcf56b7 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,6 @@ To Install this theme for your own: ## Features -- Customizable Color palettes (see `data/themes`) -- Blog Section -- News Section +- Customizable Color palettes (see `data/themes`) +- Blog Section +- News Section diff --git a/assets/css/_base.scss b/assets/css/_base.scss index 105d2f68..0cc428bb 100644 --- a/assets/css/_base.scss +++ b/assets/css/_base.scss @@ -1,35 +1,35 @@ a { - color: var(--global-theme-color); + color: var(--global-theme-color); - &:hover { - color: var(--global-theme-color); - text-decoration: underline; - } + &:hover { + color: var(--global-theme-color); + text-decoration: underline; + } } code { - color: var(--global-theme-color); + color: var(--global-theme-color); - vertical-align: bottom; + vertical-align: bottom; } pre { - overflow: auto hidden; + overflow: auto hidden; } // https://github.com/hugo-mods/icons/blob/main/assets/mod-icons/style.css .icon { - display: inline; + display: inline; - width: 1em; - height: 1em; + width: 1em; + height: 1em; - fill: currentColor; + fill: currentColor; - vertical-align: -0.14em; + vertical-align: -0.14em; } // https://katex.org/docs/issues.html#css-customization .katex-display { - overflow: auto hidden; + overflow: auto hidden; } diff --git a/assets/css/_themes.scss b/assets/css/_themes.scss index 11f50ed1..3dde01e3 100644 --- a/assets/css/_themes.scss +++ b/assets/css/_themes.scss @@ -3,41 +3,41 @@ ******************************************************************************/ :root { - --global-text-color-primary: #{$lightmode-text-color}; - --global-text-color-shade: #{$lightmode-text-color-light}; - --global-bg-color: #{$lightmode-bg-color}; - --global-theme-color: #{$lightmode-theme-color}; - --global-header-color: #{$lightmode-header-color}; - --global-footer-color: #{$lightmode-footer-color}; - --global-divider-color: #{$lightmode-divider-color}; + --global-text-color-primary: #{$lightmode-text-color}; + --global-text-color-shade: #{$lightmode-text-color-light}; + --global-bg-color: #{$lightmode-bg-color}; + --global-theme-color: #{$lightmode-theme-color}; + --global-header-color: #{$lightmode-header-color}; + --global-footer-color: #{$lightmode-footer-color}; + --global-divider-color: #{$lightmode-divider-color}; - #theme-toggle { - .icon-sun { - display: none; - } + #theme-toggle { + .icon-sun { + display: none; + } - .icon-moon { - display: inline; - } + .icon-moon { + display: inline; } + } } -html[class='dark'] { - --global-text-color-primary: #{$darkmode-text-color}; - --global-text-color-shade: #{$darkmode-text-color-dark}; - --global-bg-color: #{$darkmode-bg-color}; - --global-theme-color: #{$darkmode-theme-color}; - --global-header-color: #{$darkmode-header-color}; - --global-footer-color: #{$darkmode-footer-color}; - --global-divider-color: #{$darkmode-divider-color}; +html[class="dark"] { + --global-text-color-primary: #{$darkmode-text-color}; + --global-text-color-shade: #{$darkmode-text-color-dark}; + --global-bg-color: #{$darkmode-bg-color}; + --global-theme-color: #{$darkmode-theme-color}; + --global-header-color: #{$darkmode-header-color}; + --global-footer-color: #{$darkmode-footer-color}; + --global-divider-color: #{$darkmode-divider-color}; - #theme-toggle { - .icon-sun { - display: inline; - } + #theme-toggle { + .icon-sun { + display: inline; + } - .icon-moon { - display: none; - } + .icon-moon { + display: none; } + } } diff --git a/content/news/announcement1.md b/content/news/announcement1.md index 51fd4d3b..0fe8d9c2 100644 --- a/content/news/announcement1.md +++ b/content/news/announcement1.md @@ -1,5 +1,5 @@ --- -title: 'A simple inline announcement' +title: "A simple inline announcement" date: 2023-01-24T01:12:50+03:30 draft: false --- diff --git a/content/news/announcement2.md b/content/news/announcement2.md index 8b710e24..3f88ff7e 100644 --- a/content/news/announcement2.md +++ b/content/news/announcement2.md @@ -1,5 +1,5 @@ --- -title: 'Announcement with more data' +title: "Announcement with more data" date: 2023-01-24T01:13:37+03:30 draft: false --- diff --git a/content/posts/all-markdown-features.md b/content/posts/all-markdown-features.md index c3a6292d..af9a88de 100644 --- a/content/posts/all-markdown-features.md +++ b/content/posts/all-markdown-features.md @@ -2,7 +2,7 @@ title: All Markdown features author: Amir Pourmand -date: '2022-04-18T21:10:00+07:00' +date: "2022-04-18T21:10:00+07:00" tags: [markdown, features] categories: [blog] @@ -56,10 +56,10 @@ This text is **_really important_**. > #### The quarterly results look great! > -> - Revenue was off the chart. -> - Profits were higher than ever. +> - Revenue was off the chart. +> - Profits were higher than ever. > -> _Everything_ is going according to **plan**. +> _Everything_ is going according to **plan**. ## Ordered Lists @@ -70,10 +70,10 @@ This text is **_really important_**. ## Unordered Lists -- First item -- Second item -- Third item -- Fourth item +- First item +- Second item +- Third item +- Fourth item ## Code Blocks diff --git a/content/posts/socialism.md b/content/posts/socialism.md index 5ce126e0..d1c75d50 100644 --- a/content/posts/socialism.md +++ b/content/posts/socialism.md @@ -2,7 +2,7 @@ title: Why Socialism? author: Albert Einstein -date: '1949-05-01' +date: "1949-05-01" tags: [socialism, politics] categories: [blog-posts] @@ -21,13 +21,13 @@ _Source: Monthly Review, May 1949_ ```html {{ define "main" }}
-

{{ .Page.Title }}

+

{{ .Page.Title }}

- {{ with .Page.Params.description }} -

{{ . }}

- {{ end }} + {{ with .Page.Params.description }} +

{{ . }}

+ {{ end }} -
{{ .Content }}
+
{{ .Content }}
{{ end }} ``` diff --git a/content/teaching.md b/content/teaching.md index 4445a2c1..ef892bc7 100644 --- a/content/teaching.md +++ b/content/teaching.md @@ -1,5 +1,5 @@ --- -title: 'Teaching' +title: "Teaching" description: "A brief note on Albert Einstein's teaching experiences" --- diff --git a/layouts/404.html b/layouts/404.html index e2b0d284..fb062cfb 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,6 +1,9 @@ {{ define "main" }} -
-

404: Page not found!

-

Looks like there has been a mistake. Try going back to the homepage.

-
+
+

404: Page not found!

+

+ Looks like there has been a mistake. Try going back to the + homepage. +

+
{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 01520b7a..b3128651 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,24 +1,23 @@ - {{/* Head */}} - {{ partial "head" . }} + {{/* Head */}} + {{ partial "head" . }} - {{/* Body */}} - + {{/* Body */}} + + {{/* Header */}} +
+ {{ partial "header" . }} +
- {{/* Header */}} -
- {{ partial "header" . }} -
+ {{/* Main */}} +
+ {{ block "main" . }}{{ end }} +
- {{/* Main */}} -
- {{ block "main" . }}{{ end }} -
- - {{/* Footer */}} - - + {{/* Footer */}} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 4cb674b1..72f730fd 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,23 +1,24 @@ {{ define "main" }} -
-

- {{ .Page.Title }} -

+
+

+ {{ .Page.Title }} +

- {{ with .Page.Params.description }} -

- {{ . }} -

- {{ end }} + {{ with .Page.Params.description }} +

+ {{ . }} +

+ {{ end }} - {{ with .Content }} -
- {{ . }} -
- {{ end }} + {{ with .Content }} +
+ {{ . }} +
+ {{ end }} -
- {{ partial "list" . }} -
-
+ +
+ {{ partial "list" . }} +
+
{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3d74ef07..1a8b968d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,17 +1,18 @@ {{ define "main" }} -
-

- {{ .Page.Title }} -

+
+

+ {{ .Page.Title }} +

- {{ with .Page.Params.description }} -

- {{ . }} -

- {{ end }} + {{ with .Page.Params.description }} +

+ {{ . }} +

+ {{ end }} -
- {{ .Content }} -
-
+ +
+ {{ .Content }} +
+
{{ end }} diff --git a/layouts/index.html b/layouts/index.html index 2a352f6d..64da29d8 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,55 +1,57 @@ {{ define "main" }} -
-

- {{ if (or .Site.Params.firstName .Site.Params.middleName .Site.Params.lastName) }} - {{ .Site.Params.firstName }} - {{ .Site.Params.lastName }} - {{ else }} - {{ .Site.Title }} - {{ end }} -

- - {{ with .Site.Params.description }} -

- {{ . }} -

- {{ end }} +
+

+ {{ if (or .Site.Params.firstName .Site.Params.middleName .Site.Params.lastName) }} + {{ .Site.Params.firstName }} + {{ .Site.Params.lastName }} + {{ else }} + {{ .Site.Title }} + {{ end }} +

-
- {{ with resources.Get "img/prof_pic.jpg" }} - {{ partial "img" (dict "img" . "class" "rounded" "alt" .RelPermalink) }} - {{ end }} - {{ with .Site.Params.email }} - {{ partial "scripts/cloakemail" . }} - {{ end }} -
- - {{ with .Content }} -
- {{ . }} -
- {{ end }} + {{ with .Site.Params.description }} +

+ {{ . }} +

+ {{ end }} + + +
+ {{ with resources.Get "img/prof_pic.jpg" }} + {{ partial "img" (dict "img" . "class" "rounded" "alt" .RelPermalink) }} + {{ end }} + {{ with .Site.Params.email }} + {{ partial "scripts/cloakemail" . }} + {{ end }} +
+ + {{ with .Content }} +
+ {{ . }} +
+ {{ end }} -
-

- Recent Posts -

- {{ partial "posts/recents" . }} -
- -
-

- Recent News -

- {{ partial "news/recents" . }} -
- - {{ if .Site.Params.socialHomePage }} -
- {{ if .Site.Menus.social }} - {{ partial "social" . }} - {{ end }} -
- {{ end }} -
+ +
+

+ Recent Posts +

+ {{ partial "posts/recents" . }} +
+ +
+

+ Recent News +

+ {{ partial "news/recents" . }} +
+ + {{ if .Site.Params.socialHomePage }} +
+ {{ if .Site.Menus.social }} + {{ partial "social" . }} + {{ end }} +
+ {{ end }} +
{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 9833f377..5a2a2ff2 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,12 +1,14 @@ -