From 0fe0db124e0ef5aff75ca16d771ce3f0eea140c6 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Thu, 13 Feb 2020 02:48:52 +0900
Subject: [PATCH] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=B3?=
 =?UTF-8?q?=E3=82=B9=E6=83=85=E5=A0=B1=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=A8?=
 =?UTF-8?q?Misskey=E6=83=85=E5=A0=B1=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92?=
 =?UTF-8?q?=E5=88=86=E9=9B=A2=E3=81=99=E3=82=8B=E3=81=AA=E3=81=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 locales/ja-JP.yml                       |  1 +
 src/client/app.vue                      |  9 ++-
 src/client/config.ts                    |  4 +-
 src/client/init.ts                      |  2 +-
 src/client/pages/about-misskey.vue      | 89 +++++++++++++++++++++++++
 src/client/pages/about.vue              | 55 ---------------
 src/client/pages/index.welcome.vue      |  4 +-
 src/client/router.ts                    |  1 +
 src/client/scripts/get-instance-name.ts |  8 ---
 9 files changed, 103 insertions(+), 70 deletions(-)
 create mode 100644 src/client/pages/about-misskey.vue
 delete mode 100644 src/client/scripts/get-instance-name.ts

diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 8f4c93701..71cbd5663 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -387,6 +387,7 @@ tapSecurityKey: "セキュリティーキーにタッチ"
 or: "もしくは"
 uiLanguage: "UIの表示言語"
 groupInvited: "グループに招待されました"
+aboutX: "{x}について"
 
 _ago:
   unknown: "謎"
diff --git a/src/client/app.vue b/src/client/app.vue
index 46b616519..c2e60c9bb 100644
--- a/src/client/app.vue
+++ b/src/client/app.vue
@@ -157,7 +157,7 @@ import { faBell, faEnvelope, faLaugh, faComments } from '@fortawesome/free-regul
 import { ResizeObserver } from '@juggle/resize-observer';
 import { v4 as uuid } from 'uuid';
 import i18n from './i18n';
-import { host } from './config';
+import { host, instanceName } from './config';
 import { search } from './scripts/search';
 import contains from './scripts/contains';
 import MkToast from './components/toast.vue';
@@ -481,9 +481,14 @@ export default Vue.extend({
 					icon: faQuestionCircle,
 				}, {
 					type: 'link',
-					text: this.$t('about'),
+					text: this.$t('aboutX', { x: instanceName || host }),
 					to: '/about',
 					icon: faInfoCircle,
+				}, {
+					type: 'link',
+					text: this.$t('aboutMisskey'),
+					to: '/about-misskey',
+					icon: faInfoCircle,
 				}],
 				align: 'left',
 				fixed: true,
diff --git a/src/client/config.ts b/src/client/config.ts
index 175a3f0b2..0d4a96964 100644
--- a/src/client/config.ts
+++ b/src/client/config.ts
@@ -3,7 +3,7 @@ declare const _VERSION_: string;
 declare const _ENV_: string;
 
 const address = new URL(location.href);
-const siteName = document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement;
+const siteName = (document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement)?.content;
 
 export const host = address.host;
 export const hostname = address.hostname;
@@ -15,4 +15,4 @@ export const langs = _LANGS_;
 export const locale = JSON.parse(localStorage.getItem('locale'));
 export const version = _VERSION_;
 export const env = _ENV_;
