feat: 共通サイドメニューおよびヘッダー・共通JSにギャザクラ総合攻略・育成メニューを追加
This commit is contained in:
1 parent
6d752556d7
commit
a20cd7a783
4 files changed
+49
-4
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
with open('common/js/wiki_common.js', 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
# 1. globalNav に追加(まだなければ)
|
||||
if "{ title: '🔨 ギャザクラ完全攻略', path: 'crafter_gatherer/index.html' }" not in content:
|
||||
target_gnav = "{ title: '🐎 マウント完全攻略', path: 'mounts/index.html' },"
|
||||
replace_gnav = "{ title: '🐎 マウント完全攻略', path: 'mounts/index.html' },\n { title: '🔨 ギャザクラ完全攻略', path: 'crafter_gatherer/index.html' },"
|
||||
if target_gnav in content:
|
||||
content = content.replace(target_gnav, replace_gnav, 1)
|
||||
print("Updated globalNav")
|
||||
|
||||
# 2. sidebar のメインメニューに追加(まだなければ)
|
||||
if "{ text: '🔨 ギャザクラ総合攻略・育成', path: 'crafter_gatherer/index.html' }" not in content:
|
||||
target_sb = "{ text: '🐎 マウント総合・全一覧', path: 'mounts/index.html' },"
|
||||
replace_sb = "{ text: '🐎 マウント総合・全一覧', path: 'mounts/index.html' },\n { text: '🔨 ギャザクラ総合攻略・育成', path: 'crafter_gatherer/index.html' },"
|
||||
if target_sb in content:
|
||||
content = content.replace(target_sb, replace_sb, 1)
|
||||
print("Updated sidebar main menu")
|
||||
|
||||
with open('common/js/wiki_common.js', 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
print("Saved common/js/wiki_common.js")
|
||||
Reference in new issue
Block a user