diff --git a/.github/workflows/jekyll-docker.yml b/.github/workflows/jekyll-docker.yml index 60e5736..43c7ac5 100644 --- a/.github/workflows/jekyll-docker.yml +++ b/.github/workflows/jekyll-docker.yml @@ -1,4 +1,4 @@ -name: Jekyll site CI +name: Validate HTML & Assets on: push: @@ -7,14 +7,67 @@ on: branches: [ "master" ] jobs: - build: - + validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build the site in the jekyll/builder container + + - name: Install validation tools + run: sudo apt-get update -qq && sudo apt-get install -y -qq tidy libxml2-utils + + - name: Validate HTML syntax + run: tidy -q -e index.html + + - name: Check for broken internal links + run: | + # Extract href/src values and verify local files exist + exit_code=0 + for file in $(grep -oP '(?:href|src)="(?!https?://|//|#|mailto:)([^"]+)"' index.html | grep -oP '"[^"]+"' | tr -d '"'); do + if [ ! -f "$file" ] && [ ! -d "$file" ]; then + echo "ERROR: Missing local file referenced in index.html: $file" + exit_code=1 + fi + done + exit $exit_code + + - name: Validate sitemap.xml well-formedness + run: xmllint --noout sitemap.xml + + - name: Validate JSON-LD structured data syntax + run: | + # Extract JSON-LD blocks and validate JSON syntax + python3 -c " + import json, re, sys + with open('index.html') as f: + html = f.read() + blocks = re.findall(r'', html, re.DOTALL) + if not blocks: + print('WARNING: No JSON-LD blocks found') + sys.exit(0) + for i, block in enumerate(blocks): + try: + data = json.loads(block) + print(f'JSON-LD block {i+1}: valid ({data.get(\"@type\", \"unknown type\")})') + except json.JSONDecodeError as e: + print(f'ERROR: JSON-LD block {i+1} is invalid: {e}') + sys.exit(1) + " + + - name: Validate robots.txt references + run: | + # Check that sitemap URL in robots.txt points to an existing file + sitemap_path=$(grep -oP 'Sitemap:\s*https?://[^/]+/\K.*' robots.txt || true) + if [ -n "$sitemap_path" ] && [ ! -f "$sitemap_path" ]; then + echo "ERROR: robots.txt references missing sitemap: $sitemap_path" + exit 1 + fi + echo "robots.txt is valid" + + - name: Check no TODO/FIXME markers in HTML run: | - docker run \ - -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ - jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" + if grep -inE '(TODO|FIXME|HACK|XXX)' index.html; then + echo "WARNING: Found TODO/FIXME markers in index.html" + else + echo "No TODO/FIXME markers found" + fi diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..b94e996 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,21 @@ +## Cursor Cloud specific instructions + +This is a static HTML/CSS website (no build tools, no package managers, no tests). It serves as a Git commands reference in Portuguese, hosted on GitHub Pages. + +### Running locally + +Serve files with any static HTTP server from the repo root: + +``` +python3 -m http.server 8000 +``` + +Then open `http://localhost:8000/` in a browser. + +### Linting + +There are no project-defined lint or test scripts. HTML can be validated with `tidy -q -e index.html`. + +### CI + +The GitHub Actions workflow (`.github/workflows/jekyll-docker.yml`) runs a Jekyll build in a Docker container, but the site itself is served as raw static files on GitHub Pages. diff --git a/index.html b/index.html index 70f2da0..5ab2ef5 100755 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - +
@@ -10,8 +10,9 @@ - + + @@ -36,12 +37,6 @@ - - - + +