javascript - 自动生成 Hreflangs
问题描述
我想请人帮忙创建一个代码,在网页上自动生成具有相同名称的hreflangs (例如/page123.php)。
例如页面www.example.it/page123.php有许多其他语言的版本。
是否可以根据链接自动生成代码?
例如:
<link rel="canonical" href="https://www.example.it/page123.php" />
<link rel="alternate" href="https://www.example.it/de/page123.php" hreflang="de" />
<link rel="alternate" href="https://www.example.it/en/page123.php" hreflang="en" />
ETC..
document.getElementById("url").innerHTML = window.location.href;
<p id="url"></p>
解决方案
推荐阅读
- 3d - 在搅拌机的 3d 网格上使用布尔运算,如饼干切割器
- javascript - 我需要有关如何设置网络服务器的建议
- javascript - 如何使自定义音频播放器适用于多个音频?
- r - 根据 data.table 中按组增加值过滤出多行
- javascript - 在客户端中止 XHR 请求时会发生什么服务器端?
- php - PHP Math 在将负数与零相乘时中断
- icons - 2020 年我应该为我的网站创建哪些图标?
- android - 重复类 com.google.android.gms.location.places.zza
- javascript - 吉森没有假设正确的语法
- python - Plotly:如何重写标准仪表板应用程序以在 JupyterLab 中启动它?