Add partner link on devops page

pull/1900/head
Kamran Ahmed 2 years ago
parent b44b69b4c6
commit 0fcea6f941
  1. 2
      .github/workflows/deploy.yml
  2. 72
      components/custom-ad.tsx
  3. 3
      components/footer.tsx
  4. 3
      pages/[roadmap]/index.tsx
  5. 2
      pages/upcoming.tsx
  6. 2
      scripts/build.sh
  7. 63
      styles/carbon.css

@ -17,7 +17,7 @@ jobs:
persist-credentials: false persist-credentials: false
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
node-version: 14 node-version: 16
- name: Setup Environment - name: Setup Environment
run: | run: |
npm install npm install

@ -1,37 +1,53 @@
import { Box, Flex, Heading, Image, Link } from '@chakra-ui/react';
import { getParameterByName } from '../pages/upcoming';
function getPageSlug() {
const pathname = (typeof window !== 'undefined' ? window : {} as any)?.location?.pathname || '';
return pathname?.replace(/\//g, '');
}
export const CustomAd = () => { export const CustomAd = () => {
const slug = getPageSlug();
if (slug !== 'devops') {
return null;
}
const shouldShowAd = getParameterByName('ad');
if (!shouldShowAd) {
return null;
}
return ( return (
<div id='carbonads'> <Link href='https://thenewstack.io/ebooks/devops/cloud-native-devops-2019/?utm_source=Roadmap&utm_medium=Banner&utm_campaign=DevOps+ebook' id='custom-ad' pos='fixed' bottom='15px' right='20px' zIndex={999} display='flex' maxWidth='330px'
<span> bg='white' boxShadow='0 1px 4px 1px hsla(0, 0%, 0%, .1)' _hover={{ textDecoration: 'none' }} rel="noopener sponsored">
<span className='carbon-wrap'> <Image
<a src='https://i.imgur.com/fEKq19S.png'
href='https://freemote.com/strategy?sl=roadmap'
className='carbon-img'
target='_blank'
>
<img
src='/fm-img.png'
alt='Custom Logo' alt='Custom Logo'
height='100' height={['100px', '100px', '100px', 'auto']}
width='130' width='130'
style={{ maxWidth: '130px', border: 'none' }} style={{ maxWidth: '130px', border: 'none' }}
/> />
</a> <Flex as='span' flexDirection='column' justifyContent='space-between'>
<a <Box as='span' p='10px'>
href='https://freemote.com/strategy?sl=roadmap' <Heading as='span' fontSize='14px' mb='5px' display='block'>Free DevOps eBook</Heading>
className='carbon-text' <Box display='block' as='span' fontSize='13px' lineHeight={1.5} fontWeight={500} color='gray.500'>
target='_blank' Learn all about doing DevOps the Cloud Native way with this free ebook from our partner, The New Stack
> </Box>
He Went from ZERO TO $74,000 as a Full Time Developer in 7 Weeks </Box>
</a> <Box as='span'
</span> textAlign='center'
<a fontWeight={600}
href='https://github.com/sponsors/kamranahmedse' fontSize='9px'
className='carbon-poweredby' letterSpacing='0.5px'
target='_blank' textTransform='uppercase'
padding='5px 10px'
display={'block'}
background='repeating-linear-gradient(-45deg, transparent, transparent 5px, hsla(0, 0%, 0%, .025) 5px, hsla(0, 0%, 0%, .025) 10px) hsla(203, 11%, 95%, .4)'
> >
Sponsored by Partner Content
</a> </Box>
</span> </Flex>
</div> </Link>
); );
}; };

@ -1,6 +1,7 @@
import { Box, Container, Flex, Image, Link, Stack, Text } from '@chakra-ui/react'; import { Box, Container, Flex, Image, Link, Stack, Text } from '@chakra-ui/react';
import siteConfig from '../content/site.json'; import siteConfig from '../content/site.json';
import { CustomAd } from './custom-ad'; import { CustomAd } from './custom-ad';
import React from 'react';
function NavigationLinks() { function NavigationLinks() {
return ( return (
@ -62,6 +63,8 @@ export function Footer() {
</Text> </Text>
</Box> </Box>
</Container> </Container>
<CustomAd />
</Box> </Box>
); );
} }

@ -14,7 +14,7 @@ import MdRenderer from '../../components/md-renderer';
import Helmet from '../../components/helmet'; import Helmet from '../../components/helmet';
import { RoadmapPageHeader } from '../../components/roadmap/roadmap-page-header'; import { RoadmapPageHeader } from '../../components/roadmap/roadmap-page-header';
import { InteractiveRoadmapRenderer } from './interactive'; import { InteractiveRoadmapRenderer } from './interactive';
import { FreeSignUp, SIGNUP_EMAIL_INPUT_NAME, SIGNUP_FORM_ACTION } from '../signup'; import { SIGNUP_EMAIL_INPUT_NAME, SIGNUP_FORM_ACTION } from '../signup';
import { BellIcon, EmailIcon } from '@chakra-ui/icons'; import { BellIcon, EmailIcon } from '@chakra-ui/icons';
import { RelatedRoadmaps } from '../../components/related-roadmaps'; import { RelatedRoadmaps } from '../../components/related-roadmaps';
@ -107,6 +107,7 @@ export default function Roadmap(props: RoadmapPageProps) {
<UpcomingRoadmap roadmap={roadmap} /> <UpcomingRoadmap roadmap={roadmap} />
</Box> </Box>
<RelatedRoadmaps roadmaps={relatedRoadmaps} /> <RelatedRoadmaps roadmaps={relatedRoadmaps} />
<OpensourceBanner /> <OpensourceBanner />
<Footer /> <Footer />
</Box> </Box>

@ -10,7 +10,7 @@ import { SIGNUP_EMAIL_INPUT_NAME, SIGNUP_FORM_ACTION } from './signup';
import React from 'react'; import React from 'react';
import { upcomingRoadmaps } from '../components/home/featured-roadmaps-list'; import { upcomingRoadmaps } from '../components/home/featured-roadmaps-list';
function getParameterByName(name: string, url: string = (typeof window !== 'undefined' ? window : {} as any)?.location?.href) { export function getParameterByName(name: string, url: string = (typeof window !== 'undefined' ? window : {} as any)?.location?.href) {
name = name.replace(/[\[\]]/g, '\\$&'); name = name.replace(/[\[\]]/g, '\\$&');
let regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'); let regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e
rm -rf out rm -rf out
next build next build
next export next export

@ -1,63 +0,0 @@
#carbonads {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
position: fixed;
bottom: 15px;
right: 20px;
z-index: 9999;
}
#carbonads {
display: flex;
max-width: 330px;
background-color: hsl(0, 0%, 98%);
box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, .1);
}
#carbonads a {
color: inherit;
text-decoration: none;
}
#carbonads a:hover {
color: inherit;
}
#carbonads span {
position: relative;
display: block;
overflow: hidden;
}
#carbonads .carbon-wrap {
display: flex;
}
.carbon-img {
display: block;
margin: 0;
line-height: 1;
}
.carbon-img img {
display: block;
}
.carbon-text {
font-size: 13px;
padding: 10px;
line-height: 1.5;
text-align: left;
}
.carbon-poweredby {
display: block;
padding: 8px 10px;
background: repeating-linear-gradient(-45deg, transparent, transparent 5px, hsla(0, 0%, 0%, .025) 5px, hsla(0, 0%, 0%, .025) 10px) hsla(203, 11%, 95%, .4);
text-align: center;
text-transform: uppercase;
letter-spacing: .5px;
font-weight: 600;
font-size: 9px;
line-height: 1;
}
Loading…
Cancel
Save