diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000..d88b750f
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,50 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: "[BUG]"
+labels: bug
+assignees: ''
+
+---
+
+
+
+**Describe the bug**
+
+
+ - Device/Os: [e.g. Android 10]
+ - Type: [e.g. Desktop/Mobile]
+ - Browser and version [e.g. Chrome 86.0]:
+ - Hugo Version [ >=0.112.4 expected]:
+ - Theme Version [e.g. v4.0, master, or commit-id ]:
+
+**Steps to reproduce the behavior:**
+
+
+**Expected behavior**:
+
+
+**Repo/Source where this issue can be reproduced**:
+
+
+**Screenshots**
+
+
+**Additional context**
+
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 00000000..1a4dd9b2
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
+blank_issues_enabled: false
+contact_links:
+ - name: PaperMod Discussions
+ url: https://github.com/adityatelange/hugo-PaperMod/discussions
+ about: Please ask and answer questions/doubts here, do not open an issue for questions.
diff --git a/.github/ISSUE_TEMPLATE/new-blank-issue.md b/.github/ISSUE_TEMPLATE/new-blank-issue.md
new file mode 100644
index 00000000..dbc48f18
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/new-blank-issue.md
@@ -0,0 +1,7 @@
+---
+name: New Blank Issue
+about: Anything other than bug report
+title: ""
+labels: ""
+assignees: ""
+---
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 00000000..00b856cb
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,44 @@
+
+
+
+**What does this PR change? What problem does it solve?**
+
+
+
+
+**Was the change discussed in an issue or in the Discussions before?**
+
+
+
+
+## PR Checklist
+
+- [ ] This change adds/updates translations and I have used the [template present here](https://github.com/adityatelange/hugo-PaperMod/wiki/Translations#want-to-add-your-language-).
+- [ ] I have enabled [maintainer edits for this PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork).
+- [ ] I have verified that the code works as described/as intended.
+- [ ] This change adds a Social Icon which has a permissive license to use it.
+- [ ] This change **does not** include any CDN resources/links.
+- [ ] This change **does not** include any unrelated scripts such as bash and python scripts.
+- [ ] This change updates the overridden internal templates from HUGO's repository.
diff --git a/.github/assets/web-capture.jpeg b/.github/assets/web-capture.jpeg
new file mode 100644
index 00000000..dfd4d73e
Binary files /dev/null and b/.github/assets/web-capture.jpeg differ
diff --git a/.github/stale.yml b/.github/stale.yml
new file mode 100644
index 00000000..7b5f5711
--- /dev/null
+++ b/.github/stale.yml
@@ -0,0 +1,17 @@
+# Number of days of inactivity before an issue becomes stale
+daysUntilStale: 7
+# Number of days of inactivity before a stale issue is closed
+daysUntilClose: 3
+# Issues with these labels will never be considered stale
+exemptLabels:
+ - pinned
+ - keep
+# Label to use when marking an issue as stale
+staleLabel: stale
+# Comment to post when marking an issue as stale. Set to `false` to disable
+markComment: >
+ This issue has been automatically marked as stale because it has not had
+ recent activity. It will be closed if no further activity occurs. Thank you
+ for your contributions.
+# Comment to post when closing a stale issue. Set to `false` to disable
+closeComment: false
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
index 31ad7330..4d35f1de 100644
--- a/.github/workflows/gh-pages.yml
+++ b/.github/workflows/gh-pages.yml
@@ -1,42 +1,80 @@
-name: Build GH-Pages
+name: Deploy Hugo PaperMod Demo to Pages
on:
push:
paths-ignore:
- - 'images/**'
- - 'LICENSE'
- - 'README.md'
+ - "images/**"
+ - "LICENSE"
+ - "README.md"
branches:
- master
- exampleSite
workflow_dispatch:
# manual run
+ inputs:
+ hugoVersion:
+ description: "Hugo Version"
+ required: false
+ default: "0.112.4"
+
+# Allow one concurrent deployment
+concurrency:
+ group: "pages"
+ cancel-in-progress: true
+
+# Default to bash
+defaults:
+ run:
+ shell: bash
+
+# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+permissions:
+ contents: read
+ pages: write
+ id-token: write
jobs:
- deploy:
+ # Build job
+ build:
runs-on: ubuntu-latest
+ env:
+ HUGO_VERSION: "0.112.4"
steps:
- - name: Git checkout
- uses: actions/checkout@v2
+ - name: Check version
+ if: ${{ github.event.inputs.hugoVersion }}
+ run: export HUGO_VERSION="${{ github.event.inputs.hugoVersion }}"
+ - name: Install Hugo CLI
+ run: |
+ wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-amd64.deb \
+ && sudo dpkg -i ${{ runner.temp }}/hugo.deb
+ - name: Checkout
+ uses: actions/checkout@v3
with:
ref: exampleSite
-
+ - name: Setup Pages
+ id: pages
+ uses: actions/configure-pages@v3
- name: Get Theme
run: git submodule update --init --recursive
-
- name: Update theme to Latest commit
run: git submodule update --remote --merge
-
- - name: Setup hugo
- uses: peaceiris/actions-hugo@v2
+ - name: Build with Hugo
+ run: |
+ hugo \
+ --buildDrafts --gc --verbose \
+ --baseURL ${{ steps.pages.outputs.base_url }}
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v2
with:
- hugo-version: 'latest'
-
- - name: Build
- run: hugo --buildDrafts --gc --verbose --minify
-
- - name: Deploy
- uses: peaceiris/actions-gh-pages@v3
- with:
- github_token: ${{ secrets.TOKEN }}
- publish_dir: ./public
+ path: ./public
+ # Deployment job
+ deploy:
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-latest
+ needs: build
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v2
diff --git a/LICENSE b/LICENSE
index 0dc94d5e..34f08856 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,7 @@
MIT License
-Copyright (c) 2020 nanxiaobei, adityatelange
+Copyright (c) 2020 nanxiaobei and adityatelange
+Copyright (c) 2021-2023 adityatelange
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..1cb8381d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,5 @@
+run-example:
+ cd exampleSite && hugo server -D --gc -p 13131
+
+chroma-css:
+ hugo gen chromastyles --style=dracula > assets/css/common/chroma.css
diff --git a/README.md b/README.md
old mode 100755
new mode 100644
index 6746fdd6..8f8790e2
--- a/README.md
+++ b/README.md
@@ -1,76 +1,41 @@
-
-
-[](https://themes.gohugo.io/hugo-papermod/)
-[](https://sonarcloud.io/dashboard?id=adityatelange_hugo-PaperMod)
-
-
-# hugo-PaperMod | [Demo](https://adityatelange.github.io/hugo-PaperMod/)
-
-☄️ Fast | ☁️ Fluent | 🌙 Smooth | 📱 Responsive
-
-Hugo PaperMod is a theme based on [hugo-paper](https://github.com/nanxiaobei/hugo-paper).
-
-The goal of this project is add more Features and customization to the og theme.
-
-The [demo site](https://adityatelange.github.io/hugo-PaperMod/) includes a lot of documentation about Installation, Features with few more stuff. Make sure you visit it, to get the awesome hands-on experience and get known about the features ...
-
-ExampleSite can be found here: [exampleSite](https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite). Demo is built up with exampleSite as source.
-
----
+## WonderMod (PaperMod fork - theme for Hugo)
-{{- end}}
\ No newline at end of file
+{{- end -}}
diff --git a/layouts/partials/index_profile.html b/layouts/partials/index_profile.html
index 279a3a4e..6882f39b 100644
--- a/layouts/partials/index_profile.html
+++ b/layouts/partials/index_profile.html
@@ -1,20 +1,58 @@
- {{- with .Site.Params.profileMode }}
+ {{- with site.Params.profileMode }}
- {{- if .imageUrl}}{{- end}}
-
{{- .title | default $.Site.Title -}}
- {{- .subtitle -}}
- {{- partial "social_icons.html" $.Site.Params.socialIcons -}}
+ {{- if .imageUrl -}}
+ {{- $img := "" }}
+ {{- if not (urls.Parse .imageUrl).IsAbs }}
+ {{- $img = resources.Get .imageUrl }}
+ {{- end }}
+ {{- if $img }}
+ {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
+ {{- if hugo.IsExtended -}}
+ {{- $processableFormats = $processableFormats | append "webp" -}}
+ {{- end -}}
+ {{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }}
+ {{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}}
+ {{- if (not (and (not .imageHeight) (not .imageWidth))) }}
+ {{- $img = $img.Resize (printf "%dx%d" .imageWidth .imageHeight) }}
+ {{- else if .imageHeight }}
+ {{- $img = $img.Resize (printf "x%d" .imageHeight) }}
+ {{ else if .imageWidth }}
+ {{- $img = $img.Resize (printf "%dx" .imageWidth) }}
+ {{ else }}
+ {{- $img = $img.Resize "150x150" }}
+ {{- end }}
+ {{- end }}
+
+ {{- else }}
+
+ {{- end }}
+ {{- end }}
+
+ {{- range seq (sub $firstHeaderLevel $largest) -}}
+
+ {{- $.Scratch.Add "bareul" (sub (add $largest .) 1) -}}
+ {{- end -}}
+ {{- range $i, $header := $headers -}}
+ {{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}}
+ {{- $headerLevel := len (seq $headerLevel) -}}
+
+ {{/* get id="xyz" */}}
+ {{- $id := index (findRE "(id=\"(.*?)\")" $header 9) 0 }}
+
+ {{- /* strip id="" to leave xyz, no way to get regex capturing groups in hugo */ -}}
+ {{- $cleanedID := replace (replace $id "id=\"" "") "\"" "" }}
+ {{- $header := replaceRE "((.|\n])+?)" "$1" $header -}}
+
+ {{- if ne $i 0 -}}
+ {{- $prevHeaderLevel := index (findRE "[1-6]" (index $headers (sub $i 1)) 1) 0 -}}
+ {{- $prevHeaderLevel := len (seq $prevHeaderLevel) -}}
+ {{- if gt $headerLevel $prevHeaderLevel -}}
+ {{- range seq $prevHeaderLevel (sub $headerLevel 1) -}}
+
+ {{/* the first should not be recorded */}}
+ {{- if ne $prevHeaderLevel . -}}
+ {{- $.Scratch.Add "bareul" . -}}
+ {{- end -}}
+ {{- end -}}
+ {{- else -}}
+
+ {{- if lt $headerLevel $prevHeaderLevel -}}
+ {{- range seq (sub $prevHeaderLevel 1) -1 $headerLevel -}}
+ {{- if in ($.Scratch.Get "bareul") . -}}
+
- {{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}}
- {{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) -}}
-
-{{- else -}}
-
-
-{{- end -}}
-{{- end -}}
-
-{{- end -}}
\ No newline at end of file
+ {{- end -}}
+ {{- end }}
+
+ {{- end }}
+
+
+
+{{- end }}
diff --git a/layouts/partials/translation_list.html b/layouts/partials/translation_list.html
new file mode 100644
index 00000000..00282519
--- /dev/null
+++ b/layouts/partials/translation_list.html
@@ -0,0 +1,19 @@
+{{- if .IsTranslated -}}
+{{- if (ne .Layout "search") }}
+{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }} | {{- end -}}
+{{- end }}
+{{- i18n "translations" | default "Translations" }}:
+