diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 57d601936f0..f03c5907f20 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,15 +2,6 @@ version: 2 updates: -# Update the git submodules -- package-ecosystem: "gitsubmodule" - directory: "/" - schedule: - interval: "daily" - labels: - - "dependencies" - - "automerge" - # Update the Github Action versions - package-ecosystem: "github-actions" directory: "/" diff --git a/.github/workflows/html-proof.yaml b/.github/workflows/html-proof.yaml deleted file mode 100644 index 13d55620abf..00000000000 --- a/.github/workflows/html-proof.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: HTML Proofer - -# run when a event happen in a PR -on: [pull_request] - -jobs: - proof-html: - runs-on: ubuntu-latest - steps: - # checkout to the commit that has been pushed - - uses: actions/checkout@v4 - with: - submodules: true # Fetch Hugo themes (true OR recursive) - fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2.6.0 - with: - hugo-version: 'latest' - extended: true - - - name: Update Hugo Modules - run: hugo mod tidy - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Install node modules - run: | - hugo mod npm pack - npm install - - - name: Build - run: hugo --minify - - # Run HTML Proofer - - uses: anishathalye/proof-html@v2.1.2 - with: - directory: ./public - enforce_https: false - url_ignore: "#" - url_ignore_re: ^https://www.pexels.com diff --git a/.github/workflows/lighthouse-check.yml b/.github/workflows/lighthouse-check.yml deleted file mode 100644 index 3e622929b18..00000000000 --- a/.github/workflows/lighthouse-check.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Lighthouse -# Run check on pull request -on: [pull_request] - -jobs: - score-check: - runs-on: ubuntu-latest - steps: - - name: Waiting for Netlify Preview - uses: kamranayub/wait-for-netlify-action@v2.1.1 - id: preview - with: - site_name: "toha" - max_timeout: 300 - env: - NETLIFY_TOKEN: ${{secrets.NETLIFY_TOKEN}} - - - name: Run Lighthouse - uses: foo-software/lighthouse-check-action@v10.0.0 - id: lighthouseCheck - with: - accessToken: ${{ secrets.LIGHTHOUSE_TOKEN }} - gitHubAccessToken: ${{secrets.GITHUB_TOKEN}} - emulatedFormFactor: 'all' - prCommentEnabled: true - prCommentSaveOld: false - timeout: 5 - urls: "${{ steps.preview.outputs.url }},${{ steps.preview.outputs.url }}/posts/,${{ steps.preview.outputs.url }}/posts/writing-posts/markdown-syntax/" diff --git a/.github/workflows/md-link-check.yaml b/.github/workflows/md-link-check.yaml deleted file mode 100644 index 6611dc10349..00000000000 --- a/.github/workflows/md-link-check.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: Check Markdown links - -# Run action on pull request event -on: [pull_request] - -jobs: - markdown-link-check: - runs-on: ubuntu-latest - steps: - # checkout to latest commit - - uses: actions/checkout@master - - - name: Waiting for Netlify Preview - uses: kamranayub/wait-for-netlify-action@v2.1.1 - id: preview - with: - site_name: "toha" - max_timeout: 300 - env: - NETLIFY_TOKEN: ${{secrets.NETLIFY_TOKEN}} - - - name: Link Checker - id: lychee - uses: lycheeverse/lychee-action@v1.8.0 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - args: "--verbose --exclude-mail ${{steps.preview.outputs.url}}" - fail: true - - - name: Comment Broken Links - uses: marocchino/sticky-pull-request-comment@v2 - with: - path: lychee/out.md diff --git a/.github/workflows/deploy-site.yaml b/.github/workflows/merge-to-main.yml similarity index 94% rename from .github/workflows/deploy-site.yaml rename to .github/workflows/merge-to-main.yml index a78a05bb733..05926756d8c 100644 --- a/.github/workflows/deploy-site.yaml +++ b/.github/workflows/merge-to-main.yml @@ -1,4 +1,4 @@ -name: Deploy to Github Pages +name: Merge to main workflows # run when a commit is pushed to "source" branch on: @@ -7,7 +7,7 @@ on: - main jobs: - deploy: + deploy-to-gh-pages: runs-on: ubuntu-latest steps: # checkout to the commit that has been pushed diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 00000000000..8aadf712ef0 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,91 @@ +name: PR Workflows + +# Run action on pull request event +on: [pull_request] + + +jobs: + # Build exampleSite + build: + runs-on: ubuntu-latest + steps: + # checkout to the commit that has been pushed + - uses: actions/checkout@v4.1.1 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install node modules + run: npm install + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2.6.0 + with: + hugo-version: 'latest' + extended: true + + - name: Build + run: | + hugo --minify + + + lighthouse-check: + runs-on: ubuntu-latest + steps: + - name: Waiting for Netlify Preview + uses: kamranayub/wait-for-netlify-action@v2.1.1 + id: preview + with: + site_name: "toha" + max_timeout: 300 + env: + NETLIFY_TOKEN: ${{secrets.NETLIFY_TOKEN}} + + - name: Run Lighthouse + uses: foo-software/lighthouse-check-action@v10.0.0 + id: lighthouseCheck + with: + accessToken: ${{ secrets.LIGHTHOUSE_TOKEN }} + gitHubAccessToken: ${{secrets.GITHUB_TOKEN}} + emulatedFormFactor: 'all' + prCommentEnabled: true + prCommentSaveOld: true + timeout: 5 + urls: "${{ steps.preview.outputs.url }},${{ steps.preview.outputs.url }}/posts/,${{ steps.preview.outputs.url }}/posts/markdown-sample/,${{ steps.preview.outputs.url }}/posts/shortcodes/" + + # Check for any broken links + markdown-link-check: + runs-on: ubuntu-latest + steps: + # checkout to latest commit + - uses: actions/checkout@master + + - name: Waiting for Netlify Preview + uses: kamranayub/wait-for-netlify-action@v2.1.1 + id: preview + with: + site_name: "toha" + max_timeout: 300 + env: + NETLIFY_TOKEN: ${{secrets.NETLIFY_TOKEN}} + + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v1.8.0 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + args: "--verbose --exclude-mail ${{steps.preview.outputs.url}} --exclude=['https://www.udemy.com/']" + output: lychee/out.md + + - name: Comment Broken Links + if: ${{ steps.lychee.outputs.exit_code != 0 }} + uses: marocchino/sticky-pull-request-comment@v2 + with: + path: lychee/out.md + + - name: Fail workflow if broken links found + if: ${{ steps.lychee.outputs.exit_code != 0 }} + run: exit 1 diff --git a/.github/workflows/theme-update.yml b/.github/workflows/theme-update.yml new file mode 100644 index 00000000000..4fd9daf17b7 --- /dev/null +++ b/.github/workflows/theme-update.yml @@ -0,0 +1,52 @@ +name: "Theme Update" + +on: + schedule: + - cron: "0 0 * * *" + +jobs: + update-theme: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + with: + ref: main + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2.6.0 + with: + hugo-version: "latest" + extended: true + + - name: Update hugo modules + run: | + # update to latest version of all modules + hugo mod get -u + + # update the npm dependencies + hugo mod npm pack + + # cleanup go.sum file + hugo mod tidy + + - name: Install node modules + run: npm install + + - name: Build + run: | + # build the site + hugo --minify + # remove file generated by the build + rm -rf public/ + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + base: main + title: Update theme + labels: automerge diff --git a/assets/jsconfig.json b/assets/jsconfig.json index 5754a5a5c9a..6bafc06d3a3 100644 --- a/assets/jsconfig.json +++ b/assets/jsconfig.json @@ -3,7 +3,7 @@ "baseUrl": ".", "paths": { "*": [ - "../../toha/assets/*" + "../../../../../.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugo-toha/toha/v4@v4.0.0/assets/*" ] } } diff --git a/config.yaml b/config.yaml index 5ced4dda13c..1493d3bae98 100644 --- a/config.yaml +++ b/config.yaml @@ -276,9 +276,9 @@ params: # Show/hide newsletter section in the footer. Default is "true". # Currently, it supports "mailchimp". newsletter: - enable: true - provider: mailchimp - mailchimpURL: https://github.us1.list-manage.com/subscribe/post?u=19de52a4603135aae97163fd8&id=094a24c76e + enable: false + # provider: mailchimp + # mailchimpURL: https://github.us1.list-manage.com/subscribe/post?u=19de52a4603135aae97163fd8&id=094a24c76e # Show/hide disclaimer notice in the footer. Default is "false". disclaimer: diff --git a/go.sum b/go.sum index 4fd17835cd6..02cb7e8ef74 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,2 @@ -github.com/hugo-toha/toha/v4 v4.0.0-20230928222719-6dc9d1d33db8 h1:9EEY0tMgzf0NEKRYdtc+WwrG6FMolQuQIPujzdh3++M= -github.com/hugo-toha/toha/v4 v4.0.0-20230928222719-6dc9d1d33db8/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ= -github.com/hugo-toha/toha/v4 v4.0.0-20230929230448-5f0aebcf6842 h1:WXIgg+D6DzPuahhVBoL4ytm/+mgyxAjnDSv24jzmQAY= -github.com/hugo-toha/toha/v4 v4.0.0-20230929230448-5f0aebcf6842/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ= -github.com/hugo-toha/toha/v4 v4.0.0-20230929231747-c943f39617c1 h1:iPPEerrlIaBH5TvkQSQ71Rg09C5GvGVodM0WOiipUcc= -github.com/hugo-toha/toha/v4 v4.0.0-20230929231747-c943f39617c1/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ= -github.com/hugo-toha/toha/v4 v4.0.0-20231006193257-e8f8f3b22b76 h1:tdFPiwCPgQvOR/4CINRu8MRFfV8dg4wJtdRL8ky3Iz8= -github.com/hugo-toha/toha/v4 v4.0.0-20231006193257-e8f8f3b22b76/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ= -github.com/hugo-toha/toha/v4 v4.0.0-20231020202026-69611695e7e3 h1:SOiejz6dJw2jm+MBDKrznDKVWpPPXMe2YUqin9BY6Ek= -github.com/hugo-toha/toha/v4 v4.0.0-20231020202026-69611695e7e3/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ= -github.com/hugo-toha/toha/v4 v4.0.0-20231031071528-05c9d3d850b2 h1:EkR94Ztv1Ao+iEP0e5Vk/GRmZvhAjSHzjsMOXBaK3Ak= -github.com/hugo-toha/toha/v4 v4.0.0-20231031071528-05c9d3d850b2/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ= -github.com/hugo-toha/toha/v4 v4.0.0-20231031082454-cd2546d4e8ea h1:CCJ4JjZFHNWx8jLG8BQDx6Yf6pLbXY09LKgJdcUI3zc= -github.com/hugo-toha/toha/v4 v4.0.0-20231031082454-cd2546d4e8ea/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ= -github.com/hugo-toha/toha/v4 v4.0.0-20231206184850-bb9fec2e5d53 h1:sKr2HLVq1b3aFsgiXDUTneqBNnsakm0xCnxrqEFi/Oo= -github.com/hugo-toha/toha/v4 v4.0.0-20231206184850-bb9fec2e5d53/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ= github.com/hugo-toha/toha/v4 v4.0.0 h1:rOiQeXzppzBLslTcQ1q2cqtz4KrjvYsrEVAHClbnsU8= github.com/hugo-toha/toha/v4 v4.0.0/go.mod h1:p/K34lqlqmhzfPd4cx66od7sjlROBqhMxG30mJz+aKQ= diff --git a/package.json b/package.json index e0dbf5bc544..4ed436c40bc 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "@fortawesome/fontawesome-free": "github.com/hugo-toha/toha/v4", "autoprefixer": "github.com/hugo-toha/toha/v4", "bootstrap": "github.com/hugo-toha/toha/v4", - "darkreader": "github.com/hugo-toha/toha/v4", "eslint": "github.com/hugo-toha/toha/v4", "eslint-config-prettier": "github.com/hugo-toha/toha/v4", "eslint-config-standard": "github.com/hugo-toha/toha/v4", @@ -37,7 +36,6 @@ "@fortawesome/fontawesome-free": "^6.2.0", "autoprefixer": "^10.4.13", "bootstrap": "^4.6.2", - "darkreader": "^4.9.58", "eslint": "^8.31.0", "eslint-config-prettier": "^8.6.0", "eslint-config-standard": "^17.0.0",