Skip to content

Commit

Permalink
Add Pre-commit check (#18)
Browse files Browse the repository at this point in the history
I explained about this one
[here](alshedivat/al-folio#801). Unfortunately,
It is currently not configured properly in al-folio, so we do not use it
effectively.

You can see
[here](https://major.homeonderanged.org/post/hugo-pre-commit/) on why it
is important.

To put it in a nutshell: you should install bot from
[here](https://pre-commit.ci/) to make it work.
  • Loading branch information
rohandebsarkar authored Jan 23, 2023
2 parents a87208d + b567f46 commit 35a91f7
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 16 deletions.
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: pretty-format-json
- id: trailing-whitespace
args: [ --markdown-linebreak-ext=md ]

- repo: https://github.com/crate-ci/typos
rev: v1.13.8
hooks:
- id: typos
2 changes: 1 addition & 1 deletion content/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**Albert Einstein** was a German-born theoretical physicist, widely acknowledged to be one of the greatest and most influential physicists of all time. He is best known for developing the ***theory of relativity***, but he also made important contributions to the development of ***quantum mechanics***. Together ***relativity*** and ***quantum mechanics*** formed the two pillars of modern physics.

His ***mass–energy*** equivalence formula `E = mc²`, which arises from relativity theory, has been dubbed *"the world's most famous equation"*. His work is also known for its influence on the philosophy of science.

He received the 1921 Nobel Prize in Physics *"for his services to theoretical physics, and especially for his discovery of the law of the photoelectric effect"*, a pivotal step in the development of ***quantum theory***. His intellectual achievements and originality resulted in *"Einstein"* becoming synonymous with *"genius"*. ***Einsteinium***, one of the synthetic elements in the periodic table, was named in his honor.

*Source: Wikipedia, CC-BY-SA-3.0*
2 changes: 1 addition & 1 deletion content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
title: list template
---
---
2 changes: 1 addition & 1 deletion content/blog/first-blog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ title: First blog
decritption: This is the first blog post
---

Add the stuff here.
Add the stuff here.
2 changes: 1 addition & 1 deletion content/teaching.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Teaching"
description: "A breif note on Albert Einstein's teaching experiences"
description: "A brief note on Albert Einstein's teaching experiences"
---

By 1908, Albert Einstein was recognized as a leading scientist and was appointed lecturer at the University of Bern. The following year, after he gave a lecture on electrodynamics and the relativity principle at the University of Zurich, Alfred Kleiner recommended him to the faculty for a newly created professorship in theoretical physics. Einstein was appointed associate professor in 1909.
Expand Down
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<h1 class="text-4xl">404: Page not found!</h1>
<p>Looks like there has been a mistake. Try going back to the <a href="{{ .Site.BaseURL }}">homepage</a>.</p>
</article>
{{ end }}
{{ end }}
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h1 class="text-4xl">
{{ .Page.Title }}
</h1>

{{ with .Page.Params.description }}
<h2>{{ . }}</h2>
{{ end }}
Expand Down
8 changes: 4 additions & 4 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ <h1 class="text-4xl">
<strong>{{ .Site.Params.firstName }}</strong>
{{ .Site.Params.lastName }}
{{ else }}
{{ .Site.Title }}
{{ .Site.Title }}
{{ end }}
</h1>

{{ with .Site.Params.description }}
<h2>{{ . }}</h2>
{{ end }}
Expand All @@ -24,8 +24,8 @@ <h2>{{ . }}</h2>
{{ .Site.Params.email }}
</p>
</div>

<article class="space-y-4">
{{ .Content }}
</article>
{{ end }}
{{ end }}
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{ . }}
{{ end }}
&bull;
Powered by <a href="https://gohugo.io">Hugo</a> with
Powered by <a href="https://gohugo.io">Hugo</a> with
<a href="https://github.com/rohandebsarkar/academic-folio">Academic Folio</a> theme
{{ if .Site.Params.footerLastUpdated }}
&bull;
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
{{ $tailwindStyles = $tailwindStyles | resources.ExecuteAsTemplate (printf "tailwind.dev.%v.css" now.UnixMilli) . }}
{{ $styles = $styles | resources.ExecuteAsTemplate (printf "main.dev.%v.css" now.UnixMilli) . }}
{{ end }}

{{/* Stylesheets */}}
<link rel="stylesheet" href="{{ $tailwindStyles.RelPermalink }}" integrity="{{ $tailwindStyles.Data.Integrity }}">
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">

{{/* Scripts */}}
{{ partial "scripts/hamburger.html" . }}
{{ partial "scripts/theme.html" . }}
</head>
</head>
2 changes: 1 addition & 1 deletion layouts/partials/scripts/hamburger.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
function hamburger() {
document.getElementById("hamburger-menu").classList.toggle("hidden")
}
</script>
</script>
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
}
}
}
2 changes: 1 addition & 1 deletion sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ nav .active a {

#hamburger span {
background-color: var(--global-text-color);
}
}

0 comments on commit 35a91f7

Please sign in to comment.