5

私はLiferay 6.1を使用しており、同じテーマを開発しました。私の問題は、テーマをロードすると、以下に示すように、ヘッドセクションに巨大なリンクが含まれていることです:

<link rel="alternate" hreflang="ar-SA" href="http://localhost/ar">
<link rel="alternate" hreflang="eu-ES" href="http://localhost/eu">
<link rel="alternate" hreflang="bg-BG" href="http://localhost/bg">
<link rel="alternate" hreflang="ca-AD" href="http://localhost/ca">
<link rel="alternate" hreflang="ca-ES" href="http://localhost/ca_ES">
<link rel="alternate" hreflang="zh-CN" href="http://localhost/zh">
<link rel="alternate" hreflang="zh-TW" href="http://localhost/zh_TW">
<link rel="alternate" hreflang="hr-HR" href="http://localhost/hr">
<link rel="alternate" hreflang="cs-CZ" href="http://localhost/cs">
<link rel="alternate" hreflang="da-DK" href="http://localhost/da">
<link rel="alternate" hreflang="nl-NL" href="http://localhost/nl">
<link rel="alternate" hreflang="nl-BE" href="http://localhost/nl_BE">
<link rel="alternate" hreflang="en-GB" href="http://localhost/en_GB">
<link rel="alternate" hreflang="et-EE" href="http://localhost/et">
<link rel="alternate" hreflang="fi-FI" href="http://localhost/fi">
<link rel="alternate" hreflang="fr-FR" href="http://localhost/fr">
<link rel="alternate" hreflang="gl-ES" href="http://localhost/gl">
<link rel="alternate" hreflang="de-DE" href="http://localhost/de">
<link rel="alternate" hreflang="el-GR" href="http://localhost/el">
<link rel="alternate" hreflang="iw-IL" href="http://localhost/iw">
<link rel="alternate" hreflang="hi-IN" href="http://localhost/hi">
<link rel="alternate" hreflang="hu-HU" href="http://localhost/hu">
<link rel="alternate" hreflang="in-ID" href="http://localhost/in">
<link rel="alternate" hreflang="it-IT" href="http://localhost/it">
<link rel="alternate" hreflang="ja-JP" href="http://localhost/ja">
<link rel="alternate" hreflang="ko-KR" href="http://localhost/ko">
<link rel="alternate" hreflang="lo-LA" href="http://localhost/lo">
<link rel="alternate" hreflang="nb-NO" href="http://localhost/nb">
<link rel="alternate" hreflang="fa-IR" href="http://localhost/fa">
<link rel="alternate" hreflang="pl-PL" href="http://localhost/pl">
<link rel="alternate" hreflang="pt-BR" href="http://localhost/pt">
<link rel="alternate" hreflang="pt-PT" href="http://localhost/pt_PT">
<link rel="alternate" hreflang="ro-RO" href="http://localhost/ro">
<link rel="alternate" hreflang="ru-RU" href="http://localhost/ru">
<link rel="alternate" hreflang="sr-RS" href="http://localhost/sr">
<link rel="alternate" hreflang="sr-RS-latin" href="http://localhost/sr_RS_latin">
<link rel="alternate" hreflang="sl-SI" href="http://localhost/sl">
<link rel="alternate" hreflang="sk-SK" href="http://localhost/sk">
<link rel="alternate" hreflang="es-ES" href="http://localhost/es">
<link rel="alternate" hreflang="sv-SE" href="http://localhost/sv">
<link rel="alternate" hreflang="tr-TR" href="http://localhost/tr">
<link rel="alternate" hreflang="uk-UA" href="http://localhost/uk">
<link rel="alternate" hreflang="vi-VN" href="http://localhost/vi">

不要な言語を削除したい。これは SEO の良い慣行ではないので、これらのリンクを削除してほしい。テーマのデフォルト言語が必要です。translations.disabled=trueportal-ext ファイルに追加しようとしましたが、うまくいきませんでした。

ご提案をお待ちしております。

4

4 に答える 4

4

"locales" プロパティを portal-ext.porterties に追加して、使用するロケールに制限する必要があります。たとえば、英語とドイツ語に制限するには、これを行うことができます

locales=en_US,de_DE

于 2013-02-14T08:38:08.030 に答える
0

portal-ext.properties の設定は、でポータルの設定をオーバーライドできますControl Panel > Settings > Display Settings > Available Languages。それらをそこに設定しても安全だと思います。

また、SEO セクションにはページごとのオプションがあり、正規リンクを無効にできます。

于 2015-09-15T08:10:06.357 に答える
0

公式の wiki ドキュメントも参照してください。

ここに引用します:

不要な言語の削除

デフォルトでは、Liferay は次のすべての言語をサポートしています (Liferay 4.3.3 の portal.properties からの抜粋):

locales=ar_SA,ca_AD,ca_ES,zh_CN,zh_TW,cs_CZ,nl_NL,en_US,fi_FI,fr_FR,de_DE,el_GR,hu_HU,it_IT,ja_JP,ko_KR,fa_IR,pt_BR,ru_RU,es_ES,sv_SE,tr_TR,vi_VN

英語、ドイツ語、スペイン語のみをサポートする場合は、ロケール値が次のようになるように、不要なロケールを削除するだけです。

locales=en_US,de_DE,es_ES
于 2015-05-06T07:37:47.150 に答える