mirror of
https://github.com/yude-jp/yude.jp
synced 2024-12-22 12:10:11 +09:00
Compare commits
9 Commits
c856a34867
...
24327251ee
Author | SHA1 | Date | |
---|---|---|---|
24327251ee | |||
1f7456db3c | |||
a8321b6c60 | |||
ff98956a10 | |||
db6855fbc6 | |||
b446a2ebae | |||
86844984d2 | |||
a72a778a03 | |||
d9559dd072 |
@ -1,5 +0,0 @@
|
||||
SPOTIFY_CLIENT_ID=
|
||||
SPOTIFY_CLIENT_SECRET=
|
||||
SPOTIFY_REFRESH_TOKEN=
|
||||
|
||||
MICROCMS_API_KEY=
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,3 +13,4 @@ yarn-error.log
|
||||
.env.local
|
||||
out
|
||||
.vercel
|
||||
.DS_Store
|
||||
|
@ -6,11 +6,8 @@ Source code of [yude.jp](https://yude.jp).\
|
||||
Built with [Next.js](https://nextjs.org/) and [Tailwind CSS](https://tailwindcss.com/) and deployed on [Vercel](https://vercel.com).
|
||||
|
||||
## Development
|
||||
### Setup
|
||||
1. Run `yarn`.
|
||||
1. Copy `.env.local.sample` as `.env.local` and set value.
|
||||
### Preview
|
||||
* Run `yarn dev`.
|
||||
1. Run `yarn` to install dependencies.
|
||||
2. Run `yarn dev` to serve.
|
||||
|
||||
## License
|
||||
This repository is provided under the MIT License.
|
||||
|
15
i18n.json
15
i18n.json
@ -1,15 +0,0 @@
|
||||
{
|
||||
"locales": ["en", "ja"],
|
||||
"defaultLocale": "ja",
|
||||
"pages": {
|
||||
"*": ["common"],
|
||||
"/": ["index", "minecraft", "common"],
|
||||
"/profile": ["profile", "common"],
|
||||
"/server": ["server", "common"],
|
||||
"/house": ["house", "common"],
|
||||
"/tos": ["tos", "common"],
|
||||
"/hcunews": ["hcunews", "common"],
|
||||
"/minecraft": ["minecraft", "common"],
|
||||
"/404": ["404", "common"]
|
||||
}
|
||||
}
|
12
i18n/index.js
Normal file
12
i18n/index.js
Normal file
@ -0,0 +1,12 @@
|
||||
var ja = require('./translations.ja.json');
|
||||
var en = require('./translations.en.json')
|
||||
|
||||
const i18n = {
|
||||
translations: {
|
||||
ja: ja,
|
||||
en: en,
|
||||
},
|
||||
defaultLang: 'ja'
|
||||
}
|
||||
|
||||
module.exports = i18n;
|
64
i18n/translations.en.json
Normal file
64
i18n/translations.en.json
Normal file
@ -0,0 +1,64 @@
|
||||
{
|
||||
"caption": "The requested page does not exist on this website.",
|
||||
"return": "Return to top",
|
||||
"footer": "This page is provided under the MIT License.",
|
||||
"source": "Source code",
|
||||
"tos": "yude.jp Terms of Service",
|
||||
"yes_playing": "Playing {{playing}}",
|
||||
"listening": "Listening to {{listening}}",
|
||||
"close": "Close",
|
||||
"mutual": "Mutual links",
|
||||
"status": "Service Status",
|
||||
"icon_1": "Icon: ",
|
||||
"icon_2": " ",
|
||||
"post_list": "Posts listing",
|
||||
"hcunews": "About @hcunews",
|
||||
"house": "yude's house",
|
||||
"home": "Home",
|
||||
"profile": "yude's profile",
|
||||
"blog": "yude's blog",
|
||||
"status": "yude.jp Server Status",
|
||||
"house": "yude's house",
|
||||
"discord": "yude.jp Discord Server",
|
||||
"mastodon": "Mastodon instance",
|
||||
"title": "Minecraft Multiplayer",
|
||||
"playing": "{{count}} player(s) online.",
|
||||
"no_one": "No one is playing.",
|
||||
"offline": "Server is down.",
|
||||
"address": "Server address",
|
||||
"fail": "Failed to retrieve server status.",
|
||||
"loading": "Retrieving server status...",
|
||||
"version": "Version",
|
||||
"about": "About yude",
|
||||
"desc": "Description",
|
||||
"school": "Faculty of Information Science, Hiroshima City University.",
|
||||
"hiroshima": "Hiroshima, Japan",
|
||||
"location": "Location",
|
||||
"link": "Links",
|
||||
"link_all": "To see all of yude's account, please visit ",
|
||||
"link_all_late": ".",
|
||||
"here": "here",
|
||||
"mail": "E-mail",
|
||||
"birth": "Birthday",
|
||||
"date": "November the 19th, 2001",
|
||||
"contact": "Accounts",
|
||||
"belongs": "Organization",
|
||||
"grade": "B2",
|
||||
"keys": "Public keys",
|
||||
"download": "Download",
|
||||
"fingerprint": "Digital fingerprint",
|
||||
"view": "View",
|
||||
"device": "Devices",
|
||||
"account": "Accounts",
|
||||
"wishlist": "Amazon Wishlist",
|
||||
"status": "Server Status",
|
||||
"location": "Location",
|
||||
"tottori": "Tottori, Japan",
|
||||
"hiroshima": "Hiroshima, Japan",
|
||||
"model": "Model",
|
||||
"region": "Region",
|
||||
"service": "Service",
|
||||
"shape": "Shape",
|
||||
"tos": "yude.jp Terms of Service",
|
||||
"input": "en"
|
||||
}
|
64
i18n/translations.ja.json
Normal file
64
i18n/translations.ja.json
Normal file
@ -0,0 +1,64 @@
|
||||
{
|
||||
"caption": "要求されたページはこのウェブサイト上に存在しません。",
|
||||
"return": "トップページへ戻る",
|
||||
"footer": "このページは MIT License のもと提供されています。",
|
||||
"source": "ソースコード",
|
||||
"tos": "yude.jp サービス利用規約",
|
||||
"yes_playing": "{{playing}} をプレイ中",
|
||||
"listening": "{{listening}} を再生中",
|
||||
"close": "閉じる",
|
||||
"mutual": "相互リンク",
|
||||
"status": "サービスの状態",
|
||||
"icon_1": "アイコン: ",
|
||||
"icon_2": "さん",
|
||||
"post_list": "記事一覧",
|
||||
"hcunews": "@hcunews について",
|
||||
"house": "ゆでハウス",
|
||||
"home": "ホーム",
|
||||
"profile": "yude のプロフィール",
|
||||
"blog": "yude のブログ",
|
||||
"status": "yude.jp サーバー情報",
|
||||
"house": "ゆでハウス",
|
||||
"discord": "yude.jp Discord サーバー",
|
||||
"mastodon": "Mastodon インスタンス",
|
||||
"title": "Minecraft マルチプレイ",
|
||||
"playing": "{{count}} 人がプレイしています。",
|
||||
"no_one": "現在、誰もログインしていません。",
|
||||
"offline": "サーバーがオフラインのようです。",
|
||||
"address": "サーバー アドレス",
|
||||
"fail": "サーバーの状態を取得できませんでした。",
|
||||
"loading": "サーバーの状態を取得しています...",
|
||||
"version": "バージョン",
|
||||
"about": "yude について",
|
||||
"desc": "概要",
|
||||
"school": "広島市立大学 情報科学部",
|
||||
"hiroshima": "日本, 広島県",
|
||||
"location": "所在地",
|
||||
"link": "リンク",
|
||||
"link_all": "yude が所持しているすべてのアカウントの一覧は、",
|
||||
"link_all_late": "にあります。",
|
||||
"here": "こちら",
|
||||
"mail": "メール",
|
||||
"birth": "生年月日",
|
||||
"date": "2001年11月19日",
|
||||
"contact": "アカウント",
|
||||
"belongs": "所属",
|
||||
"grade": "2年",
|
||||
"keys": "公開鍵",
|
||||
"download": "ダウンロード",
|
||||
"fingerprint": "電子指紋",
|
||||
"view": "閲覧",
|
||||
"device": "デバイス",
|
||||
"account": "アカウント",
|
||||
"wishlist": "Amazon ほしいものリスト",
|
||||
"status": "サーバー情報",
|
||||
"location": "場所",
|
||||
"tottori": "日本, 鳥取県",
|
||||
"hiroshima": "日本, 広島県",
|
||||
"model": "モデル",
|
||||
"region": "リージョン",
|
||||
"service": "サービス",
|
||||
"shape": "シェイプ",
|
||||
"tos": "yude.jp サービス利用規約",
|
||||
"input": "ja"
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
import { createClient } from 'microcms-js-sdk';
|
||||
|
||||
export const client = createClient({
|
||||
serviceDomain: 'yude',
|
||||
apiKey: process.env.MICROCMS_API_KEY,
|
||||
});
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"caption": "The requested page does not exist on this website.",
|
||||
"return": "Return to top"
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
{
|
||||
"footer": "This page is provided under the MIT License.",
|
||||
"source": "Source code",
|
||||
"tos": "yude.jp Terms of Service",
|
||||
"yes_playing": "Playing {{playing}}",
|
||||
"listening": "Listening to {{listening}}",
|
||||
"close": "Close",
|
||||
"mutual": "Mutual links",
|
||||
"status": "Service Status",
|
||||
"icon_1": "Icon: ",
|
||||
"icon_2": "",
|
||||
"post_list": "Posts listing"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"hcunews": "About @hcunews"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"house": "yude's house"
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"home": "Home",
|
||||
"profile": "yude's profile",
|
||||
"blog": "yude's blog",
|
||||
"status": "yude.jp Server Status",
|
||||
"house": "yude's house",
|
||||
"discord": "yude.jp Discord Server",
|
||||
"mastodon": "Mastodon instance"
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"title": "Minecraft Multiplayer",
|
||||
"playing": "{{count}} player(s) online.",
|
||||
"no_one": "No one is playing.",
|
||||
"offline": "Server is down.",
|
||||
"address": "Server address",
|
||||
"fail": "Failed to retrieve server status.",
|
||||
"loading": "Retrieving server status...",
|
||||
"version": "Version"
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
{
|
||||
"about": "About yude",
|
||||
"desc": "Description",
|
||||
"school": "Faculty of Information Science, Hiroshima City University.",
|
||||
"hiroshima": "Hiroshima, Japan",
|
||||
"location": "Location",
|
||||
"link": "Links",
|
||||
"link_all": "To see all of yude's account, please visit ",
|
||||
"link_all_late": ".",
|
||||
"here": "here",
|
||||
"mail": "E-mail",
|
||||
"birth": "Birthday",
|
||||
"date": "November the 19th, 2001",
|
||||
"contact": "Accounts",
|
||||
"belongs": "Organization",
|
||||
"grade": "B2",
|
||||
"keys": "Public keys",
|
||||
"download": "Download",
|
||||
"fingerprint": "Digital fingerprint",
|
||||
"view": "View",
|
||||
"device": "Devices",
|
||||
"account": "Accounts",
|
||||
"wishlist": "Amazon Wishlist"
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"status": "Server Status",
|
||||
"location": "Location",
|
||||
"tottori": "Tottori, Japan",
|
||||
"hiroshima": "Hiroshima, Japan",
|
||||
"model": "Model",
|
||||
"region": "Region",
|
||||
"service": "Service",
|
||||
"shape": "Shape"
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"tos": "yude.jp Terms of Service",
|
||||
"input": "en"
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"caption": "要求されたページはこのウェブサイト上に存在しません。",
|
||||
"return": "トップページへ戻る"
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
{
|
||||
"footer": "このページは MIT License のもと提供されています。",
|
||||
"source": "ソースコード",
|
||||
"tos": "yude.jp サービス利用規約",
|
||||
"yes_playing": "{{playing}} をプレイ中",
|
||||
"listening": "{{listening}} を再生中",
|
||||
"close": "閉じる",
|
||||
"mutual": "相互リンク",
|
||||
"status": "サービスの状態",
|
||||
"icon_1": "アイコン: ",
|
||||
"icon_2": "さん",
|
||||
"post_list": "記事一覧"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"hcunews": "@hcunews について"
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"house": "ゆでハウス"
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"home": "ホーム",
|
||||
"profile": "yude のプロフィール",
|
||||
"blog": "yude のブログ",
|
||||
"status": "yude.jp サーバー情報",
|
||||
"house": "ゆでハウス",
|
||||
"discord": "yude.jp Discord サーバー",
|
||||
"mastodon": "Mastodon インスタンス"
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"title": "Minecraft マルチプレイ",
|
||||
"playing": "{{count}} 人がプレイしています。",
|
||||
"no_one": "現在、誰もログインしていません。",
|
||||
"offline": "サーバーがオフラインのようです。",
|
||||
"address": "サーバー アドレス",
|
||||
"fail": "サーバーの状態を取得できませんでした。",
|
||||
"loading": "サーバーの状態を取得しています...",
|
||||
"version": "バージョン"
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
{
|
||||
"about": "yude について",
|
||||
"desc": "概要",
|
||||
"school": "広島市立大学 情報科学部",
|
||||
"hiroshima": "日本, 広島県",
|
||||
"location": "所在地",
|
||||
"link": "リンク",
|
||||
"link_all": "yude が所持しているすべてのアカウントの一覧は、",
|
||||
"link_all_late": "にあります。",
|
||||
"here": "こちら",
|
||||
"mail": "メール",
|
||||
"birth": "生年月日",
|
||||
"date": "2001年11月19日",
|
||||
"contact": "アカウント",
|
||||
"belongs": "所属",
|
||||
"grade": "2年",
|
||||
"keys": "公開鍵",
|
||||
"download": "ダウンロード",
|
||||
"fingerprint": "電子指紋",
|
||||
"view": "閲覧",
|
||||
"device": "デバイス",
|
||||
"account": "アカウント",
|
||||
"wishlist": "Amazon ほしいものリスト"
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"status": "サーバー情報",
|
||||
"location": "場所",
|
||||
"tottori": "日本, 鳥取県",
|
||||
"hiroshima": "日本, 広島県",
|
||||
"model": "モデル",
|
||||
"region": "リージョン",
|
||||
"service": "サービス",
|
||||
"shape": "シェイプ"
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"tos": "yude.jp サービス利用規約",
|
||||
"input": "ja"
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
const nextTranslate = require('next-translate')
|
||||
|
||||
const rewrites = async () => {
|
||||
return [
|
||||
{
|
||||
@ -13,11 +11,7 @@ const rewrites = async () => {
|
||||
]
|
||||
}
|
||||
|
||||
module.exports = nextTranslate({
|
||||
i18n: {
|
||||
locales: ['ja', 'en'],
|
||||
defaultLocale: 'ja',
|
||||
},
|
||||
module.exports = {
|
||||
images: {
|
||||
domains: ['mackerel.io', 'mc-heads.net', 'crafatar.com'],
|
||||
},
|
||||
@ -43,4 +37,4 @@ module.exports = nextTranslate({
|
||||
]
|
||||
},
|
||||
rewrites,
|
||||
})
|
||||
}
|
@ -31,12 +31,12 @@
|
||||
"autoprefixer": "^10.3.4",
|
||||
"axios": "^0.21.4",
|
||||
"date-fns": "^2.24.0",
|
||||
"microcms-js-sdk": "^1.2.0",
|
||||
"moment": "^2.29.1",
|
||||
"next": "^11.1.3",
|
||||
"next-export-i18n": "^1.2.1",
|
||||
"next-seo": "^4.28.1",
|
||||
"next-themes": "^0.0.15",
|
||||
"next-translate": "^1.1.0",
|
||||
"next-translate": "^1.2.0",
|
||||
"popper.js": "^1.16.1",
|
||||
"postcss": "^8.3.6",
|
||||
"prop-types": "^15.7.2",
|
||||
|
29
pages/404.js
29
pages/404.js
@ -1,29 +0,0 @@
|
||||
// Base layout
|
||||
import Layout from "./components/Layout"
|
||||
|
||||
// React Router
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// Next.js
|
||||
import Link from 'next/link'
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
|
||||
export default function Custom404(props) {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("404")
|
||||
|
||||
return (
|
||||
<Layout title="404">
|
||||
<div className="text-center mb-10 mt-10">
|
||||
<p className="text-3xl">404</p>
|
||||
<p className="text-xl">{t('caption')}</p>
|
||||
<Link href="/">
|
||||
<a>
|
||||
<p className="mt-5">{t('return')}</p>
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</Layout>
|
||||
)
|
||||
}
|
@ -1,12 +1,13 @@
|
||||
// React
|
||||
import React, { useState, useEffect } from 'react';
|
||||
|
||||
// Data fetching
|
||||
import axios from 'axios';
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery } from 'next-export-i18n';
|
||||
|
||||
function App (){
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("common")
|
||||
const [data, setData] = useState({ hits: [] });
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
|
@ -1,4 +1,7 @@
|
||||
// React
|
||||
import React, { useState, useEffect } from 'react';
|
||||
|
||||
// Data fetching
|
||||
import axios from 'axios';
|
||||
|
||||
const App = () => {
|
||||
|
@ -1,13 +1,15 @@
|
||||
// Tailwind CSS
|
||||
import "tailwindcss/tailwind.css";
|
||||
|
||||
// Next.js
|
||||
import Link from 'next/link';
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery } from 'next-export-i18n';
|
||||
|
||||
export default function Footer(props) {
|
||||
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("common")
|
||||
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
return (
|
||||
<>
|
||||
<div className="container mx-auto px-6">
|
||||
|
@ -1,14 +1,14 @@
|
||||
import React from "react";
|
||||
import Popper from "popper.js";
|
||||
import { useRouter } from 'next/router'
|
||||
import Link from 'next/link';
|
||||
import { faLanguage } from '@fortawesome/free-solid-svg-icons'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
|
||||
const Dropdown = ({ color }) => {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
|
||||
|
||||
|
||||
const Dropdown = ({ color }) => {
|
||||
// dropdown props
|
||||
const [dropdownPopoverShow, setDropdownPopoverShow] = React.useState(false);
|
||||
const btnDropdownRef = React.createRef();
|
||||
@ -48,12 +48,12 @@ const Dropdown = ({ color }) => {
|
||||
<div ref={popoverDropdownRef} className={
|
||||
(dropdownPopoverShow ? "block " : "hidden ") + "z-10 origin-top-right absolute right-0 mt-2 w-40 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 dark:bg-gray-700"}>
|
||||
<div className="py-1" role="menu" aria-orientation="vertical" aria-labelledby="options-menu">
|
||||
<Link href="#" locale="ja">
|
||||
<LanguageSwitcher lang="ja">
|
||||
<a href="#" className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-700 dark:text-white dark:hover:bg-gray-800" role="menuitem">日本語</a>
|
||||
</Link>
|
||||
<Link href="#" locale="en">
|
||||
</LanguageSwitcher>
|
||||
<LanguageSwitcher lang="en">
|
||||
<a href="#" className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-700 dark:text-white dark:hover:bg-gray-800" role="menuitem">English</a>
|
||||
</Link>
|
||||
</LanguageSwitcher>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,21 +1,19 @@
|
||||
// Next.js
|
||||
import Head from "next/head"
|
||||
|
||||
// Tailwind CSS
|
||||
import "tailwindcss/tailwind.css";
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// React
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
// Components
|
||||
import Footer from "./Footer/Footer"
|
||||
import Navbar from "./Navbar"
|
||||
|
||||
const Layout = (props) => {
|
||||
const { title, children } = props
|
||||
const siteTitle = "yude.jp"
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
|
||||
const { t, lang } = useTranslation("common")
|
||||
const footer = t('footer')
|
||||
const source = t('source')
|
||||
const tos = t('tos')
|
||||
return (
|
||||
<div className="page">
|
||||
<Head>
|
||||
|
@ -5,11 +5,11 @@ import Link from 'next/link'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
|
||||
const FontAwesomeMenu = (props) => {
|
||||
const { icon, dest } = props
|
||||
const { icon, dest, query } = props
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Link href={`${dest}`}>
|
||||
<Link href={{ pathname: dest, query: query }}>
|
||||
<a>
|
||||
<FontAwesomeIcon icon={icon} className="w-10 h-10 fill-current inline transition duration-200 ease-in-out transform hover:-translate-y-1 hover:scale-110" />
|
||||
</a>
|
||||
|
@ -1,10 +1,15 @@
|
||||
// Next.js
|
||||
import Link from 'next/link'
|
||||
|
||||
const MinecraftMenu = () => {
|
||||
const MinecraftMenu = (props) => {
|
||||
const { query } = props
|
||||
|
||||
if (!query) {
|
||||
return <p>Loading...</p>
|
||||
} else {
|
||||
return (
|
||||
<div>
|
||||
<Link href="/minecraft">
|
||||
<Link href={{ pathname: "/minecraft", query: query }}>
|
||||
<a>
|
||||
<svg className="fill-current text-black dark:text-white w-10 h-10 inline transition duration-200 ease-in-out transform hover:-translate-y-1 hover:scale-110" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 304.8 304.8">
|
||||
<path d="M 39.10262 126.138 L 39.16748 12.39574 L 152.7982 12.33506 L 266.4289 12.27438 L 266.4289 126.0773 L 266.4289 239.8803 L 152.7333 239.8803 L 39.03775 239.8803 L 39.10262 126.138 Z M 260.4857 126.0776 L 260.4857 18.55703 L 152.8628 18.55703 L 45.23985 18.55703 L 45.23985 126.0776 L 45.23985 233.5982 L 152.8628 233.5982 L 260.4857 233.5982 L 260.4857 126.0776 Z M 103.8963 162.9245 L 103.8963 126.0776 L 116.1702 126.0776 L 128.4441 126.0776 L 128.4441 113.8758 L 128.4441 101.674 L 152.8628 101.674 L 177.2814 101.674 L 177.2814 113.8758 L 177.2814 126.0776 L 189.3835 126.0776 L 201.4856 126.0776 L 201.6573 150.5415 C 201.7517 163.9967 201.829 180.5779 201.8291 187.3885 L 201.8293 199.7715 L 189.6869 199.7715 L 177.5446 199.7715 L 177.4776 187.5093 L 177.4106 175.2471 L 152.7982 175.1855 L 128.1857 175.1239 L 128.1857 187.4477 L 128.1857 199.7715 L 116.041 199.7715 L 103.8963 199.7715 L 103.8963 162.9245 Z M 79.34843 77.02888 L 79.34843 52.62534 L 103.7671 52.62534 L 128.1857 52.62534 L 128.1857 77.02888 L 128.1857 101.4324 L 103.7671 101.4324 L 79.34843 101.4324 L 79.34843 77.02888 Z M 177.5398 77.02888 L 177.5398 52.62534 L 201.9585 52.62534 L 226.3771 52.62534 L 226.3771 77.02888 L 226.3771 101.4324 L 201.9585 101.4324 L 177.5398 101.4324 L 177.5398 77.02888 Z"/>
|
||||
@ -14,5 +19,6 @@ const MinecraftMenu = () => {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default MinecraftMenu
|
@ -1,15 +1,16 @@
|
||||
// React
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery } from 'next-export-i18n';
|
||||
|
||||
import axios from 'axios';
|
||||
import Image from 'next/image'
|
||||
import { list } from 'postcss';
|
||||
|
||||
export default function Minecraft(props) {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("minecraft")
|
||||
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
const [data, setData] = useState({ hits: [] });
|
||||
|
||||
useEffect(() => {
|
||||
@ -25,7 +26,7 @@ export default function Minecraft(props) {
|
||||
if (data === undefined){
|
||||
console.log("[Minecraft Query] データの取得に失敗しました。 / Failed to retrieve data.")
|
||||
return (
|
||||
<p>{t('minecraft:fail')}</p>
|
||||
<p>{t('fail')}</p>
|
||||
)
|
||||
}else{
|
||||
const status = data.online
|
||||
@ -36,13 +37,13 @@ export default function Minecraft(props) {
|
||||
{(() => {
|
||||
if (status == true) {
|
||||
if (player == undefined || player == 0) {
|
||||
return <span>{t('minecraft:no_one')}</span>
|
||||
return <span>{t('no_one')}</span>
|
||||
} else {
|
||||
return <span>{t('minecraft:playing', {count: player})}</span>
|
||||
return <span>{t('playing', {count: player})}</span>
|
||||
}}else if (status == false) {
|
||||
return <span>{t('minecraft:offline')}</span>
|
||||
return <span>{t('offline')}</span>
|
||||
}else {
|
||||
return <span>{t('minecraft:loading')}</span>
|
||||
return <span>{t('loading')}</span>
|
||||
}
|
||||
})()}
|
||||
|
||||
|
@ -1,14 +1,19 @@
|
||||
// React
|
||||
import React, { useState, useEffect } from 'react';
|
||||
|
||||
// Data fetching
|
||||
import axios from 'axios';
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery } from 'next-export-i18n';
|
||||
|
||||
// Components
|
||||
import LastPlayed from './LastPlayed'
|
||||
|
||||
function App (props) {
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
const uuid = props;
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("common")
|
||||
const [data, setData] = useState({ hits: [] });
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -1,4 +1,7 @@
|
||||
// React
|
||||
import React, { useState, useEffect } from 'react';
|
||||
|
||||
// Data fetching
|
||||
import axios from 'axios';
|
||||
|
||||
function App (props) {
|
||||
|
@ -1,13 +1,24 @@
|
||||
// Tailwind CSS
|
||||
import "tailwindcss/tailwind.css";
|
||||
|
||||
// Next.js
|
||||
import Link from 'next/link';
|
||||
|
||||
// Components
|
||||
import LangSelector from "./LangSelector"
|
||||
import ThemeSelector from "./ThemeSelector"
|
||||
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
|
||||
|
||||
const Navbar = () => {
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
return (
|
||||
<>
|
||||
<nav className='flex items-center flex-wrap p-3'>
|
||||
<Link href='/'>
|
||||
<Link href={{ pathname: '/', query: query }}>
|
||||
<a className='inline-flex items-center p-2'>
|
||||
<span className='text-xl text-black font-bold tracking-wide dark:text-white font-mono animate-heartbeat'>
|
||||
yude.jp
|
||||
|
@ -7,7 +7,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
const Button = (props) => {
|
||||
const { icon, dest, caption } = props
|
||||
return (
|
||||
<Link href={`${dest}`}>
|
||||
<Link href={{ pathname: dest }}>
|
||||
<a>
|
||||
<button
|
||||
className="bg-pink-600 text-white active:bg-pink-600 mt-3 font-bold text-sm px-6 py-3 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150"
|
||||
|
@ -8,7 +8,7 @@ const Contact = (props) => {
|
||||
const { icon, dest, caption } = props
|
||||
return (
|
||||
<div className="hover:underline">
|
||||
<Link href={`${dest}`}>
|
||||
<Link href={{ pathname: dest }}>
|
||||
<a>
|
||||
<FontAwesomeIcon icon={icon} className="w-7 h-7 inline lg:w-10 lg:h-10 md:w-7 md:h-7"/>
|
||||
<p className="font-mono text-xl">{caption}</p>
|
||||
|
@ -1,20 +1,20 @@
|
||||
// React
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery } from 'next-export-i18n';
|
||||
|
||||
// Font Awesome
|
||||
import { faKey, faEye, faDownload } from '@fortawesome/free-solid-svg-icons'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// Next.js
|
||||
import Link from 'next/link'
|
||||
|
||||
export default function Modal() {
|
||||
const [showModal, setShowModal] = React.useState(false);
|
||||
const router = useRouter()
|
||||
const { t, lang } = useTranslation("common")
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const close = t('common:close')
|
||||
const keys = t('profile:keys')
|
||||
const view = t('profile:view')
|
||||
const fingerprint = t('profile:fingerprint')
|
||||
const download = t('profile:download')
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -23,7 +23,7 @@ export default function Modal() {
|
||||
type="button"
|
||||
onClick={() => setShowModal(true)}
|
||||
>
|
||||
<FontAwesomeIcon icon={faKey} className="w-5 h-5 inline"/> {keys}
|
||||
<FontAwesomeIcon icon={faKey} className="w-5 h-5 inline"/> {t('keys')}
|
||||
</button>
|
||||
{showModal ? (
|
||||
<>
|
||||
@ -36,17 +36,17 @@ export default function Modal() {
|
||||
{/* Modal body */}
|
||||
<div className="relative p-2 flex-auto text-black text-left">
|
||||
|
||||
<p className="text-2xl"><FontAwesomeIcon icon={faKey} className="w-5 h-5 inline"/> {keys}</p>
|
||||
<p className="text-2xl"><FontAwesomeIcon icon={faKey} className="w-5 h-5 inline"/> {t('keys')}</p>
|
||||
<ul className="list-disc my-2">
|
||||
<li>
|
||||
<span className="font-bold">PGP </span>
|
||||
<Link href="/yudejp.gpg">
|
||||
<a className="hover:underline">
|
||||
<FontAwesomeIcon icon={faDownload} className="w-5 h-5 inline"/>
|
||||
{download}
|
||||
{t('download')}
|
||||
</a>
|
||||
</Link>
|
||||
<p>{fingerprint}:</p>
|
||||
<p>{t('fingerprint')}:</p>
|
||||
<div className="overflow-x-auto">
|
||||
<div className="whitespace-nowrap">
|
||||
<code>3745 F270 DB4E 8975 6B07 62BE EB0F E5D9 25C4 A968</code>
|
||||
@ -58,10 +58,10 @@ export default function Modal() {
|
||||
<Link href="https://github.com/yude.keys">
|
||||
<a className="hover:underline">
|
||||
<FontAwesomeIcon icon={faEye} className="w-5 h-5 inline"/>
|
||||
{view}
|
||||
{t('view')}
|
||||
</a>
|
||||
</Link>
|
||||
<p>{fingerprint}:</p>
|
||||
<p>{t('fingerprint')}:</p>
|
||||
<div className="overflow-x-auto">
|
||||
<div className="whitespace-nowrap">
|
||||
<code>2048 SHA256:xwSL4DORWmroWdC6P0GU1m1yZl/cXqjo9rCCWqqO+Dc</code>
|
||||
@ -78,7 +78,7 @@ export default function Modal() {
|
||||
type="button"
|
||||
onClick={() => setShowModal(false)}
|
||||
>
|
||||
{close}
|
||||
{t('close')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,12 +1,16 @@
|
||||
// React
|
||||
import React, { useState, useEffect } from 'react';
|
||||
|
||||
// Data fetching
|
||||
import axios from 'axios';
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery } from 'next-export-i18n';
|
||||
|
||||
function App () {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("common")
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
const [data, setData] = useState({ hits: [] });
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
|
@ -1,15 +1,13 @@
|
||||
// React
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
|
||||
// Font Awesome
|
||||
import { faUserClock } from '@fortawesome/free-solid-svg-icons'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
export default function Modal() {
|
||||
const [showModal, setShowModal] = React.useState(false);
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("common")
|
||||
const close = t('common:close')
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
|
@ -7,9 +7,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
|
||||
const ThemeSelector = (props) => {
|
||||
const { title, children } = props
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
|
||||
const [isMounted, setIsMounted] = useState(false);
|
||||
const { theme, setTheme, getTheme } = useTheme();
|
||||
useEffect(() => {
|
||||
|
@ -1,8 +1,10 @@
|
||||
// Base layout
|
||||
import Layout from "./components/Layout"
|
||||
|
||||
// React, i18n
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
|
||||
|
||||
// React
|
||||
import React from "react"
|
||||
import ReactMarkdown from "react-markdown"
|
||||
|
||||
@ -12,22 +14,27 @@ import ja from '../docs/hcunews/ja.md'
|
||||
import en from '../docs/hcunews/en.md'
|
||||
|
||||
export default function HcuNews() {
|
||||
const { t, lang } = useTranslation("hcunews")
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
return(
|
||||
<Layout title={t('hcunews')}>
|
||||
<div>
|
||||
<h1>{t('hcunews')}</h1>
|
||||
{lang === 'ja' ? (
|
||||
<ReactMarkdown plugins={[gfm]}>
|
||||
{ja}
|
||||
</ReactMarkdown>
|
||||
) : (
|
||||
<ReactMarkdown plugins={[gfm]}>
|
||||
{en}
|
||||
</ReactMarkdown>
|
||||
)}
|
||||
</div>
|
||||
</Layout>
|
||||
)
|
||||
if (!query) {
|
||||
return <p>Loading...</p>
|
||||
} else {
|
||||
return (
|
||||
<Layout title={t('hcunews')}>
|
||||
<div>
|
||||
<h1>{t('hcunews')}</h1>
|
||||
{query["lang"] === 'ja' ? (
|
||||
<ReactMarkdown plugins={[gfm]}>
|
||||
{ja}
|
||||
</ReactMarkdown>
|
||||
) : (
|
||||
<ReactMarkdown plugins={[gfm]}>
|
||||
{en}
|
||||
</ReactMarkdown>
|
||||
)}
|
||||
</div>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
}
|
@ -1,11 +1,15 @@
|
||||
// Base layout
|
||||
import Layout from "./components/Layout"
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
|
||||
|
||||
// Next.js router
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
export default function About(props) {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("house")
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
return (
|
||||
<Layout title={t('house')}>
|
||||
|
@ -13,7 +13,7 @@ import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
|
||||
// i18n
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useTranslation, useLanguageQuery } from 'next-export-i18n';
|
||||
|
||||
// React Router
|
||||
import { useRouter } from 'next/router'
|
||||
@ -24,10 +24,12 @@ import { faDiscord, faGit, faMastodon, faGithub } from '@fortawesome/free-brands
|
||||
import { faBook, faUser, faServer, faHouseUser, faHeart } from '@fortawesome/free-solid-svg-icons'
|
||||
|
||||
export default function Index(props) {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("index")
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
if (!query) {
|
||||
return <p>Loading...</p>
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<Layout title={t('home')}>
|
||||
@ -44,15 +46,15 @@ export default function Index(props) {
|
||||
|
||||
{/* Index menu */}
|
||||
<div className="grid grid-cols-3 gap-10">
|
||||
<FAMenu dest="/profile" icon={faUser} />
|
||||
<FAMenu dest="/server" icon={faServer} />
|
||||
<FAMenu dest="/house" icon={faHouseUser} />
|
||||
<FAMenu dest="https://scrapbox.io/yude" icon={faBook} />
|
||||
<FAMenu dest="https://discord.gg/X6srY7X" icon={faDiscord} />
|
||||
<FAMenu dest="https://github.com/yudejp" icon={faGithub} />
|
||||
<FAMenu dest="https://git.yude.jp" icon={faGit} />
|
||||
<MinecraftMenu />
|
||||
<FAMenu dest="/mutual" icon={faHeart} />
|
||||
<FAMenu dest="/profile" query={query} icon={faUser} />
|
||||
<FAMenu dest="/server" query={query} icon={faServer} />
|
||||
<FAMenu dest="/house" query={query} icon={faHouseUser} />
|
||||
<FAMenu dest="https://scrapbox.io/yude" query={query} icon={faBook} />
|
||||
<FAMenu dest="https://discord.gg/X6srY7X" query={query} icon={faDiscord} />
|
||||
<FAMenu dest="https://github.com/yudejp" query={query} icon={faGithub} />
|
||||
<FAMenu dest="https://git.yude.jp" icon={faGit} query={query} />
|
||||
<MinecraftMenu query={query} />
|
||||
<FAMenu dest="/mutual" icon={faHeart} query={query} />
|
||||
</div>
|
||||
|
||||
{/* Banner */}
|
||||
@ -62,9 +64,10 @@ export default function Index(props) {
|
||||
</div>
|
||||
|
||||
{/* Avatar by */}
|
||||
<p className="mt-3 text-sm font-bold text-gray-900 dark:text-gray-400">{t('common:icon_1')}<Link href="https://twitter.com/R_I_R_U_"><a className="hover:underline">梨留りる {t('common:icon_2')}</a></Link></p>
|
||||
<p className="mt-3 text-sm font-bold text-gray-900 dark:text-gray-400">{t('icon_1')}<Link href="https://twitter.com/R_I_R_U_"><a className="hover:underline">梨留りる {t('icon_2')}</a></Link></p>
|
||||
</div>
|
||||
</Layout>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
// i18n
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
|
||||
|
||||
// Next.js
|
||||
import Image from 'next/image'
|
||||
@ -29,17 +29,17 @@ import en from '../docs/minecraft/en.md'
|
||||
import { NextSeo } from 'next-seo';
|
||||
|
||||
export default function About(props) {
|
||||
const router = useRouter()
|
||||
|
||||
// i18n
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("minecraft")
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
// Copy server address to clipboard
|
||||
const copyText = () => {
|
||||
navigator.clipboard.writeText("yude.jp");
|
||||
};
|
||||
|
||||
if (!query) {
|
||||
return <p>Loading...</p>
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<NextSeo
|
||||
@ -86,7 +86,7 @@ export default function About(props) {
|
||||
</div>
|
||||
|
||||
{/* Load markdown contents */}
|
||||
{lang === 'ja' ? (
|
||||
{query["lang"] === 'ja' ? (
|
||||
<ReactMarkdown plugins={[gfm]}>
|
||||
{ja}
|
||||
</ReactMarkdown>
|
||||
@ -99,4 +99,5 @@ export default function About(props) {
|
||||
</Layout>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
import Layout from "./components/Layout"
|
||||
|
||||
// i18n
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
|
||||
|
||||
// React Router etc.
|
||||
import { useRouter } from 'next/router'
|
||||
@ -18,9 +18,12 @@ import en from '../docs/mutual/en.md'
|
||||
import { NextSeo } from 'next-seo';
|
||||
|
||||
export default function Tos(props) {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("common")
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
if (!query) {
|
||||
return <p>Loading...</p>
|
||||
} else {
|
||||
return(
|
||||
<>
|
||||
<NextSeo
|
||||
@ -29,7 +32,7 @@ export default function Tos(props) {
|
||||
/>
|
||||
<Layout title={t('common:mutual')}>
|
||||
<div>
|
||||
{lang === 'ja' ? (
|
||||
{query["lang"] === 'ja' ? (
|
||||
<ReactMarkdown plugins={[gfm]}>
|
||||
{ja}
|
||||
</ReactMarkdown>
|
||||
@ -42,4 +45,5 @@ export default function Tos(props) {
|
||||
</Layout>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
// Base layout
|
||||
import Layout from "./components/Layout"
|
||||
|
||||
// Next.js
|
||||
import Link from "next/link";
|
||||
|
||||
// i18n
|
||||
import { useRouter } from 'next/router'
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
|
||||
// microCMS library
|
||||
import { client } from "../libs/client";
|
||||
|
||||
// next-seo
|
||||
import { NextSeo } from 'next-seo';
|
||||
|
||||
export default function Home({ blog }) {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("common")
|
||||
return (
|
||||
<>
|
||||
<NextSeo
|
||||
title="記事一覧"
|
||||
description="yude のブログの記事一覧 / yude's blog posts listing"
|
||||
/>
|
||||
<Layout title={t('common:post_list')}>
|
||||
<div>
|
||||
<h1 className="text-center">{t('common:post_list')}</h1>
|
||||
<ul>
|
||||
{blog.map((blog) => (
|
||||
<li key={blog.id}>
|
||||
<Link href={`/posts/${blog.id}`}>
|
||||
<a>{blog.title}</a>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</Layout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
// Passing data to template
|
||||
export const getStaticProps = async () => {
|
||||
const data = await client.get({ endpoint: "blog" });
|
||||
|
||||
return {
|
||||
props: {
|
||||
blog: data.contents,
|
||||
},
|
||||
};
|
||||
};
|
@ -1,58 +0,0 @@
|
||||
// Base layout
|
||||
import Layout from "../components/Layout"
|
||||
|
||||
// microCMS library
|
||||
import { client } from "../../libs/client";
|
||||
|
||||
// next-seo
|
||||
import { NextSeo } from 'next-seo';
|
||||
|
||||
// React
|
||||
import * as React from "react";
|
||||
|
||||
// React Moment
|
||||
import Moment from 'react-moment';
|
||||
|
||||
export default function BlogId({ blog }) {
|
||||
return (
|
||||
<>
|
||||
<Layout title={blog.title + " - yude.jp"}>
|
||||
<NextSeo
|
||||
title={blog.title + " - yude.jp"}
|
||||
description={blog.publishedAt + "に更新された「" + blog.title + "」というタイトルの記事です。"}
|
||||
/>
|
||||
<h1>{blog.title}</h1>
|
||||
<p>
|
||||
<Moment format="YYYY/MM/DD HH:mm">
|
||||
{blog.updated}
|
||||
</Moment>
|
||||
</p>
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `${blog.content}`,
|
||||
}}
|
||||
/>
|
||||
</Layout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
// Specify path for static generator
|
||||
export const getStaticPaths = async () => {
|
||||
const data = await client.get({ endpoint: "blog" });
|
||||
|
||||
const paths = data.contents.map((content) => `/posts/${content.id}`);
|
||||
return { paths, fallback: false };
|
||||
};
|
||||
|
||||
// Passing data to template
|
||||
export const getStaticProps = async (context) => {
|
||||
const id = context.params.id;
|
||||
const data = await client.get({ endpoint: "blog", contentId: id });
|
||||
|
||||
return {
|
||||
props: {
|
||||
blog: data,
|
||||
},
|
||||
};
|
||||
};
|
@ -2,7 +2,7 @@
|
||||
import Layout from "./components/Layout"
|
||||
|
||||
// i18n
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useTranslation, useLanguageQuery } from 'next-export-i18n';
|
||||
|
||||
// Font Awesome
|
||||
import { faDiscord, faTwitter, faGithub, faKeybase, faInstagram, faMastodon, faSteam, faAmazon } from '@fortawesome/free-brands-svg-icons'
|
||||
@ -30,9 +30,8 @@ import NintendoSW from "./components/Profile/NintendoSW"
|
||||
import { NextSeo } from 'next-seo';
|
||||
|
||||
export default function Profile(props) {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("profile")
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -120,7 +119,7 @@ export default function Profile(props) {
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<p className="mt-3 text-sm font-bold text-gray-900 dark:text-gray-400">{t('common:icon_1')}<Link href="https://twitter.com/xmnts"><a className="hover:underline">Minkasy {t('common:icon_2')}</a></Link></p>
|
||||
<p className="mt-3 text-sm font-bold text-gray-900 dark:text-gray-400">{t('icon_1')}<Link href="https://twitter.com/xmnts"><a className="hover:underline">Minkasy {t('icon_2')}</a></Link></p>
|
||||
</div>
|
||||
|
||||
</Layout>
|
||||
|
@ -2,18 +2,14 @@
|
||||
import Layout from "./components/Layout"
|
||||
|
||||
// i18n
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
|
||||
// React Router
|
||||
import { useRouter } from 'next/router'
|
||||
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
|
||||
|
||||
// next-seo
|
||||
import { NextSeo } from 'next-seo';
|
||||
|
||||
export default function Server(props) {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("server")
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
49
pages/tos.js
49
pages/tos.js
@ -1,29 +1,40 @@
|
||||
// Base layout
|
||||
import Layout from "./components/Layout"
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
|
||||
// i18n
|
||||
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
|
||||
|
||||
// Next.js, React
|
||||
import { useRouter } from 'next/router'
|
||||
import React from "react"
|
||||
|
||||
// React Markdown
|
||||
import ReactMarkdown from "react-markdown"
|
||||
import gfm from 'remark-gfm';
|
||||
import ja from '../docs/tos/ja.md'
|
||||
import en from '../docs/tos/en.md'
|
||||
|
||||
export default function Tos(props) {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("tos")
|
||||
return(
|
||||
<Layout title={t('tos')}>
|
||||
<div>
|
||||
{lang === 'ja' ? (
|
||||
<ReactMarkdown plugins={[gfm]}>
|
||||
{ja}
|
||||
</ReactMarkdown>
|
||||
) : (
|
||||
<ReactMarkdown plugins={[gfm]}>
|
||||
{en}
|
||||
</ReactMarkdown>
|
||||
)}
|
||||
</div>
|
||||
</Layout>
|
||||
)
|
||||
const { t } = useTranslation();
|
||||
const [query] = useLanguageQuery();
|
||||
|
||||
if (!query) {
|
||||
return <p>Loading...</p>
|
||||
} else {
|
||||
return (
|
||||
<Layout title={t('tos')}>
|
||||
<div>
|
||||
{query["lang"] === 'ja' ? (
|
||||
<ReactMarkdown plugins={[gfm]}>
|
||||
{ja}
|
||||
</ReactMarkdown>
|
||||
) : (
|
||||
<ReactMarkdown plugins={[gfm]}>
|
||||
{en}
|
||||
</ReactMarkdown>
|
||||
)}
|
||||
</div>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
}
|
60
yarn.lock
60
yarn.lock
@ -3090,14 +3090,6 @@ merge2@^1.3.0:
|
||||
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
|
||||
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
|
||||
|
||||
microcms-js-sdk@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/microcms-js-sdk/-/microcms-js-sdk-1.2.0.tgz#ad61d35c849fb7dfdda47fc66df2a4069e2ced9e"
|
||||
integrity sha512-ipjiRb4B2ASI2BoDhmusALn7UV7OXIQ38WSdRUDfekBIk34ZjLplPTYq3XDAqQBtoOgA6mKnY/67YIeO4C4jDw==
|
||||
dependencies:
|
||||
node-fetch "^2.6.1"
|
||||
qs "^6.10.1"
|
||||
|
||||
micromark-core-commonmark@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-1.0.1.tgz#a64987cafe872e8b80bc8f2352a5d988586ac4f1"
|
||||
@ -3423,6 +3415,11 @@ ms@^2.1.1:
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
|
||||
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
|
||||
|
||||
mustache@^4.2.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64"
|
||||
integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==
|
||||
|
||||
nanoid@^3.1.23:
|
||||
version "3.1.25"
|
||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152"
|
||||
@ -3445,6 +3442,13 @@ neo-async@^2.6.2:
|
||||
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
|
||||
integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==
|
||||
|
||||
next-export-i18n@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/next-export-i18n/-/next-export-i18n-1.2.1.tgz#06f7653134e1cce89dbeabdb9355c46b2337eeca"
|
||||
integrity sha512-ra7TelbYaDbwTetABLIeT09SXmWoymetMgmJhwsiJ4VNh26pkjLmtvKU+5plyYrkSSgDb7RhtXLFfgNTcrbgCg==
|
||||
dependencies:
|
||||
mustache "^4.2.0"
|
||||
|
||||
next-seo@^4.28.1:
|
||||
version "4.28.1"
|
||||
resolved "https://registry.yarnpkg.com/next-seo/-/next-seo-4.28.1.tgz#c98ee559c8ab7196c62d0f6903afd7a8cde47a03"
|
||||
@ -3455,10 +3459,10 @@ next-themes@^0.0.15:
|
||||
resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.0.15.tgz#ab0cee69cd763b77d41211f631e108beab39bf7d"
|
||||
integrity sha512-LTmtqYi03c4gMTJmWwVK9XkHL7h0/+XrtR970Ujvtu3s0kZNeJN24aJsi4rkZOI8i19+qq6f8j+8Duwy5jqcrQ==
|
||||
|
||||
next-translate@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/next-translate/-/next-translate-1.1.0.tgz#a5a041a1e83ab5bb5b9afe8a305c0bb5ebbe9d7a"
|
||||
integrity sha512-2fTgGJgHvOEKlxuyibchvKAo5uQy7BA2GAcC21LUaUxBDyLqZUKqOJDvdow75jsy3S1preR3zymzx8Is8fenbw==
|
||||
next-translate@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/next-translate/-/next-translate-1.2.0.tgz#e178b4c93fce7c8b78b3fa5cbb112f75fa631188"
|
||||
integrity sha512-L15JCfvj6BhQfx7i3nsJReUF7wrHe1RlzK7h25QlBT40prGQLZ5nJ6gx9Vd3Ew0V9QMqaVELUeQQ1u51yyDu0Q==
|
||||
|
||||
next@^11.1.3:
|
||||
version "11.1.3"
|
||||
@ -3533,13 +3537,6 @@ node-fetch@2.6.1:
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
|
||||
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
|
||||
|
||||
node-fetch@^2.6.1:
|
||||
version "2.6.4"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.4.tgz#7f1d13b8f9ff0c1a994dc6f73c69f7d652c7ace2"
|
||||
integrity sha512-aD1fO+xtLiSCc9vuD+sYMxpIuQyhHscGSkBEo2o5LTV/3bTEAYvdUii29n8LlO5uLCmWdGP7uVUVXFo5SRdkLA==
|
||||
dependencies:
|
||||
whatwg-url "^5.0.0"
|
||||
|
||||
node-html-parser@1.4.9:
|
||||
version "1.4.9"
|
||||
resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-1.4.9.tgz#3c8f6cac46479fae5800725edb532e9ae8fd816c"
|
||||
@ -4119,13 +4116,6 @@ purgecss@^4.0.3:
|
||||
postcss "^8.2.1"
|
||||
postcss-selector-parser "^6.0.2"
|
||||
|
||||
qs@^6.10.1:
|
||||
version "6.10.1"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a"
|
||||
integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==
|
||||
dependencies:
|
||||
side-channel "^1.0.4"
|
||||
|
||||
querystring-es3@0.2.1, querystring-es3@^0.2.0:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"
|
||||
@ -5011,11 +5001,6 @@ tr46@^1.0.1:
|
||||
dependencies:
|
||||
punycode "^2.1.0"
|
||||
|
||||
tr46@~0.0.3:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
|
||||
integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=
|
||||
|
||||
trough@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/trough/-/trough-2.0.2.tgz#94a3aa9d5ce379fc561f6244905b3f36b7458d96"
|
||||
@ -5286,11 +5271,6 @@ watchpack@^2.2.0:
|
||||
glob-to-regexp "^0.4.1"
|
||||
graceful-fs "^4.1.2"
|
||||
|
||||
webidl-conversions@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
||||
integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=
|
||||
|
||||
webidl-conversions@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
|
||||
@ -5331,14 +5311,6 @@ webpack@^5.53.0:
|
||||
watchpack "^2.2.0"
|
||||
webpack-sources "^3.2.0"
|
||||
|
||||
whatwg-url@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
|
||||
integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0=
|
||||
dependencies:
|
||||
tr46 "~0.0.3"
|
||||
webidl-conversions "^3.0.0"
|
||||
|
||||
whatwg-url@^7.0.0:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06"
|
||||
|
Loading…
Reference in New Issue
Block a user