junjiro1129 commited on
Commit
80f405c
·
verified ·
1 Parent(s): dcbee4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -58,9 +58,16 @@ templates_file = st.file_uploader("Upload templates.json", type=["json"])
58
 
59
  # 例: サイドバーにヘッダー付きで置く
60
  st.sidebar.header("Utilities")
 
 
 
 
 
 
 
 
61
  st.sidebar.markdown(
62
- '<a href="./+/coordinatemaker.html" target="_blank">'
63
- 'When you make templates.json file.Open Coordinate Maker ↗</a>',
64
  unsafe_allow_html=True
65
  )
66
 
 
58
 
59
  # 例: サイドバーにヘッダー付きで置く
60
  st.sidebar.header("Utilities")
61
+
62
+ # 1) Space のリポ ID は環境変数 HF_SPACE_ID に入っています
63
+ repo_id = os.getenv("HF_SPACE_ID", "junjiro1129/mockjet_web")
64
+
65
+ # 2) resolve/main 形式で HTML ファイルの直リンクを組み立て
66
+ coord_url = f"https://huggingface.co/spaces/{repo_id}/resolve/main/coordinatemaker.html"
67
+
68
+ # 3) クリックで別タブを開く Markdown リンクを貼る
69
  st.sidebar.markdown(
70
+ f'<a href="{coord_url}" target="_blank">🗺️'When you make templates.json file.Open Coordinate Maker ↗</a>',
 
71
  unsafe_allow_html=True
72
  )
73