Commit 4f8749f
committed
Switch CTA / opening banner to the article's primary product
Articles dedicated to a specific ailia component (ailia AI Voice,
ailia LLM, ailia Speech, …) now route the end-of-article CTA and
the opening banner to that product's Docs page instead of the
generic /sdk/ root.
detect_primary_product(title, slug, body):
- Returns (display_name, docs_path) by checking title and slug first
(e.g. ailia-ai-voiceでユーザ辞書を使用する → "ailia AI Voice", "voice/")
- Falls back to body-frequency, with longest-name-first matching so
"ailia AI Voice" wins over "ailia Voice" / "ailia AI" / "ailia".
When detected:
- CTA primary URL → docs.ailia.ai/[en/]<product_path>
- CTA title → "<Product> を試す" / "Try <Product>"
- Opening banner → same product's docs URL
When no product is detected (or only ailia SDK), behaviour is
unchanged: header stays "Try ailia SDK" / "ailia SDK を試す" and
URL stays at /sdk/.
Verified on the ailia-ai-voiceでユーザ辞書を使用する article: title
becomes "ailia AI Voice を試す", primary CTA goes to /voice/, opening
banner also goes to /voice/. ailia LLM article and ailia SDK article
keep their respective targets.
https://claude.ai/code/session_01JYWNoc1ay6D3BZTxaFfRjM1 parent e3116e3 commit 4f8749f
1 file changed
Lines changed: 75 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1214 | 1214 | | |
1215 | 1215 | | |
1216 | 1216 | | |
1217 | | - | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1218 | 1263 | | |
1219 | 1264 | | |
| 1265 | + | |
| 1266 | + | |
1220 | 1267 | | |
1221 | 1268 | | |
1222 | 1269 | | |
1223 | 1270 | | |
1224 | 1271 | | |
1225 | | - | |
1226 | | - | |
1227 | | - | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
1228 | 1280 | | |
1229 | 1281 | | |
1230 | 1282 | | |
| |||
1290 | 1342 | | |
1291 | 1343 | | |
1292 | 1344 | | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
1293 | 1361 | | |
1294 | 1362 | | |
1295 | 1363 | | |
| |||
1335 | 1403 | | |
1336 | 1404 | | |
1337 | 1405 | | |
1338 | | - | |
| 1406 | + | |
1339 | 1407 | | |
1340 | | - | |
| 1408 | + | |
1341 | 1409 | | |
1342 | | - | |
| 1410 | + | |
1343 | 1411 | | |
1344 | 1412 | | |
1345 | 1413 | | |
| |||
0 commit comments