diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 65fe17e..61eac05 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -11,7 +11,7 @@ jobs: deploy: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.1 with: submodules: true # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod @@ -19,10 +19,10 @@ jobs: - name: Hugo setup uses: peaceiris/actions-hugo@v2.6.0 with: - hugo-version: "0.105.0" + hugo-version: "0.111.3" extended: true - - uses: actions/cache@v2 + - uses: actions/cache@v4.0.0 with: path: /tmp/hugo_cache key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} @@ -35,7 +35,7 @@ jobs: run: hugo --minify - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v3.9.3 if: github.ref == 'refs/heads/main' with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/seo.yml b/.github/workflows/seo.yml index 1bd51fa..5d48a44 100644 --- a/.github/workflows/seo.yml +++ b/.github/workflows/seo.yml @@ -12,10 +12,10 @@ jobs: linkChecker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.1 - name: Link Checker id: lychee - uses: lycheeverse/lychee-action@v1.8.0 + uses: lycheeverse/lychee-action@v1.9.2 with: fail: true args: --max-redirects 10 -a 403,500,503 . @@ -24,17 +24,17 @@ jobs: name: Check orphan pages steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 with: submodules: true - name: Checkout SEO Spy - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 with: repository: 3mdeb/seo-spy path: seo-spy - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v5 with: python-version: '3.9' @@ -44,7 +44,7 @@ jobs: pip install -r seo-spy/requirements.txt - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 + uses: peaceiris/actions-hugo@v2.6.0 with: extended: true @@ -64,17 +64,17 @@ jobs: name: Check canonical links steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 with: submodules: true - name: Checkout SEO Spy - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 with: repository: 3mdeb/seo-spy path: seo-spy - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v5 with: python-version: '3.9' @@ -84,7 +84,7 @@ jobs: pip install -r seo-spy/requirements.txt - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 + uses: peaceiris/actions-hugo@v2.6.0 with: extended: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 134edf3..ac22789 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-added-large-files - id: check-merge-conflict @@ -13,13 +13,13 @@ repos: - id: mixed-line-ending - repo: https://github.com/adrienverge/yamllint - rev: v1.32.0 + rev: v1.33.0 hooks: - id: yamllint args: [-c=.yamllint] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.34.0 + rev: v0.38.0 hooks: - id: markdownlint - id: markdownlint-fix @@ -32,7 +32,7 @@ repos: - commit-msg - repo: https://github.com/codespell-project/codespell - rev: v2.2.4 + rev: v2.2.6 hooks: - id: codespell diff --git a/scripts/docker-host-preview.sh b/scripts/docker-host-preview.sh new file mode 100755 index 0000000..43ef319 --- /dev/null +++ b/scripts/docker-host-preview.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# Check for the required parameters +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Function to clean up background processes when the script exits +cleanup() { + echo "Cleaning up..." + # Kill the inotifywait background process + kill $INOTIFY_PID +} + +# Set trap to call cleanup function when the script exits +trap cleanup exit + +REMOTE_USER_HOST="$1" +LOCAL_SRC_DIR="$2" # Local source directory provided as the second parameter +REMOTE_SRC_DIR="/tmp/3mdeb-website" +DOCKER_IMAGE="klakegg/hugo:0.111.3-ext-alpine" +DOCKER_PORT="1313" +REMOTE_HOST=$(echo $REMOTE_USER_HOST | cut -d '@' -f2) + +# Set DOCKER_HOST environment variable +export DOCKER_HOST="tcp://$REMOTE_HOST:2375" + +# Function to continuously sync local directory with remote directory +start_sync() { + ssh $REMOTE_USER_HOST "rm -rf $REMOTE_SRC_DIR" + rsync -avz --exclude='.git/' $LOCAL_SRC_DIR $REMOTE_USER_HOST:$REMOTE_SRC_DIR + inotifywait -m -r -e modify,create,delete --exclude '^\.git/' --format '%w%f' $LOCAL_SRC_DIR | while read file; do + # Check if the changed file is not inside .git directory + if [[ $file != *".git"* ]]; then + rsync -avz --exclude='.git/' $LOCAL_SRC_DIR $REMOTE_USER_HOST:$REMOTE_SRC_DIR + fi + done & + INOTIFY_PID=$! +} + +# Function to run Docker container on remote host +run_docker_container() { + docker run --rm -it -v $REMOTE_SRC_DIR:/src -p $DOCKER_PORT:$DOCKER_PORT -u $(id -u) $DOCKER_IMAGE serve -b $REMOTE_HOST +} + +#!/bin/bash + +# Function to check if a command exists +command_exists() { + command -v "$1" >/dev/null 2>&1 +} + +# Check for required commands +if ! command_exists rsync; then + echo "rsync is not installed. Please install it." + exit 1 +fi + +if ! command_exists inotifywait; then + echo "inotify-tools is not installed. Please install it." + exit 1 +fi + +# Start continuous synchronization in the background +start_sync + +# Run Docker container +run_docker_container + +# After the Docker container exits, kill the background sync process +kill $! diff --git a/themes/dasharo/layouts/partials/essentials/style.html b/themes/dasharo/layouts/partials/essentials/style.html index 78e53f1..cfa8282 100755 --- a/themes/dasharo/layouts/partials/essentials/style.html +++ b/themes/dasharo/layouts/partials/essentials/style.html @@ -2,12 +2,10 @@ - -