Analyze article and automatically insert relevant internal and external links from both ITA and SLG projects. Use when user asks to add links to an article or improve article cross-linking.
Analyze an article, find relevant internal links from BOTH projects (ITA and SLG), and automatically insert them into the file.
$ARGUMENTS
The input should be a path to an article file (e.g., _includes/ru/some-article.md).
Read the article from the specified path
Determine article language from the path:
_includes/ru/ or ru/ → Russian_includes/ua/ or ua/ → Ukrainian_includes/en/ or en/ → English_includes/es/ or es/ → SpanishUnderstand link types:
#надежные-хесторы). Format: [text](#anchor)[text](https://spainlifeguide.com/...){:target="_blank"}Note: ITA has one main index page per language with all content as sections (anchors). There are no standalone article pages.
Load ITA links database:
_resources/internal_links_{lang}.json - contains anchors for the main pageUnderstand the internal_links_{lang}.json structure:
{
"pages": [
{
"path": "/ru/",
"url": "https://itautonomos.com/ru/",
"title": "Autónomo - Полное Руководство",
"anchors": ["надежные-хесторы", "регистрация-autónomo-пошагово", ...]
}
]
}
ITA anchor format by language:
[text](#anchor) (resolves to /ru/#anchor)[text](#anchor) (resolves to /ua/#anchor)[text](#anchor) (resolves to /#anchor)[text](#anchor) (resolves to /es/#anchor)Analyze the article content for ITA-relevant topics:
Match terms to ITA anchors:
[text](#anchor-name)Apply conservative linking rules for internal links:
Edit the file to add internal links
Load SLG links database from sibling project:
../spain-life-guide/_resources/internal_links_{lang}.json - contains all pages with anchorsUnderstand the internal_links_{lang}.json structure:
{
"pages": [
{
"path": "/",
"url": "https://spainlifeguide.com/",
"title": "Main page title",
"description": "What this page is about",
"anchors": ["anchor1", "anchor2"]
},
{
"path": "/ru/mortgage/",
"url": "https://spainlifeguide.com/ru/mortgage/",
"title": "Ипотека в Испании",
"anchors": ["документы-для-ипотеки", "пошаговая-инструкция", ...]
}
]
}
url + #anchor to create external linksAnalyze the article for SLG-relevant topics:
Apply conservative linking rules for external links:
https://spainlifeguide.com/ru/mortgage/) or page with anchor (https://spainlifeguide.com/ru/mortgage/#документы-для-ипотеки)Edit the file to add external links with {:target="_blank"}
Output summary:
| Text linked | Link | Reason |
|---|---|---|
| phrase | #anchor-id | why this link helps |
| Text linked | Full URL | Reason |
|---|---|---|
| phrase | https://spainlifeguide.com/... | why this link helps |
For an English article about tax optimization, after editing:
Added Internal Links (ITA):
| Text linked | Link | Reason |
|---|---|---|
| gestor | #reliable-gestors | Helps reader find verified gestors |
| IRPF | #irpf-income-tax | Links to detailed tax explanation |
Added External Links (SLG):
| Text linked | Full URL | Reason |
|---|---|---|
| my mortgage experience | https://spainlifeguide.com/en/mortgage/ | Personal mortgage experience |
| mortgage documents | https://spainlifeguide.com/en/mortgage/#mortgage-documents | List of required mortgage documents |
Skipped: