fix: 一部ページで直アクセス時にタイトルが重複する問題を修正#18
Open
urmshr wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
現象
以下のページに直接アクセスすると、ブラウザのタブなどに表示されるタイトルでサイト名が繰り返し出力される。
ただし、一度別なページ(e.g.
/OpenSource)に遷移してから、ヘッダーやフッター内のリンクを経由して当該ページに戻ると、重複が解消される。azooKey - 自由自在なキーボードアプリ azooKey - 自由自在なキーボードアプリmacOS版 | azooKey - 自由自在なキーボードアプリ azooKey - 自由自在なキーボードアプリ原因
useHead/useSeoMetaをsetup()の外で呼び出していたため、head 情報の登録タイミングやページ遷移時の扱いが想定とずれ、直アクセス時のタイトルに影響したと考えられる。Desktop.vueではuseHeadに渡すtitleにすでにサイト名が含まれていたため、App 側のtitleTemplateと組み合わさってサイト名が二重に表示されていた。変更内容
Main.vue/OpenSource.vue/Contact.vue/QA.vue/PrivacyPolicy.vue/TermsOfService.vuesetup()もしくは<script setup>の中で呼び出す必要があるため、useHead/useSeoMetaの呼び出しをモジュールトップレベルからsetup()内に移動したDesktop.vueuseHeadではmacOS版 |のみを指定するようにした動作確認