mirror of
https://github.com/byulmaru/quesdon
synced 2024-11-23 14:36:02 +09:00
head 태그에서 title 태그 나오도록 수정
This commit is contained in:
parent
dfc6bff239
commit
1162dc53e3
16
package.json
16
package.json
@ -35,6 +35,7 @@
|
||||
"@types/pug": "^2.0.4",
|
||||
"@types/react": "^16.9.11",
|
||||
"@types/react-dom": "^16.9.3",
|
||||
"@types/react-helmet": "^6.1.6",
|
||||
"@types/react-router-dom": "^5.1.2",
|
||||
"@types/reactstrap": "^8.0.6",
|
||||
"@typescript-eslint/eslint-plugin": "^2.6.1",
|
||||
@ -42,24 +43,17 @@
|
||||
"babel-core": "^6.26.0",
|
||||
"babel-loader": "^8.0.6",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"bootstrap": "^4.3.1",
|
||||
"bootswatch": "^4.3.1",
|
||||
"cpx": "^1.5.0",
|
||||
"css-loader": "^3.2.0",
|
||||
"eslint": "^6.6.0",
|
||||
"fetch-defaults": "^1.0.0",
|
||||
"file-loader": "^4.2.0",
|
||||
"jquery": "^3.4.1",
|
||||
"megalodon": "^2.0.0",
|
||||
"moment": "^2.24.0",
|
||||
"node-dev": "^4.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"page": "^1.11.5",
|
||||
"popper.js": "^1.16.0",
|
||||
"react": "^16.11.0",
|
||||
"react-dom": "^16.11.0",
|
||||
"react-router-dom": "^5.1.2",
|
||||
"reactstrap": "^8.1.1",
|
||||
"style-loader": "^1.0.0",
|
||||
"ts-loader": "^6.2.1",
|
||||
"typescript": "^3.7.2",
|
||||
@ -69,6 +63,8 @@
|
||||
"webpack-dev-server": "^3.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap": "^4.3.1",
|
||||
"bootswatch": "^4.3.1",
|
||||
"common-tags": "^1.8.0",
|
||||
"dotenv": "^8.2.0",
|
||||
"koa": "^2.11.0",
|
||||
@ -84,6 +80,12 @@
|
||||
"node-fetch": "^2.6.0",
|
||||
"oauth-1.0a": "github:rinsuki/oauth-1.0a",
|
||||
"parse-link-header": "^1.0.1",
|
||||
"react": "^16.11.0",
|
||||
"react-dom": "^16.11.0",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-router-dom": "^5.1.2",
|
||||
"reactstrap": "^8.1.1",
|
||||
"jquery": "^3.4.1",
|
||||
"rndstr": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,25 @@
|
||||
import * as React from 'react';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { Children } from 'react';
|
||||
|
||||
|
||||
export class Title extends React.Component
|
||||
{
|
||||
render()
|
||||
title = (): string =>
|
||||
{
|
||||
return <title>{this.props.children} - Quesdon</title>;
|
||||
const childrenAsString: string = Children.map(this.props.children, child =>
|
||||
{
|
||||
return child?.toString();
|
||||
}).join('').toString();
|
||||
return childrenAsString + ' - Quesdon@Planet';
|
||||
};
|
||||
|
||||
render(): React.ReactNode
|
||||
{
|
||||
return (
|
||||
<Helmet>
|
||||
<title>{this.title()}</title>
|
||||
</Helmet>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -2,17 +2,20 @@ import * as React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { me } from '../../initial-state';
|
||||
import { PageLatest } from './latest';
|
||||
import {Helmet} from "react-helmet";
|
||||
|
||||
export class PageIndex extends React.Component
|
||||
{
|
||||
render()
|
||||
{
|
||||
return <div>
|
||||
<title>Quesdon@Planet</title>
|
||||
<h1>Quesdon@Planet</h1>
|
||||
<p>Mastodon에서 사용할 수 있는 askfm스러운 무언가</p>
|
||||
<p>{me ? <Link to="/my">마이페이지</Link> : <Link to="/login">로그인</Link>}</p>
|
||||
<PageLatest />
|
||||
<Helmet>
|
||||
<title>Quesdon@Planet</title>
|
||||
</Helmet>
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ export class PageLatest extends React.Component<{}, State>
|
||||
questions
|
||||
} = this.state;
|
||||
return <div>
|
||||
<Title>최근 답변 - Quesdon</Title>
|
||||
<Title>최근 답변</Title>
|
||||
<h2>최근 올라온 답변들 <Button color="white" onClick={this.load.bind(this)} disabled={loading}>새로고침</Button></h2>
|
||||
{ loading
|
||||
? <Loading/>
|
||||
|
@ -12,6 +12,7 @@ html
|
||||
if profile
|
||||
- const title = `${profile.name}님의 ${profile.questionBoxName || '질문함'}`
|
||||
- const description = profile.description || `${josa(title, '이에요', '예요')}`
|
||||
title #{title} - #{siteName}
|
||||
meta(name="twitter:card", content="summary")
|
||||
meta(property="og:site_name", content=siteName)
|
||||
meta(property="og:title", content=title)
|
||||
@ -21,6 +22,7 @@ html
|
||||
link(rel="me",href=profile.url)
|
||||
else
|
||||
- const description = "Mastodon에서 사용할 수 있는 askfm스러운 무언가"
|
||||
title #{siteName}
|
||||
meta(property="og:site_name", content=siteName)
|
||||
meta(property="og:title", content=siteName)
|
||||
meta(name="description", content=description)
|
||||
|
41
yarn.lock
41
yarn.lock
@ -399,6 +399,13 @@
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react-helmet@^6.1.6":
|
||||
version "6.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-helmet/-/react-helmet-6.1.6.tgz#7d1afd8cbf099616894e8240e9ef70e3c6d7506d"
|
||||
integrity sha512-ZKcoOdW/Tg+kiUbkFCBtvDw0k3nD4HJ/h/B9yWxN4uDO8OkRksWTO+EL+z/Qu3aHTeTll3Ro0Cc/8UhwBCMG5A==
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react-router-dom@^5.1.2":
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.1.2.tgz#853f229f1f297513c0be84f7c914a08b778cfdf5"
|
||||
@ -5859,6 +5866,15 @@ prop-types@^15.5.8, prop-types@^15.6.1, prop-types@^15.6.2:
|
||||
object-assign "^4.1.1"
|
||||
react-is "^16.8.1"
|
||||
|
||||
prop-types@^15.7.2:
|
||||
version "15.8.1"
|
||||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
|
||||
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
|
||||
dependencies:
|
||||
loose-envify "^1.4.0"
|
||||
object-assign "^4.1.1"
|
||||
react-is "^16.13.1"
|
||||
|
||||
proxy-addr@~2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34"
|
||||
@ -6138,6 +6154,26 @@ react-dom@^16.11.0:
|
||||
prop-types "^15.6.2"
|
||||
scheduler "^0.17.0"
|
||||
|
||||
react-fast-compare@^3.1.1:
|
||||
version "3.2.2"
|
||||
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49"
|
||||
integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==
|
||||
|
||||
react-helmet@^6.1.0:
|
||||
version "6.1.0"
|
||||
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"
|
||||
integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==
|
||||
dependencies:
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.7.2"
|
||||
react-fast-compare "^3.1.1"
|
||||
react-side-effect "^2.1.0"
|
||||
|
||||
react-is@^16.13.1:
|
||||
version "16.13.1"
|
||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
|
||||
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
|
||||
|
||||
react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
|
||||
version "16.11.0"
|
||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.11.0.tgz#b85dfecd48ad1ce469ff558a882ca8e8313928fa"
|
||||
@ -6189,6 +6225,11 @@ react-router@5.1.2:
|
||||
tiny-invariant "^1.0.2"
|
||||
tiny-warning "^1.0.0"
|
||||
|
||||
react-side-effect@^2.1.0:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.2.tgz#dc6345b9e8f9906dc2eeb68700b615e0b4fe752a"
|
||||
integrity sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw==
|
||||
|
||||
react-transition-group@^2.3.1:
|
||||
version "2.9.0"
|
||||
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.9.0.tgz#df9cdb025796211151a436c69a8f3b97b5b07c8d"
|
||||
|
Loading…
Reference in New Issue
Block a user