diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..4d42107 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,37 @@ +--- +name: Bug +about: File a bug report. +title: 'bug' +--- + +## Expected Behavior + + +## Current Behavior + + +## Possible Solution + + +## Steps to Reproduce + + +1. +2. +3. +4. + +### Screenshots + + +### Browsers Affected + +- [ ] Chrome +- [ ] Firefox +- [ ] Edge +- [ ] Safari 11 +- [ ] Safari 10 +- [ ] IE 11 + +## Detailed Description + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..f66d61b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,30 @@ +--- +name: Feature Request +about: File a Feature Request. +title: 'Feature Request' +--- + + + +### Describe the solution you'd like + + + +### Describe alternatives you've considered + + + +### Additional context + + diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..03d047b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,9 @@ +--- +name: Question +about: Ask a general question. +--- + + + +### Question + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..2862d6e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +### Issue + + +### Description + + + +### Test Evidence + + \ No newline at end of file diff --git a/README.md b/README.md index df75eba..fbdcc21 100644 --- a/README.md +++ b/README.md @@ -98,9 +98,9 @@ params: # transparent navbar and the main logo will be used in the non-transparent navbar. # It will be default to the theme logos if not provided. logo: - main: assets/images/main-logo.png - inverted: assets/images/inverted-logo.png - favicon: assets/images/favicon.png + main: /assets/images/main-logo.png + inverted: /assets/images/inverted-logo.png + favicon: /assets/images/favicon.png # GitHub repo URL of your site gitRepo: https://github.com/hossainemruz/toha-example-site @@ -233,17 +233,44 @@ Here, are the current plan and progress of various components of this theme. The ## Contributing -You can contribute to this theme in various way. You can report a bug, file an feature request, send a PR, share your thoughts etc. +You can contribute to this theme in various ways. You can report a [bug](https://github.com/hossainemruz/toha/issues/new?template=bug.md), file an [feature request](https://github.com/hossainemruz/toha/issues/new?template=feature_request.md), send a PR, [share your thoughts](https://github.com/hossainemruz/toha/issues/new?template=question.md) etc. -Pull requests are most welcomed and I will be happy to review. Just follow the following principles: +Pull requests are most welcome and I will be happy to review. Just follow the following principles: - Keep it simple. - Keep it consistent with the design. -- Use as little dependency as possible. -- Have patient. +- Use as few dependencies as possible. +- Have patience. >I am not a web developer. I just created this theme for my personal needs. So, it is reasonable to have some flaws in the codes. Feel free to open issues and PR acknowledging the problems. +## Local Development + +For local development, you can run your own site or the [example site](https://github.com/hossainemruz/toha-example-site) locally and make changes in the theme submodule. + +### Fork +Fork [this repo](https://github.com/hossainemruz/toha) and setup your local submodule with the following from the site's folder by running the following + +```sh +git submodule update --init --recursive --remote +cd themes/toha +git remote add my-fork https://github.com//toha +git checkout -b my-feature-branch +``` + +From there you can make changes to the source code of the theme while testing with your running Hugo site. + +### Open a PR + +When the changes look good, commit and push them to your fork +```sh +git add . +git commit -m "A meaningful commit message" +git push my-fork my-feature-branch +``` + +And then open a PR `https://github.com//toha/pull/new/my-feature-branch` + ## Attribution - Thanks [Anup Deb](https://dribbble.com/anupdeb) for his design guidance. diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index b549904..4b5c584 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -15,7 +15,7 @@ languages: bn: languageName: বাংলা weight: 3 - de: + de: languageName: Deutsch weight: 4 id: @@ -54,9 +54,9 @@ params: # transparent navbar and the main logo will be used in the non-transparent navbar. # It will be default to the theme logos if not provided. logo: - main: assets/images/main-logo.png - inverted: assets/images/inverted-logo.png - favicon: assets/images/favicon.png + main: /assets/images/main-logo.png + inverted: /assets/images/inverted-logo.png + favicon: /assets/images/favicon.png # GitHub repo URL of your site gitRepo: https://github.com/hossainemruz/toha-example-site diff --git a/layouts/404.html b/layouts/404.html index 5c2c730..941ecc1 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,15 +1,15 @@ {{ define "header" }} - + {{ end }} {{ define "navbar" }} - {{ partial "navigators/navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" false) }} + {{ partial "navigators/navbar-2.html" (dict "baseURL" site.BaseURL "title" site.Title "hasToggleButton" false) }} {{ end }} {{ define "content" }}
- +

