Commit a54cb62b authored by 吕祺's avatar 吕祺 ⛹🏽

add warning

parent 9d2ded96
...@@ -19,7 +19,7 @@ export class Header extends React.PureComponent { ...@@ -19,7 +19,7 @@ export class Header extends React.PureComponent {
this.renderLinks = this.renderLinks.bind(this) this.renderLinks = this.renderLinks.bind(this)
this.renderCollapse = this.renderCollapse.bind(this) this.renderCollapse = this.renderCollapse.bind(this)
} }
genLink(en, curPage, path, txt, txtEN) { genLink(en, curPage, path, txt, txtEN, query=null) {
return ( return (
<span <span
className={classnames({ className={classnames({
...@@ -27,7 +27,7 @@ export class Header extends React.PureComponent { ...@@ -27,7 +27,7 @@ export class Header extends React.PureComponent {
active: curPage === path active: curPage === path
})} })}
> >
<Link prefetch={false} href={{ pathname: '/' + path }}> <Link prefetch={false} href={{ pathname: '/' + path, query }} passHref="true">
<a style={{ height: '100%', display: 'inline-block' }}> <a style={{ height: '100%', display: 'inline-block' }}>
{en === null ? '' : en ? txtEN : txt} {en === null ? '' : en ? txtEN : txt}
</a> </a>
...@@ -149,7 +149,9 @@ export class Header extends React.PureComponent { ...@@ -149,7 +149,9 @@ export class Header extends React.PureComponent {
ronghui, ronghui,
ronghuiEN, ronghuiEN,
news, news,
newsEN newsEN,
warn,
warnEN
} }
} = head } = head
const { en, curPage, setLang } = this.props const { en, curPage, setLang } = this.props
...@@ -174,6 +176,7 @@ export class Header extends React.PureComponent { ...@@ -174,6 +176,7 @@ export class Header extends React.PureComponent {
ronghuiEN ronghuiEN
)} )}
{this.genLink(en, curPage + '.html', 'news.html', news, newsEN)} {this.genLink(en, curPage + '.html', 'news.html', news, newsEN)}
{this.genLink(en, curPage + '.html', 'post.html', warn, warnEN, {t: "news", d: "20210514014133435"})}
{!collapse && en !== null && ( {!collapse && en !== null && (
<span <span
className={classnames({ className={classnames({
......
...@@ -6,10 +6,12 @@ portfolio: 投资企业 ...@@ -6,10 +6,12 @@ portfolio: 投资企业
team: 团队 team: 团队
ronghui: 榕汇 ronghui: 榕汇
news: 动态 news: 动态
warn: 免责声明
aboutEN: About aboutEN: About
portfolioEN: Portfolio portfolioEN: Portfolio
teamEN: Team teamEN: Team
ronghuiEN: Community ronghuiEN: Community
newsEN: News newsEN: News
warnEN: Disclaimer
--- ---
...@@ -324,11 +324,13 @@ collections: ...@@ -324,11 +324,13 @@ collections:
- { label: "Team", name: "team", widget: "string" } - { label: "Team", name: "team", widget: "string" }
- { label: "Ronghui", name: "ronghui", widget: "string" } - { label: "Ronghui", name: "ronghui", widget: "string" }
- { label: "News", name: "news", widget: "string" } - { label: "News", name: "news", widget: "string" }
- { label: "Warn", name: "warn", widget: "string" }
- { label: "AboutEN", name: "aboutEN", widget: "string" } - { label: "AboutEN", name: "aboutEN", widget: "string" }
- { label: "PortfolioEN", name: "portfolioEN", widget: "string" } - { label: "PortfolioEN", name: "portfolioEN", widget: "string" }
- { label: "TeamEN", name: "teamEN", widget: "string" } - { label: "TeamEN", name: "teamEN", widget: "string" }
- { label: "RonghuiEN", name: "ronghuiEN", widget: "string" } - { label: "RonghuiEN", name: "ronghuiEN", widget: "string" }
- { label: "NewsEN", name: "newsEN", widget: "string" } - { label: "NewsEN", name: "newsEN", widget: "string" }
- { label: "WarnEN", name: "warnEN", widget: "string" }
- label: "Foot" - label: "Foot"
name: "foot" name: "foot"
file: "content/foot.md" file: "content/foot.md"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment