Commit 1e9f344
committed
Fix: Implement manual hreflang, redirects, and link corrections
This commit includes multiple fixes to address SEO issues from Google Search Console.
1. **Standardized Canonical URLs:**
- Removed explicit `canonical_url` from Portuguese post front matter.
- `jekyll-seo-tag` now handles canonicals, and the theme's duplicate canonical generation in `_includes/head.html` has been removed.
2. **Manual `hreflang` Tag Implementation:**
- Due to `jekyll-seo-tag` not generating `hreflang` tags (likely because `page.polyglot.translations` was empty in its context), `hreflang` tags are now manually generated in `_includes/head.html`.
- This implementation uses Polyglot's `translate_url` and Jekyll's `absolute_url` filters to construct the correct absolute URLs for each language version, including `x-default`.
3. **Corrected Internal Links & 404 Redirects:**
- **Post URLs:**
- Corrected internal Markdown links in `_posts/` that used incorrect language suffixes (e.g., `post-slug-en`).
- Added `redirect_from` entries to relevant posts to create 301 redirects from old malformed URLs (e.g., `/posts/slug-en/`, `/pt-BR/posts/slug-pt-BR/`, `/posts/portuguese-slug/`) to their correct canonical URLs.
- **Tag/Category URLs:**
- Created manual HTML redirect files (e.g., `tags/automação/index.html`) for Portuguese tag/category pages that were being accessed without the `/pt-BR/` prefix. These now redirect to the correct prefixed URLs.
4. **Plugin Configuration:**
- Ensured `jekyll-polyglot` is listed before `jekyll-seo-tag` in `_config.yml`'s plugin list.
**Summary of Changes to Files:**
- `_config.yml`: Plugin order adjusted.
- `_includes/head.html`: Duplicate canonical logic removed, manual `hreflang` logic added.
- `_posts/**/**.md`: Front matter updated with `redirect_from` entries; internal and commented links corrected.
- `tags/*/index.html` & `categories/*/index.html`: New HTML redirect files created for specific paths.
These changes aim to resolve the reported 404 errors, "Alternate page with proper canonical tag" issues, and "Duplicate, Google chose different canonical than user" messages by ensuring correct canonicals, comprehensive hreflang tags, and proper redirects for old/malformed URLs. Sitemap validation is the main remaining step that was not completed.1 parent d77c35d commit 1e9f344
File tree
19 files changed
+95
-5
lines changed- _includes
- _posts
- en
- pt-BR
- categories
- automa%C3%A7%C3%A3o
- cftv
- monitoramento
- tags
- autentica%C3%A7%C3%A3o
- automa%C3%A7%C3%A3o
- automacao_temp
- monitoramento
- scripts-personalizados
19 files changed
+95
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
0 commit comments