Skip to content

Commit

Permalink
Format docs website code and mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
roaks3 authored and fredrikhgrelland committed Oct 22, 2020
1 parent e277b95 commit 4f16b5a
Show file tree
Hide file tree
Showing 71 changed files with 1,492 additions and 1,542 deletions.
2 changes: 1 addition & 1 deletion website/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
presets: ['next/babel'],
plugins: ['import-glob-array']
plugins: ['import-glob-array'],
}
2 changes: 1 addition & 1 deletion website/components/basic-hero/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function BasicHero({ heading, content, links }) {
theme={{
variant: buttonVariant,
brand: 'nomad',
background: 'light'
background: 'light',
}}
title={link.text}
url={link.url}
Expand Down
4 changes: 2 additions & 2 deletions website/components/case-study-carousel/case-study-slide.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Button from '@hashicorp/react-button'
import QuoteMarksIcon from './img/quote.svg?include'

export default function CaseStudySlide({
caseStudy: { person, quote, company, caseStudyURL }
caseStudy: { person, quote, company, caseStudyURL },
}) {
return (
<blockquote className="g-grid-container case-slide">
Expand Down Expand Up @@ -35,7 +35,7 @@ export default function CaseStudySlide({
theme={{
variant: 'tertiary',
brand: 'nomad',
background: 'light'
background: 'light',
}}
linkType="outbound"
/>
Expand Down
8 changes: 4 additions & 4 deletions website/components/case-study-carousel/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import RightArrow from './img/right-arrow-control.svg?include'
export default function CaseStudyCarousel({
caseStudies,
title,
featuredLogos
featuredLogos,
}) {
const [slideIndex, setSlideIndex] = useState(0)
const caseStudySlides = caseStudies.map(caseStudy => (
const caseStudySlides = caseStudies.map((caseStudy) => (
<CaseSlide key={caseStudy.quote} caseStudy={caseStudy} />
))
function renderControls() {
Expand Down Expand Up @@ -69,14 +69,14 @@ export default function CaseStudyCarousel({
renderCenterRightControls={({ nextSlide }) => {
return sideControls(RightArrow, nextSlide)
}}
afterSlide={slideIndex => setSlideIndex(slideIndex)}
afterSlide={(slideIndex) => setSlideIndex(slideIndex)}
>
{caseStudySlides}
</Carousel>
) : null}
<div className="background-section">
<div className="mono-logos">
{featuredLogos.map(featuredLogo => (
{featuredLogos.map((featuredLogo) => (
<Image
key={featuredLogo.url}
url={featuredLogo.url}
Expand Down
8 changes: 4 additions & 4 deletions website/components/enterprise-info/nomad.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const technicalComplexity = {
link: {
text: 'View Open Source Features',
url: 'https://www.hashicorp.com/products/nomad/pricing/',
type: 'outbound'
}
type: 'outbound',
},
}

const organizationalComplexity = {
Expand All @@ -24,8 +24,8 @@ const organizationalComplexity = {
link: {
text: 'View Enterprise Features',
url: 'https://www.hashicorp.com/products/nomad/pricing/',
type: 'outbound'
}
type: 'outbound',
},
}

export default function NomadEnterpriseInfo() {
Expand Down
20 changes: 10 additions & 10 deletions website/components/featured-slider/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FeaturedSlider extends Component {
timing: timing,
numFrames: this.props.features.length,
measure: true,
containerWidth: 0
containerWidth: 0,
}

this.frames = []
Expand Down Expand Up @@ -44,7 +44,7 @@ class FeaturedSlider extends Component {
this.setState(
{
numFrames: this.props.features.length,
measure: true
measure: true,
},
() => {
if (this.props.features.length === 1) {
Expand All @@ -63,7 +63,7 @@ class FeaturedSlider extends Component {
this.setState(
{
timing: parseInt(this.props.timing),
active: 0
active: 0,
},
this.resetTimer
)
Expand Down Expand Up @@ -105,7 +105,7 @@ class FeaturedSlider extends Component {
this.setState({
frameSize: width,
containerWidth: width * this.state.numFrames,
measure: false
measure: false,
})
}
}
Expand All @@ -125,7 +125,7 @@ class FeaturedSlider extends Component {
? {}
: {
width: `${containerWidth}px`,
transform: `translateX(-${(containerWidth / numFrames) * active}px`
transform: `translateX(-${(containerWidth / numFrames) * active}px`,
}

// Create inline styling to apply to each frame
Expand Down Expand Up @@ -162,11 +162,11 @@ class FeaturedSlider extends Component {
<div className="slider-container" style={containerStyle}>
{/* React pushes a null ref the first time, so we're filtering those out. */}
{/* see https://reactjs.org/docs/refs-and-the-dom.html#caveats-with-callback-refs */}
{features.map(feature => (
{features.map((feature) => (
<div
className={`slider-frame${single ? ' single' : ''}`}
style={frameStyle}
ref={el => el && this.frames.push(el)}
ref={(el) => el && this.frames.push(el)}
key={feature.heading}
>
<div className="feature">
Expand All @@ -188,20 +188,20 @@ class FeaturedSlider extends Component {
<h3
className="g-type-display-4"
dangerouslySetInnerHTML={{
__html: marked.inlineLexer(feature.heading, [])
__html: marked.inlineLexer(feature.heading, []),
}}
/>
<p
className="g-type-body"
dangerouslySetInnerHTML={{
__html: marked.inlineLexer(feature.content, [])
__html: marked.inlineLexer(feature.content, []),
}}
/>
<Button
theme={{
brand,
variant: 'secondary',
background: theme
background: theme,
}}
linkType={feature.link.type}
title={feature.link.text}
Expand Down
12 changes: 6 additions & 6 deletions website/components/featured-slider/index.props.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ FeaturedSliderProps.propTypes = {
'consul',
'nomad',
'packer',
'vagrant'
'vagrant',
]),
features: PropTypes.arrayOf(
PropTypes.shape({
logo: PropTypes.shape({
url: PropTypes.string,
alt: PropTypes.string
alt: PropTypes.string,
}),
image: PropTypes.shape({
url: PropTypes.string,
alt: PropTypes.string
alt: PropTypes.string,
}),
heading: PropTypes.string,
content: PropTypes.string,
link: PropTypes.shape({
text: PropTypes.string,
url: PropTypes.string,
type: PropTypes.oneOf(['anchor', 'inbound', 'outbound'])
})
type: PropTypes.oneOf(['anchor', 'inbound', 'outbound']),
}),
})
)
),
}

export default FeaturedSliderProps
2 changes: 1 addition & 1 deletion website/components/learn-nomad/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function LearnNomad({ items }) {
/>
</div>
</div>
{items.map(item => {
{items.map((item) => {
return (
<a
key={item.title}
Expand Down
2 changes: 1 addition & 1 deletion website/components/mini-cta/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function MiniCTA({ title, description, link }) {
theme={{
variant: 'tertiary-neutral',
brand: 'neutral',
background: 'light'
background: 'light',
}}
linkType={link.type}
/>
Expand Down
6 changes: 3 additions & 3 deletions website/components/placement-table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default function PlacementTable({ groups = [] }) {
</td>
<td>
{Array.isArray(groups[0]) ? (
groups.map(subgroup => {
groups.map((subgroup) => {
return (
<Fragment key={subgroup.join('')}>
<code
dangerouslySetInnerHTML={{
__html: wrapLastItem(subgroup, 'strong').join(' -> ')
__html: wrapLastItem(subgroup, 'strong').join(' -> '),
}}
/>
<br />
Expand All @@ -25,7 +25,7 @@ export default function PlacementTable({ groups = [] }) {
) : (
<code
dangerouslySetInnerHTML={{
__html: wrapLastItem(groups, 'strong').join(' -> ')
__html: wrapLastItem(groups, 'strong').join(' -> '),
}}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion website/data/api-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ export default [
'system',
'ui',
'validate',
'volumes'
'volumes',
]
40 changes: 20 additions & 20 deletions website/data/guides-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ export default [
'requirements',
'nomad-agent',
'reference-architecture',
'deployment-guide'
]
'deployment-guide',
],
},
'windows-service'
]
'windows-service',
],
},
{ category: 'upgrade', content: ['upgrade-specific'] },
{
category: 'integrations',
content: ['consul-integration', 'consul-connect', 'vault-integration']
content: ['consul-integration', 'consul-connect', 'vault-integration'],
},
'-----------',
{
Expand All @@ -41,38 +41,38 @@ export default [
content: [
'rolling-upgrades',
'blue-green-and-canary-deployments',
'handling-signals'
]
'handling-signals',
],
},
{
category: 'failure-handling-strategies',
content: ['restart', 'check-restart', 'reschedule']
content: ['restart', 'check-restart', 'reschedule'],
},
{
category: 'advanced-scheduling',
content: ['affinity', 'spread', 'preemption-service-batch']
content: ['affinity', 'spread', 'preemption-service-batch'],
},
{ category: 'external', content: ['lxc'] }
]
{ category: 'external', content: ['lxc'] },
],
},
{
category: 'operations',
content: [
{
category: 'cluster',
content: ['manual', 'automatic', 'cloud_auto_join']
content: ['manual', 'automatic', 'cloud_auto_join'],
},
'federation',
'node-draining',
'outage',
{ category: 'monitoring-and-alerting', content: ['prometheus-metrics'] },
'autopilot'
]
'autopilot',
],
},

{
category: 'security',
content: ['encryption', 'acl', 'securing-nomad', 'vault-pki-integration']
content: ['encryption', 'acl', 'securing-nomad', 'vault-pki-integration'],
},
{ category: 'stateful-workloads' },
{
Expand All @@ -88,13 +88,13 @@ export default [
'submit',
'hdfs',
'monitoring',
'configuration'
]
}
]
'configuration',
],
},
],
},

{ category: 'load-balancing' },
{ category: 'governance-and-policy', content: [] },
{ category: 'web-ui', content: [] }
{ category: 'web-ui', content: [] },
]
4 changes: 2 additions & 2 deletions website/data/intro-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export default [
{ category: 'vs', content: ['kubernetes', 'ecs', 'mesos', 'terraform'] },
{
category: 'getting-started',
content: ['running', 'jobs', 'cluster', 'ui', 'next-steps']
}
content: ['running', 'jobs', 'cluster', 'ui', 'next-steps'],
},
]
Loading

0 comments on commit 4f16b5a

Please sign in to comment.