-export const instanceName = siteName && siteName.content ? siteName.content : 'Misskey';
+export const instanceName = siteName === 'Misskey' ? null : siteName;
diff --git a/src/client/init.ts b/src/client/init.ts
index a3953dcd0..b013637f7 100644
--- a/src/client/init.ts
+++ b/src/client/init.ts
@@ -149,7 +149,7 @@ os.init(async () => {
 		store: os.store,
 		metaInfo: {
 			title: null,
-			titleTemplate: title => title ? `${title} | ${instanceName}` : instanceName
+			titleTemplate: title => title ? `${title} | ${(instanceName || 'Misskey')}` : (instanceName || 'Misskey')
 		},
 		data() {
 			return {
diff --git a/src/client/pages/about-misskey.vue b/src/client/pages/about-misskey.vue
new file mode 100644
index 000000000..8eadd1abc
--- /dev/null
+++ b/src/client/pages/about-misskey.vue
@@ -0,0 +1,89 @@
+<template>
+<div class="znqjceqz">
+	<portal to="icon"><fa :icon="faInfoCircle"/></portal>
+	<portal to="title">{{ $t('aboutMisskey') }}</portal>
+
+	<section class="_card">
+		<div class="_title"><fa :icon="faInfoCircle"/> {{ $t('aboutMisskey') }}</div>
+		<div class="_content">
+			<div style="margin-bottom: 1em;">{{ $t('aboutMisskeyText') }}</div>
+			<div>{{ $t('misskeyMembers') }}</div>
+			<span class="members">
+				<a href="https://github.com/syuilo" target="_blank" class="_link">@syuilo</a>
+				<a href="https://github.com/AyaMorisawa" target="_blank" class="_link">@AyaMorisawa</a>
+				<a href="https://github.com/mei23" target="_blank" class="_link">@mei23</a>
+				<a href="https://github.com/acid-chicken" target="_blank" class="_link">@acid-chicken</a>
+				<a href="https://github.com/tamaina" target="_blank" class="_link">@tamaina</a>
+				<a href="https://github.com/rinsuki" target="_blank" class="_link">@rinsuki</a>
+			</span>
+			<div style="margin-top: 1em;">{{ $t('misskeySource') }}</div>
+			<mk-url url="https://github.com/syuilo/misskey"/>
+			<div style="margin-top: 1em;">{{ $t('misskeyTranslation') }}</div>
+			<mk-url url="https://crowdin.com/project/misskey"/>
+			<div style="margin-top: 1em;">{{ $t('misskeyDonate') }}</div>
+			<mk-url url="https://www.patreon.com/syuilo"/>
+		</div>
+		<div class="_content">
+			<span><mfm text="<motion>❤</motion>"/> {{ $t('patrons') }}</span>
+			<ul>
+				<li>Gargron</li>
+				<li>Satsuki Yanagi</li>
+				<li>noellabo</li>
+				<li>naga_rus</li>
+				<li>Melilot</li>
+				<li>AureoleArk</li>
+				<li>Peter G.</li>
+				<li>motcha</li>
+				<li>Atsuko Tominaga</li>
+				<li>dansup</li>
+				<li>Nokotaro Takeda</li>
+				<li>YUKIMOCHI</li>
+				<li>nanami kan</li>
+				<li>Hekovic</li>
+				<li>wara</li>
+				<li>Takashi Shibuya</li>
+				<li>Noizeman</li>
+			</ul>
+			<span>{{ $t('morePatrons') }}</span>
+		</div>
+	</section>
+</div>
+</template>
+
+<script lang="ts">
+import Vue from 'vue';
+import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
+import { version } from '../config';
+import i18n from '../i18n';
+
+export default Vue.extend({
+	i18n,
+
+	metaInfo() {
+		return {
+			title: this.$t('aboutMisskey') as string
+		};
+	},
+
+	data() {
+		return {
+			version,
+			faInfoCircle
+		}
+	},
+});
+</script>
+
+<style lang="scss" scoped>
+.znqjceqz {
+	> ._card {
+		> ._content {
+			> .members {
+				> a {
+					margin-right: 0.5em;
+				}
+			}
+		}
+	}
+}
+</style>
diff --git a/src/client/pages/about.vue b/src/client/pages/about.vue
index 45314a53f..e39600b48 100644
--- a/src/client/pages/about.vue
+++ b/src/client/pages/about.vue
@@ -20,51 +20,6 @@
 			<div><b>Misskey</b><span>v{{ version }}</span></div>
 		</div>
 	</section>
-
-	<section class="_card aboutMisskey">
-		<div class="_title"><fa :icon="faInfoCircle"/> {{ $t('aboutMisskey') }}</div>
-		<div class="_content">
-			<div style="margin-bottom: 1em;">{{ $t('aboutMisskeyText') }}</div>
-			<div>{{ $t('misskeyMembers') }}</div>
-			<span class="members">
-				<a href="https://github.com/syuilo" target="_blank" class="_link">@syuilo</a>
-				<a href="https://github.com/AyaMorisawa" target="_blank" class="_link">@AyaMorisawa</a>
-				<a href="https://github.com/mei23" target="_blank" class="_link">@mei23</a>
-				<a href="https://github.com/acid-chicken" target="_blank" class="_link">@acid-chicken</a>
-				<a href="https://github.com/tamaina" target="_blank" class="_link">@tamaina</a>
-				<a href="https://github.com/rinsuki" target="_blank" class="_link">@rinsuki</a>
-			</span>
-			<div style="margin-top: 1em;">{{ $t('misskeySource') }}</div>
-			<mk-url url="https://github.com/syuilo/misskey"/>
-			<div style="margin-top: 1em;">{{ $t('misskeyTranslation') }}</div>
-			<mk-url url="https://crowdin.com/project/misskey"/>
-			<div style="margin-top: 1em;">{{ $t('misskeyDonate') }}</div>
-			<mk-url url="https://www.patreon.com/syuilo"/>
-		</div>
-		<div class="_content">
-			<span><mfm text="<motion>❤</motion>"/> {{ $t('patrons') }}</span>
-			<ul>
-				<li>Gargron</li>
-				<li>Satsuki Yanagi</li>
-				<li>noellabo</li>
-				<li>naga_rus</li>
-				<li>Melilot</li>
-				<li>AureoleArk</li>
-				<li>Peter G.</li>
-				<li>motcha</li>
-				<li>Atsuko Tominaga</li>
-				<li>dansup</li>
-				<li>Nokotaro Takeda</li>
-				<li>YUKIMOCHI</li>
-				<li>nanami kan</li>
-				<li>Hekovic</li>
-				<li>wara</li>
-				<li>Takashi Shibuya</li>
-				<li>Noizeman</li>
-			</ul>
-			<span>{{ $t('morePatrons') }}</span>
-		</div>
-	</section>
 </div>
 </template>
 
@@ -119,15 +74,5 @@ export default Vue.extend({
 			}
 		}
 	}
-
-	> .aboutMisskey {
-		> ._content {
-			> .members {
-				> a {
-					margin-right: 0.5em;
-				}
-			}
-		}
-	}
 }
 </style>
diff --git a/src/client/pages/index.welcome.vue b/src/client/pages/index.welcome.vue
index 21fc0c3ab..fb4aba658 100644
--- a/src/client/pages/index.welcome.vue
+++ b/src/client/pages/index.welcome.vue
@@ -10,7 +10,7 @@
 import Vue from 'vue';
 import XSetup from './index.welcome.setup.vue';
 import XEntrance from './index.welcome.entrance.vue';
-import { getInstanceName } from '../scripts/get-instance-name';
+import { instanceName } from '../config';
 
 export default Vue.extend({
 	components: {
@@ -20,7 +20,7 @@ export default Vue.extend({
 
 	data() {
 		return {
-			instanceName: getInstanceName(),
+			instanceName: instanceName || 'Misskey',
 		}
 	},
 
diff --git a/src/client/router.ts b/src/client/router.ts
index a8b74b2ea..a226cc973 100644
--- a/src/client/router.ts
+++ b/src/client/router.ts
@@ -20,6 +20,7 @@ export const router = new VueRouter({
 		{ path: '/@:user/pages/:pageName/view-source', component: page('page-editor/page-editor'), props: route => ({ initUser: route.params.user, initPageName: route.params.pageName }) },
 		{ path: '/announcements', component: page('announcements') },
 		{ path: '/about', component: page('about') },
+		{ path: '/about-misskey', component: page('about-misskey') },
 		{ path: '/featured', component: page('featured') },
 		{ path: '/docs', component: page('docs') },
 		{ path: '/docs/:doc', component: page('doc'), props: true },
diff --git a/src/client/scripts/get-instance-name.ts b/src/client/scripts/get-instance-name.ts
deleted file mode 100644
index b12a3a4c6..000000000
--- a/src/client/scripts/get-instance-name.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export function getInstanceName() {
-	const siteName = document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement;
-	if (siteName && siteName.content) {
-		return siteName.content;
-	}
-
-	return 'Misskey';
-}