From 49c0a2bc56737c2f6dff15aea10f85b1cd171682 Mon Sep 17 00:00:00 2001 From: Mehedi Hasan <0xmehedi@tutanota.com> Date: Fri, 10 Jun 2022 00:48:24 +0600 Subject: [PATCH 01/19] feat(i18n): add Bengali translation (#625) --- exampleSite/config.yaml | 4 +-- i18n/bn.yaml | 73 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 i18n/bn.yaml diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 7c986fb..18b6346 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -26,7 +26,7 @@ disqusShortname: hugo-theme-stack googleAnalytics: # Theme i18n support -# Available values: ar, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw +# Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw DefaultContentLanguage: en # Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko] @@ -110,7 +110,7 @@ params: - url locale: admin: Admin - placeholder: + placeholder: twikoo: envId: diff --git a/i18n/bn.yaml b/i18n/bn.yaml new file mode 100644 index 0000000..0e54cb9 --- /dev/null +++ b/i18n/bn.yaml @@ -0,0 +1,73 @@ +toggleMenu: + other: টগল মেনু + +darkMode: + other: ডার্ক মোড + +list: + page: + one: "{{ .Count }} পৃষ্ঠা" + other: "{{ .Count }} পৃষ্ঠা" + + section: + other: অনুচ্ছেদ + + subsection: + one: উপঅনুচ্ছেদ + other: উপঅনুচ্ছেদ + +article: + back: + other: পেছনে যান + + tableOfContents: + other: সূচিপত্র + + relatedContent: + other: সম্পর্কিত বিষয়বস্তু + + lastUpdatedOn: + other: শেষ হালনাগাদ করা হয়েছে + + readingTime: + one: "{{ .Count }} মিনিটে পড়া যাবে" + other: "{{ .Count }} মিনিটে পড়া যাবে" + +notFound: + title: + other: পাওয়া যায়নি + + subtitle: + other: এই পৃষ্ঠাটি বিদ্যমান নেই + +widget: + archives: + title: + other: আর্কাইভ + + more: + other: আরও + + tagCloud: + title: + other: ট্যাগ + categoriesCloud: + title: + other: বিভাগ + +search: + title: + other: অনুসন্ধান + + placeholder: + other: কিছু টাইপ করুন... + + resultTitle: + other: "#PAGES_COUNT পৃষ্ঠা (#TIME_SECONDS সেকেন্ড)" + +footer: + builtWith: + other: "{{ .Generator }} দিয়ে নির্মিত" + + designedBy: + other: "থিম {{ .Theme }} ডিজাইন করেছেন {{ .DesignedBy }}" From 01eb9a4b0e01766e0116d9939f2d694d8dbcfff2 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Thu, 9 Jun 2022 22:43:08 +0200 Subject: [PATCH 02/19] fix: check if DISQUS is loaded before accessing it (#626) closes https://github.com/CaiJimmy/hugo-theme-stack/issues/571 --- layouts/partials/comments/provider/disqus.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/comments/provider/disqus.html b/layouts/partials/comments/provider/disqus.html index 1f283df..fb17b77 100644 --- a/layouts/partials/comments/provider/disqus.html +++ b/layouts/partials/comments/provider/disqus.html @@ -13,7 +13,7 @@ \ No newline at end of file From 722950c1679d5c573d9ead1d954e36e733bf8d8c Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 11 Jun 2022 11:56:38 +0000 Subject: [PATCH 10/19] docs(github): remove feature request template see https://github.com/CaiJimmy/hugo-theme-stack/discussions/630 --- .github/ISSUE_TEMPLATE/feature_request.md | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. From d53ba6ea20950b780013b43ad3ce743814bb956a Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 11 Jun 2022 14:00:36 +0200 Subject: [PATCH 11/19] docs(github): create issue config.yml Disable blank issue --- .github/ISSUE_TEMPLATE/config.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..f120c04 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Discussions + url: https://github.com/CaiJimmy/hugo-theme-stack/discussions + about: Please ask and answer questions here. From 5fe1b35ba531fe3892f552158a0b2f6b456a5670 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 11 Jun 2022 14:29:02 +0200 Subject: [PATCH 12/19] chore(github): change issue report template to a form --- .github/ISSUE_TEMPLATE/bug_report.md | 45 ------------------- .github/ISSUE_TEMPLATE/bug_report.yml | 63 +++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 45 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 0a986bb..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - - - -## Describe the bug -A clear and concise description of what the bug is. - -## Expected behavior -A clear and concise description of what you expected to happen. - -## To Reproduce -Indicate the steps to reproduce this bug, if applicable. - -## Screenshots -Add screenshots to help explain your problem. - -## Environment - -- **Hugo version** [e.g: 0.80.0]: -- **Hugo extended?**: Yes / No - -## Additional context -Add any other context about the problem here. - -If it's a UI issue, fill the following information: - - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -## Content of config.yaml -```yaml -### Paste the content of the config file here -``` - -## Link to the demo site and/or source repository diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..2265a67 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,63 @@ +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! Please provide as much information as possible and make sure you have checked the [documentation](https://docs.stack.jimmycai.com/). + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? Please be as detailed as possible, include screenshots and any other information that might help us reproduce the problem. + placeholder: Tell us what you see! + validations: + required: true + - type: input + id: hugo-version + label: Hugo version + description: "What is the version of Hugo you are using? (Note: this theme does not support non-extended version of Hugo)" + placeholder: ex. 0.100.0 + validations: + required: true + - type: input + id: theme-version + label: Theme version + description: "What is the version of Stack theme you are using?" + placeholder: ex. 3.12.0 + validations: + required: true + - type: dropdown + id: browsers + attributes: + label: What browsers are you seeing the problem on? + multiple: true + options: + - Firefox + - Chrome + - Safari + - Microsoft Edge + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + - type: markdown + attributes: + value: | + If the issue is not present on the [demo site](https://demo.stack.jimmycai.com), in order to better understand the problem, please provide the link to the source code of your website (not the generated HTML). + Or link to a minimal reproduction of the problem if there are sensible data. + - type: input + id: bug-url + label: Link to the page with bug + placeholder: https://demo.stack.jimmycai.com + value: https://demo.stack.jimmycai.com + validations: + required: true + - type: input + id: source-repo + label: Link to the source repository + placeholder: https://github.com/CaiJimmy/hugo-theme-stack From c6ccfc8f26ae55f488eb58fa3d0a06e7c4a99c3b Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 11 Jun 2022 14:32:34 +0200 Subject: [PATCH 13/19] fix(github): try to fix errors with the issue form --- .github/ISSUE_TEMPLATE/bug_report.yml | 28 +++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2265a67..052df1c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -17,16 +17,18 @@ body: required: true - type: input id: hugo-version - label: Hugo version - description: "What is the version of Hugo you are using? (Note: this theme does not support non-extended version of Hugo)" - placeholder: ex. 0.100.0 + attributes: + label: Hugo version + description: "What is the version of Hugo you are using? (Note: this theme does not support non-extended version of Hugo)" + placeholder: ex. 0.100.0 validations: required: true - type: input id: theme-version - label: Theme version - description: "What is the version of Stack theme you are using?" - placeholder: ex. 3.12.0 + attributes: + label: Theme version + description: "What is the version of Stack theme you are using?" + placeholder: ex. 3.12.0 validations: required: true - type: dropdown @@ -49,15 +51,17 @@ body: attributes: value: | If the issue is not present on the [demo site](https://demo.stack.jimmycai.com), in order to better understand the problem, please provide the link to the source code of your website (not the generated HTML). - Or link to a minimal reproduction of the problem if there are sensible data. + Or link to a minimal reproduction of the problem if there are sensible data. - type: input id: bug-url - label: Link to the page with bug - placeholder: https://demo.stack.jimmycai.com - value: https://demo.stack.jimmycai.com + attributes: + label: Link to the page with bug + placeholder: https://demo.stack.jimmycai.com + value: https://demo.stack.jimmycai.com validations: required: true - type: input id: source-repo - label: Link to the source repository - placeholder: https://github.com/CaiJimmy/hugo-theme-stack + attributes: + label: Link to the source repository + placeholder: https://github.com/CaiJimmy/hugo-theme-stack From 4546d74af349b53d5fa1bfc3636380f2cd090b73 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 11 Jun 2022 14:37:39 +0200 Subject: [PATCH 14/19] chore(github): add browser info field to issue form --- .github/ISSUE_TEMPLATE/bug_report.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 052df1c..d1d9a10 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -41,6 +41,14 @@ body: - Chrome - Safari - Microsoft Edge + - type: input + id: browser-info + attributes: + label: More information about the browser + description: "E.g: Browser version, OS version, etc." + placeholder: ex. Chrome 104, Windows 11 + validations: + required: false - type: textarea id: logs attributes: From b02569add95ceb08ccddba01fb3e810b41db1ce6 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 11 Jun 2022 12:45:39 +0000 Subject: [PATCH 15/19] chore(github): delete unused Github actions --- .github/release-drafter.yml | 33 -------------------- .github/workflows/hugo-artifact.yml | 44 --------------------------- .github/workflows/release-drafter.yml | 16 ---------- 3 files changed, 93 deletions(-) delete mode 100644 .github/release-drafter.yml delete mode 100644 .github/workflows/hugo-artifact.yml delete mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 6e57d9b..0000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,33 +0,0 @@ -name-template: "v$RESOLVED_VERSION 🌈" -tag-template: "v$RESOLVED_VERSION" -categories: - - title: "🚀 Features" - labels: - - "feature" - - "enhancement" - - title: "🐛 Bug Fixes" - labels: - - "fix" - - "bugfix" - - "bug" - - title: "🧰 Maintenance" - label: "chore" - - title: "♻️ Refactor" - label: refactor -change-template: "- $TITLE @$AUTHOR (#$NUMBER)" -change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. -version-resolver: - major: - labels: - - "major" - minor: - labels: - - "minor" - patch: - labels: - - "patch" - default: patch -template: | - ## Changes - - $CHANGES diff --git a/.github/workflows/hugo-artifact.yml b/.github/workflows/hugo-artifact.yml deleted file mode 100644 index 50b728c..0000000 --- a/.github/workflows/hugo-artifact.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build Hugo Artifact - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [master] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Hugo setup - uses: peaceiris/actions-hugo@v2.4.13 - with: - # The Hugo version to download (if necessary) and use. Example: 0.58.2 - hugo-version: latest # optional, default is latest - # Download (if necessary) and use Hugo extended version. Example: true - extended: true # optional, default is false - - # Runs a set of commands using the runners shell - - name: Generate Hugo site - run: cd exampleSite && hugo --gc --themesDir ../.. - - - name: Upload Hugo artifact - uses: actions/upload-artifact@v2.2.2 - with: - # Artifact name - name: resources - # A file, directory or wildcard pattern that describes what to upload - path: | - exampleSite/resources - !exampleSite/resources/_gen/images diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index 2c30bcd..0000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Release Drafter - -on: - push: - # branches to consider in the event; optional, defaults to all - branches: - - master - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 655b5102c4caffb76f38c68d353b992de036b007 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Thu, 28 Jul 2022 16:48:37 +0000 Subject: [PATCH 16/19] fix(article): footnote reference does not work closes https://github.com/CaiJimmy/hugo-theme-stack/issues/632 --- assets/ts/smoothAnchors.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/assets/ts/smoothAnchors.ts b/assets/ts/smoothAnchors.ts index 379eb39..46a4a03 100644 --- a/assets/ts/smoothAnchors.ts +++ b/assets/ts/smoothAnchors.ts @@ -21,12 +21,15 @@ function setupSmoothAnchors() { aElement.addEventListener("click", clickEvent => { clickEvent.preventDefault(); - let targetId = aElement.getAttribute("href").substring(1); - // The replace done on ':' is here for footnotes, as this character would otherwise interfere when used as a CSS selector. - let target = document.getElementById(targetId.replace(":", "\\:")) as HTMLElement; + const targetId = aElement.getAttribute("href").substring(1), + target = document.getElementById(targetId) as HTMLElement, + offset = target.getBoundingClientRect().top - document.documentElement.getBoundingClientRect().top; window.history.pushState({}, "", aElement.getAttribute("href")); - scrollTo({ top: target.offsetTop, behavior: "smooth" }); + scrollTo({ + top: offset, + behavior: "smooth" + }); }); }); } From d00dbc17bc1e8f12557f049127d279e00d5e11ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9B=E5=B7=B3=E6=B5=81=E7=81=AB?= <59004461+ambition-echo@users.noreply.github.com> Date: Sun, 31 Jul 2022 18:39:20 +0800 Subject: [PATCH 17/19] feat(comment): add `strict` and `input-position` to Giscus config (#648) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 添加giscus设置选项 根据giscus官方文档,添加了data-strict和data-input-position设置选项 * feat: add strict and inputPosition to giscus config section Co-authored-by: Jimmy Cai --- config.yaml | 2 ++ layouts/partials/comments/provider/giscus.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/config.yaml b/config.yaml index 93367bb..fcb4bcb 100644 --- a/config.yaml +++ b/config.yaml @@ -92,10 +92,12 @@ params: category: categoryID: mapping: + strict: lightTheme: darkTheme: reactionsEnabled: 1 emitMetadata: 0 + inputPosition: lang: gitalk: diff --git a/layouts/partials/comments/provider/giscus.html b/layouts/partials/comments/provider/giscus.html index abe345f..f7f435d 100644 --- a/layouts/partials/comments/provider/giscus.html +++ b/layouts/partials/comments/provider/giscus.html @@ -6,8 +6,10 @@ data-category="{{- .category -}}" data-category-id="{{- .categoryID -}}" data-mapping="{{- default `title` .mapping -}}" + data-strict="{{- default 0 .strict -}}" data-reactions-enabled="{{- default 1 .reactionsEnabled -}}" data-emit-metadata="{{- default 0 .emitMetadata -}}" + data-input-position="{{- default `top` .inputPosition -}}" data-theme="{{- default `light` .lightTheme -}}" data-lang="{{- default `en` .lang -}}" crossorigin="anonymous" From 5869a7ab83aaff19393433f0547d1db40ca437da Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 31 Jul 2022 10:55:27 +0000 Subject: [PATCH 18/19] release: 3.13.0 --- layouts/partials/footer/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index 09adc9d..255eba5 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -1,4 +1,4 @@ -{{- $ThemeVersion := "3.12.0" -}} +{{- $ThemeVersion := "3.13.0" -}}