forked from apache/apisix-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
406 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
{ | ||
"extends": "stylelint-config-standard", | ||
"extends": [ | ||
"stylelint-config-standard", | ||
"stylelint-config-recommended-scss" | ||
], | ||
"rules": { | ||
"selector-type-case": "lower", | ||
"selector-class-pattern": null, | ||
"property-no-vendor-prefix": true | ||
"property-no-vendor-prefix": true, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@use "sass:map"; | ||
|
||
$breakpoints: ( | ||
xs: 369px, | ||
sm: 736px, | ||
md: 1024px, | ||
lg: 1400px, | ||
); | ||
|
||
// @include respond-above() {} | ||
@mixin respond-above($breakpoint) { | ||
@if map.has-key($breakpoints, $breakpoint) { | ||
$breakpoint-value: map.get($breakpoints, $breakpoint); | ||
|
||
@media only screen and (min-width: $breakpoint-value) { | ||
@content; | ||
} | ||
} | ||
|
||
@else { | ||
@warn "Invalid #{$breakpoint}."; | ||
} | ||
} | ||
|
||
// @include respond-below() {} | ||
@mixin respond-below($breakpoint) { | ||
@if map.has-key($breakpoints, $breakpoint) { | ||
$breakpoint-value: map.get($breakpoints, $breakpoint); | ||
|
||
@media only screen and (max-width: ($breakpoint-value - 1)) { | ||
@content; | ||
} | ||
} | ||
|
||
@else { | ||
@warn "Invalid #{$breakpoint}."; | ||
} | ||
} | ||
|
||
// @include respond-between(sm, md) {} | ||
@mixin respond-between($lower, $upper) { | ||
@if map.has-key($breakpoints, $lower) and map.has-key($breakpoints, $upper) { | ||
$lower-breakpoint: map.get($breakpoints, $lower); | ||
$upper-breakpoint: map.get($breakpoints, $upper); | ||
|
||
@media only screen and (min-width: $lower-breakpoint) and (max-width: ($upper-breakpoint - 1)) { | ||
@content; | ||
} | ||
} | ||
|
||
@else { | ||
@if (map.has-key($breakpoints, $lower) == false) { | ||
@warn "Lower breakpoint invalid: #{$lower}."; | ||
} | ||
|
||
@if (map.has-key($breakpoints, $upper) == false) { | ||
@warn "Upper breakpoint invalid: #{$upper}."; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
/* eslint-disable react/prop-types */ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
import type { FC } from 'react'; | ||
import React from 'react'; | ||
import Link from '@docusaurus/Link'; | ||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
import { Icon } from '@iconify/react'; | ||
import githubIcon from '@iconify/icons-akar-icons/github-fill'; | ||
import twitterIcon from '@iconify/icons-akar-icons/twitter-fill'; | ||
import slackIcon from '@iconify/icons-akar-icons/slack-fill'; | ||
import youtubeIcon from '@iconify/icons-akar-icons/youtube-fill'; | ||
import { LazyLoadImage } from 'react-lazy-load-image-component'; | ||
import style from './styles.module.scss'; | ||
|
||
const footer = { | ||
links: [ | ||
{ | ||
title: 'ASF', | ||
items: [ | ||
{ | ||
label: 'Foundation', | ||
to: 'https://www.apache.org/', | ||
}, | ||
{ | ||
label: 'License', | ||
to: 'https://www.apache.org/licenses/', | ||
}, | ||
{ | ||
label: 'Events', | ||
to: 'https://www.apache.org/events/', | ||
}, | ||
{ | ||
label: 'Security', | ||
to: 'https://www.apache.org/security/', | ||
}, | ||
{ | ||
label: 'Sponsorship', | ||
to: 'https://www.apache.org/foundation/sponsorship.html', | ||
}, | ||
{ | ||
label: 'Thanks', | ||
to: 'https://www.apache.org/foundation/thanks.html', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Community', | ||
items: [ | ||
{ | ||
icon: githubIcon, | ||
label: 'GitHub', | ||
to: 'https://github.com/apache/apisix/issues', | ||
}, | ||
{ | ||
icon: slackIcon, | ||
label: 'Slack', | ||
to: '/docs/general/join', | ||
}, | ||
{ | ||
icon: twitterIcon, | ||
label: 'Twitter', | ||
to: 'https://twitter.com/ApacheAPISIX', | ||
}, | ||
{ | ||
icon: youtubeIcon, | ||
label: 'YouTube', | ||
to: 'https://www.youtube.com/channel/UCgPD18cMhOg5rmPVnQhAC8g', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'More', | ||
items: [ | ||
{ | ||
label: 'Blog', | ||
to: '/blog/', | ||
}, { | ||
label: 'Showcase', | ||
to: '/showcase', | ||
}, { | ||
label: 'Plugin Hub', | ||
to: '/plugins', | ||
}, | ||
], | ||
}, | ||
], | ||
logo: { | ||
alt: 'Apache Software Foundation', | ||
src: 'https://static.apiseven.com/202202/asf_logo_wide_small.png', | ||
href: 'https://www.apache.org/', | ||
}, | ||
|
||
copyright: | ||
'Copyright © 2019-2022 The Apache Software Foundation. Apache APISIX, APISIX®, Apache, the Apache feather logo, and the Apache APISIX project logo are either registered trademarks or trademarks of the Apache Software Foundation.', | ||
}; | ||
|
||
const FooterLink = ({ | ||
to, icon, href, label, prependBaseUrlToHref, ...props | ||
}) => { | ||
const toUrl = useBaseUrl(to); | ||
const normalizedHref = useBaseUrl(href, { | ||
forcePrependBaseUrl: true, | ||
}); | ||
const hrefObj = href | ||
? { href: prependBaseUrlToHref ? normalizedHref : href } | ||
: { to: toUrl }; | ||
return ( | ||
<Link | ||
{...hrefObj} | ||
{...props} | ||
> | ||
<Icon icon={icon} /> | ||
<span>{label}</span> | ||
</Link> | ||
); | ||
}; | ||
|
||
const Footer: FC = () => { | ||
const { copyright, links, logo } = footer; | ||
|
||
if (!footer) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<footer className={style.container}> | ||
{links && links.length > 0 && ( | ||
<div className={style.linksRow}> | ||
{links.map(({ title, items }) => ( | ||
<div key={title} className={style.linksCol}> | ||
<div>{title}</div> | ||
<ul> | ||
{items.map((v) => ( | ||
<li key={v.to} className="footer__item"> | ||
<FooterLink {...v} /> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
))} | ||
</div> | ||
)} | ||
<div className={style.copyright}> | ||
<Link href={logo.href}> | ||
<LazyLoadImage alt={logo.alt} src={logo.src} height="40px" width="231.25px" /> | ||
</Link> | ||
<div className={style.text}>{copyright}</div> | ||
</div> | ||
</footer> | ||
); | ||
}; | ||
|
||
export default Footer; |
Oops, something went wrong.