Skip to content

Commit

Permalink
chore: add content
Browse files Browse the repository at this point in the history
  • Loading branch information
abtx committed Aug 21, 2023
1 parent bd6c06d commit 33a2dca
Show file tree
Hide file tree
Showing 13 changed files with 492 additions and 80 deletions.
6 changes: 3 additions & 3 deletions src/components/GlossarySearch/GlossaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ const GlossaryTerm = ({ term }: { term: GlossaryTermType }) => (
<div className="glossary-term__card-header">
<h2 className="glossary-term__card-title">
<BookIcon />
{term.key}
{term.termTitle}
</h2>
</div>

<div className="glossary-term__card-description">{term.description}</div>
<div className="glossary-term__card-description">{term.definition}</div>

{term.slug && (
<a
href={`/glossary/${term.slug}`}
className="glossary-term__card-link"
rel="noopener noreferrer"
>
More about {term.key}
More about {term.termTitle}
<ArrowIcon />
</a>
)}
Expand Down
353 changes: 297 additions & 56 deletions src/components/GlossarySearch/glossaryTerms.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions src/components/GlossarySearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ type GlossaryPageSection = {
};

export type GlossaryTermType = {
key: string;
termTitle: string;
pageTitle: string;
slug: string | null;
description: string;
definition: string;
sections?: GlossaryPageSection[];
};

const GlossarySearch = () => {
const { results, searchValue, setSearchValue } = useSearch<GlossaryTermType>({
dataSet: terms,
keys: ['key', 'description'],
keys: ['termTitle', 'description'],
});

const handleInputChange = (e) => {
Expand Down Expand Up @@ -84,7 +85,7 @@ const GlossarySearch = () => {
{results.length > 0 ? (
<div className="glossary-search__content-list">
{sortTermsAlphabetically(results).map((term) => (
<React.Fragment key={term.key}>
<React.Fragment key={term.termTitle}>
<GlossaryTerm term={term} />
</React.Fragment>
))}
Expand All @@ -103,7 +104,7 @@ const GlossarySearch = () => {
};

function sortTermsAlphabetically(terms: GlossaryTermType[]): GlossaryTermType[] {
return terms.slice().sort((a, b) => a.key.localeCompare(b.key));
return terms.slice().sort((a, b) => a.termTitle.localeCompare(b.termTitle));
}

export default GlossarySearch;
2 changes: 1 addition & 1 deletion src/components/GlossaryTermPage/GlossaryTermPage.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* GLOSSARY TERM PAGE */

.glossary-term__page {
.glossary-term__page-container {
display: grid;
grid-template-columns: 3fr 1fr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const GlossaryTermPageContent = ({ term }: { term: GlossaryTermType }) => (
<Section
title={section.title}
content={section.paragraphs}
key={`${term.key}-section-${index}}`}
key={`${term.slug}-section-${index}}`}
/>
))}
<Cta />
Expand Down
2 changes: 1 addition & 1 deletion src/components/GlossaryTermPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import './GlossaryTermPage.css';

const GlossaryTermPage = ({ children }: { children: ReactElement | ReactElement[] }) => (
<main className="white-bg">
<div className="glossary-term__page container">{children}</div>
<div className="glossary-term__page-container container">{children}</div>
</main>
);

Expand Down
29 changes: 29 additions & 0 deletions src/pages/glossary/amortized-costs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import PageLayout from '../../components/PageLayout';
import GlossaryTermPageIntro from '../../components/GlossaryTermPage/GlossaryTermPageIntro';
import GlossaryTermPage from '../../components/GlossaryTermPage';
import terms from '../../components/GlossarySearch/glossaryTerms.json';
import GlossaryTermPageAside from '../../components/GlossaryTermPage/GlossaryTermPageAside';
import GlossaryTermPageContent from '../../components/GlossaryTermPage/GlossaryTermPageContent';

const Term = () => {
const term = terms.filter((term) => term.slug === 'amortized-costs')[0];

return (
<PageLayout
title={`${term.termTitle} - Infracost Glossary`}
description={term.pageTitle}
pageClass="glossary-term__page"
hideCTA={true}
noIndex={false}
>
<GlossaryTermPageIntro title={term.pageTitle} toPath="/glossary" toText="FinOps Glossary" />
<GlossaryTermPage>
<GlossaryTermPageContent term={term} />
<GlossaryTermPageAside term={term} />
</GlossaryTermPage>
</PageLayout>
);
};

export default Term;
29 changes: 29 additions & 0 deletions src/pages/glossary/aws.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import PageLayout from '../../components/PageLayout';
import GlossaryTermPageIntro from '../../components/GlossaryTermPage/GlossaryTermPageIntro';
import GlossaryTermPage from '../../components/GlossaryTermPage';
import terms from '../../components/GlossarySearch/glossaryTerms.json';
import GlossaryTermPageAside from '../../components/GlossaryTermPage/GlossaryTermPageAside';
import GlossaryTermPageContent from '../../components/GlossaryTermPage/GlossaryTermPageContent';

const Term = () => {
const term = terms.filter((term) => term.slug === 'aws')[0];

return (
<PageLayout
title={`${term.termTitle} - Infracost Glossary`}
description={term.pageTitle}
pageClass="glossary-term__page"
hideCTA={true}
noIndex={false}
>
<GlossaryTermPageIntro title={term.pageTitle} toPath="/glossary" toText="FinOps Glossary" />
<GlossaryTermPage>
<GlossaryTermPageContent term={term} />
<GlossaryTermPageAside term={term} />
</GlossaryTermPage>
</PageLayout>
);
};

export default Term;
29 changes: 29 additions & 0 deletions src/pages/glossary/azure.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import PageLayout from '../../components/PageLayout';
import GlossaryTermPageIntro from '../../components/GlossaryTermPage/GlossaryTermPageIntro';
import GlossaryTermPage from '../../components/GlossaryTermPage';
import terms from '../../components/GlossarySearch/glossaryTerms.json';
import GlossaryTermPageAside from '../../components/GlossaryTermPage/GlossaryTermPageAside';
import GlossaryTermPageContent from '../../components/GlossaryTermPage/GlossaryTermPageContent';

const Term = () => {
const term = terms.filter((term) => term.slug === 'azure')[0];

return (
<PageLayout
title={`${term.termTitle} - Infracost Glossary`}
description={term.pageTitle}
pageClass="glossary-term__page"
hideCTA={true}
noIndex={false}
>
<GlossaryTermPageIntro title={term.pageTitle} toPath="/glossary" toText="FinOps Glossary" />
<GlossaryTermPage>
<GlossaryTermPageContent term={term} />
<GlossaryTermPageAside term={term} />
</GlossaryTermPage>
</PageLayout>
);
};

export default Term;
29 changes: 29 additions & 0 deletions src/pages/glossary/chargeback.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import PageLayout from '../../components/PageLayout';
import GlossaryTermPageIntro from '../../components/GlossaryTermPage/GlossaryTermPageIntro';
import GlossaryTermPage from '../../components/GlossaryTermPage';
import terms from '../../components/GlossarySearch/glossaryTerms.json';
import GlossaryTermPageAside from '../../components/GlossaryTermPage/GlossaryTermPageAside';
import GlossaryTermPageContent from '../../components/GlossaryTermPage/GlossaryTermPageContent';

const Term = () => {
const term = terms.filter((term) => term.slug === 'chargeback')[0];

return (
<PageLayout
title={`${term.termTitle} - Infracost Glossary`}
description={term.pageTitle}
pageClass="glossary-term__page"
hideCTA={true}
noIndex={false}
>
<GlossaryTermPageIntro title={term.pageTitle} toPath="/glossary" toText="FinOps Glossary" />
<GlossaryTermPage>
<GlossaryTermPageContent term={term} />
<GlossaryTermPageAside term={term} />
</GlossaryTermPage>
</PageLayout>
);
};

export default Term;
29 changes: 29 additions & 0 deletions src/pages/glossary/cloud-computing.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import PageLayout from '../../components/PageLayout';
import GlossaryTermPageIntro from '../../components/GlossaryTermPage/GlossaryTermPageIntro';
import GlossaryTermPage from '../../components/GlossaryTermPage';
import terms from '../../components/GlossarySearch/glossaryTerms.json';
import GlossaryTermPageAside from '../../components/GlossaryTermPage/GlossaryTermPageAside';
import GlossaryTermPageContent from '../../components/GlossaryTermPage/GlossaryTermPageContent';

const Term = () => {
const term = terms.filter((term) => term.slug === 'cloud-computing')[0];

return (
<PageLayout
title={`${term.termTitle} - Infracost Glossary`}
description={term.pageTitle}
pageClass="glossary-term__page"
hideCTA={true}
noIndex={false}
>
<GlossaryTermPageIntro title={term.pageTitle} toPath="/glossary" toText="FinOps Glossary" />
<GlossaryTermPage>
<GlossaryTermPageContent term={term} />
<GlossaryTermPageAside term={term} />
</GlossaryTermPage>
</PageLayout>
);
};

export default Term;
29 changes: 29 additions & 0 deletions src/pages/glossary/cost-anomalies.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import PageLayout from '../../components/PageLayout';
import GlossaryTermPageIntro from '../../components/GlossaryTermPage/GlossaryTermPageIntro';
import GlossaryTermPage from '../../components/GlossaryTermPage';
import terms from '../../components/GlossarySearch/glossaryTerms.json';
import GlossaryTermPageAside from '../../components/GlossaryTermPage/GlossaryTermPageAside';
import GlossaryTermPageContent from '../../components/GlossaryTermPage/GlossaryTermPageContent';

const Term = () => {
const term = terms.filter((term) => term.slug === 'cost-anomalies')[0];

return (
<PageLayout
title={`${term.termTitle} - Infracost Glossary`}
description={term.pageTitle}
pageClass="glossary-term__page"
hideCTA={true}
noIndex={false}
>
<GlossaryTermPageIntro title={term.pageTitle} toPath="/glossary" toText="FinOps Glossary" />
<GlossaryTermPage>
<GlossaryTermPageContent term={term} />
<GlossaryTermPageAside term={term} />
</GlossaryTermPage>
</PageLayout>
);
};

export default Term;
22 changes: 9 additions & 13 deletions src/pages/glossary/finops.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,24 @@ import terms from '../../components/GlossarySearch/glossaryTerms.json';
import GlossaryTermPageAside from '../../components/GlossaryTermPage/GlossaryTermPageAside';
import GlossaryTermPageContent from '../../components/GlossaryTermPage/GlossaryTermPageContent';

const Finops = () => {
const finops = terms.filter((term) => term.key === 'FinOps')[0];
const Term = () => {
const term = terms.filter((term) => term.slug === 'finops')[0];

return (
<PageLayout
title="FinOps - Infracost Glossary"
description="What is FinOps in cloud computing?"
pageClass="finops"
title={`${term.termTitle} - Infracost Glossary`}
description={term.pageTitle}
pageClass="glossary-term__page"
hideCTA={true}
noIndex={false}
>
<GlossaryTermPageIntro
title=" FinOps: Bridging Finance and Operations in the Cloud Era"
toPath="/glossary"
toText="FinOps Glossary"
/>
<GlossaryTermPageIntro title={term.pageTitle} toPath="/glossary" toText="FinOps Glossary" />
<GlossaryTermPage>
<GlossaryTermPageContent term={finops} />
<GlossaryTermPageAside term={finops} />
<GlossaryTermPageContent term={term} />
<GlossaryTermPageAside term={term} />
</GlossaryTermPage>
</PageLayout>
);
};

export default Finops;
export default Term;

0 comments on commit 33a2dca

Please sign in to comment.