提交 0f0e74b3 编写于 作者: sinat_25235033's avatar sinat_25235033

[docs-home] add media partners

上级 c12831c2
......@@ -4,6 +4,7 @@ const organizationName = 'usthe' // Usually your GitHub org/user name.
const projectName = 'sureness' // Usually your repo name.
const branch = 'master'
const repoUrl = `https://github.com/dromara/${projectName}`
const cdnUrl = 'https://cdn.jsdelivr.net/gh/usthe/sureness@gh-pages/'
module.exports = {
title: 'Sureness',
......@@ -16,14 +17,15 @@ module.exports = {
organizationName,
projectName,
customFields: {
repoUrl
repoUrl,
cdnUrl
},
i18n: {
defaultLocale: 'en',
locales: ['en', 'zh-cn'],
},
themeConfig: {
image: 'img/icon64128.png',
image: 'img/icon128.png',
liveCodeBlock: {
playgroundPosition: 'bottom',
},
......
......@@ -267,5 +267,8 @@
},
"Friend Links": {
"message": "友情链接"
},
"Media Partners": {
"message": "合作媒体"
}
}
\ No newline at end of file
......@@ -49,7 +49,7 @@
},
"link.item.label.QQ Group - 390083213": {
"message": "QQ 群 - 390083213",
"description": "The label of footer link with label=QQ Group - 282870345 linking to https://qm.qq.com/cgi-bin/qm/qr?k=3IpzQjFOztJe464_eMBmDHfT0YTWK5Qa&jump_from=webapi"
"description": "The label of footer link with label=QQ Group - 390083213 linking to https://qm.qq.com/cgi-bin/qm/qr?k=3IpzQjFOztJe464_eMBmDHfT0YTWK5Qa&jump_from=webapi"
},
"link.item.label.Tom Blog": {
"message": "Tom 博客",
......
......@@ -29,7 +29,7 @@
},
"item.label.QQ Group - 390083213": {
"message": "QQ 群 - 390083213",
"description": "Navbar item with label QQ Group - 282870345"
"description": "Navbar item with label QQ Group - 390083213"
},
"item.label.Blog": {
"message": "博客",
......
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
export default function transfer(imageUrl) {
const {siteConfig} = useDocusaurusContext();
const {cdnUrl} = siteConfig.customFields;
if (cdnUrl !== null && imageUrl !== undefined && imageUrl !== null) {
return cdnUrl + imageUrl;
} else {
return imageUrl;
}
}
\ No newline at end of file
import React from 'react'
import Translate, {translate} from '@docusaurus/Translate';
import Translate, {translate} from '@docusaurus/Translate'
export const features = [{
title: translate({
......@@ -121,6 +122,14 @@ export const friendLinks = [
}
]
export const mediaPartners = [
{
img: 'JavaHouDuan_logo.png',
alt: 'JavaHouDuan',
url: 'https://mp.weixin.qq.com/s/Ylq51a7Av8ZRuH811xZnDA'
}
]
export const logos = [{
/**
* Page 1
......
import React from 'react'
import clsx from 'clsx'
import useBaseUrl from '@docusaurus/useBaseUrl'
import styles from './Feature.module.css'
import cdnTransfer from '../../CdnTransfer'
export default function Feature({ imageUrl, title, description }) {
const imgUrl = useBaseUrl(imageUrl)
const imgUrl = cdnTransfer(imageUrl)
return (
<div className={clsx('col col--4', styles.feature)}>
{imgUrl && (
......
......@@ -4,6 +4,7 @@ import styles from './LogoCarousel.module.css'
const INTERVAL_LENGTH = 5000
const LOGO_WIDTH = 150
const cdnUrl = 'https://cdn.jsdelivr.net/gh/usthe/sureness@gh-pages/img/icons/'
let ticks = 0
......@@ -18,6 +19,8 @@ export default class LogoCarousel extends React.Component {
margin: 70
}
this.imgUrl =
this.containerRef = React.createRef()
}
......@@ -73,7 +76,7 @@ export default class LogoCarousel extends React.Component {
this.list = () => (
<ul style={{ transform: `translate(${this.state.position}px, 0px)` }}>
{this.props.logos.map((value, index) => (
<li key={index}><a href={value.url} target="_blank" rel="noopener noreferrer"><img src={'img/icons/' + value.img} alt={value.alt} /></a></li>
<li key={index}><a href={value.url} target="_blank" rel="noopener noreferrer"><img src={cdnUrl + value.img} alt={value.alt} /></a></li>
))}
</ul>
)
......
......@@ -11,9 +11,10 @@ import Feature from './components/Feature'
import Section from './components/Section'
import Highlight from './components/Highlight'
import LogoCarousel from './components/LogoCarousel'
import cdnTransfer from '../CdnTransfer'
import styles from './styles.module.css'
import { features, SetupExample, SurenessIntegration, friendLinks } from '../constants'
import { features, SetupExample, SurenessIntegration, friendLinks, mediaPartners } from '../constants'
function Home() {
const context = useDocusaurusContext()
......@@ -25,7 +26,7 @@ function Home() {
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">
<img src="img/brand128.svg"/>
<img src={cdnTransfer('img/brand128.svg')}/>
</h1>
<p className="hero__subtitle"><Translate>Focus on Protection of API</Translate></p>
<div className={styles.social}>
......@@ -141,7 +142,7 @@ function Home() {
<img
width="760"
height="445"
src="img/compare.png"
src={cdnTransfer('img/compare.png')}
/>
}
isDark
......@@ -200,7 +201,7 @@ function Home() {
<img
width="560"
height="415"
src="img/benchmark_en.png"
src={cdnTransfer('img/benchmark_en.png')}
/>
}
reversed
......@@ -243,7 +244,7 @@ function Home() {
<img
width="760"
height="405"
src="img/PathRoleMatcher.svg"
src={cdnTransfer('img/PathRoleMatcher.svg')}
/>
}
isDark
......@@ -303,6 +304,10 @@ function Home() {
<Section>
<LogoCarousel logos={friendLinks} headerTitle={translate({message: 'Friend Links'})}></LogoCarousel>
</Section>
{/*Media Partners*/}
<Section>
<LogoCarousel logos={mediaPartners} headerTitle={translate({message: 'Media Partners'})}></LogoCarousel>
</Section>
</main>
</Layout>
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册