404

The page you are looking for is not there yet.

diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index e47c959..2a5935f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -9,7 +9,7 @@ {{ block "header" . }} {{ end }} - {{ if .Site.GoogleAnalytics }} + {{ if site.GoogleAnalytics }} {{ template "_internal/google_analytics_async.html" . }} {{ end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 28e7dc0..080337c 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,6 +1,6 @@ {{ define "header" }} - - + + {{ end }} {{ define "navbar" }} @@ -21,7 +21,7 @@
  • Posts
  • - {{ partial "navigators/sidebar.html" (dict "menus" .Site.Menus.sidebar "ctx" .) }} + {{ partial "navigators/sidebar.html" (dict "menus" site.Menus.sidebar "ctx" .) }}
@@ -47,5 +47,5 @@ {{ end }} {{ define "scripts" }} - + {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index efd9741..af03ec1 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,8 +4,8 @@ rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-dark.min.css" /> - - + + {{ end }} {{ define "navbar" }} @@ -21,7 +21,7 @@
  • Posts
  • - {{ partial "navigators/sidebar.html" (dict "menus" .Site.Menus.sidebar "ctx" .) }} + {{ partial "navigators/sidebar.html" (dict "menus" site.Menus.sidebar "ctx" .) }}
@@ -35,13 +35,13 @@
-
+
- +
{{ partial "helpers/get-author-name.html" . }}

{{ .Page.Date.Format "January 2, 2006" }}

@@ -55,9 +55,9 @@
- {{ if .Site.Params.GitRepo }} + {{ if site.Params.GitRepo }}
- + Improve This Page @@ -69,7 +69,7 @@ {{ partial "navigators/next-prev-navigator.html" . }}
- {{ if .Site.DisqusShortname }} + {{ if site.DisqusShortname }} {{ partial "disqus.html" . }} {{ end }}
@@ -97,7 +97,7 @@ {{ define "scripts" }} - + diff --git a/layouts/index.html b/layouts/index.html index d742e14..17cab83 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,21 +2,29 @@ {{- .Site.Title -}} - + {{ $siteDescription := .Site.Params.description }} + {{ if (index .Site.Data .Site.Language.Lang).site }} + {{ $siteConfig := (index .Site.Data .Site.Language.Lang).site }} + {{ if $siteConfig.description }} + {{ $siteDescription = $siteConfig.description }} + {{ end }} + {{ end }} + + {{- partial "header.html" . -}} - - - - - - - + + + + + + + - {{ if .Site.GoogleAnalytics }} + {{ if site.GoogleAnalytics }} {{ template "_internal/google_analytics_async.html" . }} {{ end }} @@ -29,9 +37,9 @@ {{- partial "sections/home.html" . -}} - {{ $sections:= .Site.Data.sections }} - {{ if (index .Site.Data .Site.Language.Lang).sections }} - {{ $sections = (index .Site.Data .Site.Language.Lang).sections }} + {{ $sections:= site.Data.sections }} + {{ if (index site.Data site.Language.Lang).sections }} + {{ $sections = (index site.Data site.Language.Lang).sections }} {{ end }} {{ if $sections }} @@ -62,9 +70,9 @@ {{ partial "scripts.html" . }} - - - - + + + + diff --git a/layouts/partials/cards/project.html b/layouts/partials/cards/project.html index a56dbf7..3f21d31 100644 --- a/layouts/partials/cards/project.html +++ b/layouts/partials/cards/project.html @@ -8,7 +8,7 @@
{{ if .logo }} - {{ .name }} + {{ .name }} {{ end }}
{{ .name }}
diff --git a/layouts/partials/cards/skill.html b/layouts/partials/cards/skill.html index b911405..4478e1e 100644 --- a/layouts/partials/cards/skill.html +++ b/layouts/partials/cards/skill.html @@ -3,7 +3,7 @@
{{ if .icon }} - {{ .name }} + {{ .name }} {{ end }}
{{ .name }}
diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html index 9c47b63..57eb960 100644 --- a/layouts/partials/disqus.html +++ b/layouts/partials/disqus.html @@ -8,7 +8,7 @@ var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true; - var disqus_shortname = "{{ .Site.DisqusShortname }}"; + var disqus_shortname = "{{ site.DisqusShortname }}"; dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js"; ( document.getElementsByTagName("head")[0] || diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index b6f14c0..baefb6f 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,16 +1,16 @@ -{{ $author:= .Site.Data.author }} -{{ if (index .Site.Data .Site.Language.Lang).author }} - {{ $author = (index .Site.Data .Site.Language.Lang).author }} +{{ $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 }} +{{ $sections:= site.Data.sections }} +{{ if (index site.Data site.Language.Lang).sections }} + {{ $sections = (index site.Data site.Language.Lang).sections }} {{ end }} {{ $copyrightNotice := "© 2020 Copyright."}} -{{ if (index .Site.Data .Site.Language.Lang).site }} - {{ $siteConfig := (index .Site.Data .Site.Language.Lang).site }} +{{ if (index site.Data site.Language.Lang).site }} + {{ $siteConfig := (index site.Data site.Language.Lang).site }} {{ if $siteConfig.copyright }} {{ $copyrightNotice = $siteConfig.copyright }} {{ end }} @@ -48,7 +48,7 @@
{{ end }} - {{ if .Site.Params.newsletter.enable }} + {{ if site.Params.newsletter.enable }}

{{ i18n "newsletter_text" }}

@@ -76,7 +76,7 @@
@@ -84,7 +84,7 @@
{{ i18n "hugoAttributionText" }} Hugo Logo diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 1c565bb..a1f34dc 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -3,17 +3,17 @@ - - - - + + + + - + - + diff --git a/layouts/partials/helpers/get-author-image.html b/layouts/partials/helpers/get-author-image.html index 9ab6360..8142ddc 100644 --- a/layouts/partials/helpers/get-author-image.html +++ b/layouts/partials/helpers/get-author-image.html @@ -1,7 +1,12 @@ -{{ $authorImage:= "/assets/images/default-avatar.png"}} -{{ if .Site.Data.site.author}} - {{ $authorImage = .Site.Data.site.author.image | relURL }} -{{ end}} +{{ $author:= site.Data.author }} +{{ if (index site.Data site.Language.Lang).author }} + {{ $author = (index site.Data site.Language.Lang).author }} +{{ end }} +{{ $authorImage:= "/assets/images/default-avatar.png" }} +{{ if $author.image }} + {{ $authorImage = $author.image }} +{{ end }} + {{ if eq (printf "%T" .Params.author ) "maps.Params" }} {{ with .Params.author }} {{ if .image }} diff --git a/layouts/partials/helpers/get-author-name.html b/layouts/partials/helpers/get-author-name.html index 1ad3612..63c0846 100644 --- a/layouts/partials/helpers/get-author-name.html +++ b/layouts/partials/helpers/get-author-name.html @@ -1,6 +1,6 @@ -{{ $authorName:= .Site.Params.author.name }} -{{ if .Site.Data.site.author}} - {{ $authorName = .Site.Data.site.author.name }} +{{ $authorName:= site.Params.author.name }} +{{ if site.Data.site.author}} + {{ $authorName = site.Data.site.author.name }} {{ end}} {{ if eq (printf "%T" .Params.author ) "maps.Params" }} {{ with .Params.author }} diff --git a/layouts/partials/navigators/floating-lang-selector.html b/layouts/partials/navigators/floating-lang-selector.html index 6c59479..ec891d6 100644 --- a/layouts/partials/navigators/floating-lang-selector.html +++ b/layouts/partials/navigators/floating-lang-selector.html @@ -1,12 +1,12 @@ {{ $pageURL:= .RelPermalink }} -{{ if .Site.IsMultiLingual }} +{{ if site.IsMultiLingual }} {{ $pageURL = strings.TrimPrefix (path.Join "/" .Language.Lang) $pageURL }} {{ end }} - - + + diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index eea52ee..736752b 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -1,6 +1,6 @@ - - - + + + - - + + diff --git a/layouts/partials/sections/about.html b/layouts/partials/sections/about.html index 914fea0..df9702d 100644 --- a/layouts/partials/sections/about.html +++ b/layouts/partials/sections/about.html @@ -38,7 +38,7 @@
{{ if .resume }} - {{ end }} diff --git a/layouts/partials/sections/achievements/entry.html b/layouts/partials/sections/achievements/entry.html index 51621f0..4f665ce 100644 --- a/layouts/partials/sections/achievements/entry.html +++ b/layouts/partials/sections/achievements/entry.html @@ -1,6 +1,6 @@

{{ .title }}

diff --git a/layouts/partials/sections/home.html b/layouts/partials/sections/home.html index 76715f7..4bf85e2 100644 --- a/layouts/partials/sections/home.html +++ b/layouts/partials/sections/home.html @@ -1,6 +1,6 @@ -{{ $author:= .Site.Data.author }} -{{ if (index .Site.Data .Site.Language.Lang).author }} - {{ $author = (index .Site.Data .Site.Language.Lang).author }} +{{ $author:= site.Data.author }} +{{ if (index site.Data site.Language.Lang).author }} + {{ $author = (index site.Data site.Language.Lang).author }} {{ end }} {{ $name:="Jane Doe" }} @@ -10,17 +10,17 @@ {{ $name = $author.name }} {{ end }} -{{ $sections:= .Site.Data.sections }} -{{ if (index .Site.Data .Site.Language.Lang).sections }} - {{ $sections = (index .Site.Data .Site.Language.Lang).sections }} +{{ $sections:= site.Data.sections }} +{{ if (index site.Data site.Language.Lang).sections }} + {{ $sections = (index site.Data site.Language.Lang).sections }} {{ end }} -{{ $backgroundImage:= "assets/images/default-background.jpg" }} -{{ if .Site.Params.background }} - {{ $backgroundImage = .Site.Params.background }} +{{ $backgroundImage:= "/assets/images/default-background.jpg" }} +{{ if site.Params.background }} + {{ $backgroundImage = site.Params.background }} {{ end }} -{{ $authorImage:= "assets/images/default-avatar.png" }} +{{ $authorImage:= "/assets/images/default-avatar.png" }} {{ if $author.image }} {{ $authorImage = $author.image }} {{ end }} @@ -28,10 +28,10 @@
-

{{ $author.greeting }} {{ $name }}

diff --git a/package-lock.json b/package-lock.json index 729c431..945e9c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -149,9 +149,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001150", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001150.tgz", - "integrity": "sha512-kiNKvihW0m36UhAFnl7bOAv0i1K1f6wpfVtTF5O5O82XzgtBnb05V0XeV3oZ968vfg2sRNChsHw8ASH2hDfoYQ==", + "version": "1.0.30001151", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001151.tgz", + "integrity": "sha512-Zh3sHqskX6mHNrqUerh+fkf0N72cMxrmflzje/JyVImfpknscMnkeJrlFGJcqTmaa0iszdYptGpWMJCRQDkBVw==", "dev": true }, "chalk": { @@ -258,9 +258,9 @@ } }, "electron-to-chromium": { - "version": "1.3.582", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.582.tgz", - "integrity": "sha512-0nCJ7cSqnkMC+kUuPs0YgklFHraWGl/xHqtZWWtOeVtyi+YqkoAOMGuZQad43DscXCQI/yizcTa3u6B5r+BLww==", + "version": "1.3.583", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.583.tgz", + "integrity": "sha512-L9BwLwJohjZW9mQESI79HRzhicPk1DFgM+8hOCfGgGCFEcA3Otpv7QK6SGtYoZvfQfE3wKLh0Hd5ptqUFv3gvQ==", "dev": true }, "emoji-regex": {