Skip to content

Commit

Permalink
Add syndication links to blog listing page (#159)
Browse files Browse the repository at this point in the history
### Description

This PR adds a small section with syndication links to the blog posts
listing page.

It also removes some `TODO` code that has deemed to be not successful
for what we wanted to. Basically, after submitting an issue to one of
our library dependencies, I thought that by the uses of the CSS Modules
`composes` feature, we could avoid the CSS injection order problem
present in:

#147
#158
facebook/docusaurus#3678

But it doesn't seem to be the case, so we are in the need of the use of
the double selector trick to successfully override some Infima selectors
styling with our classes.

This closes #153

### Preview


![imagen](https://user-images.githubusercontent.com/7753447/230139114-f5ef7faa-5988-4871-8dd9-60b91caf2352.png)
  • Loading branch information
calvellido authored Apr 6, 2023
1 parent b4ab2e7 commit bf584ef
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 29 deletions.
7 changes: 7 additions & 0 deletions src/components/Blog/BlogListPage/BlogListPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';

import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import {
PageMetadata,
Expand Down Expand Up @@ -72,6 +73,12 @@ function BlogListPageContent(props: Props): JSX.Element {
<section>
<Banner title={data.banner.title} ctaList={data.banner.ctaList} />
</section>
<section
className={`margin-top--md margin-bottom--md ${styles.linksContainer}`}>
<Link href="/community/blog/archive">Archive</Link>
<Link href="/community/blog/atom.xml">Atom feed</Link>
<Link href="/community/blog/rss.xml">RSS feed</Link>
</section>
</main>
</Layout>
);
Expand Down
9 changes: 9 additions & 0 deletions src/components/Blog/BlogListPage/blog-list-page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
margin-bottom: calc(2 * var(--ifm-spacing-vertical));
}

.linksContainer {
composes: container from global;
composes: text--center from global;
font-size: 0.8rem;
display: flex;
justify-content: center;
gap: var(--ifm-spacing-horizontal);
}

.projectsContainer {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
Expand Down
13 changes: 9 additions & 4 deletions src/pages/community/support/support.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
margin-bottom: calc(2 * var(--ifm-spacing-vertical));
}

.textContainer {
/*
* The .textContainer class duplication is a subtle trick to increase the specificity of
* this selector, as it would clash with an Infima styling otherwise. CSS injection
* order is affecting this. But it doesn't seem like an easy task to solve.
* More info:
*
* https://github.com/facebook/docusaurus/issues/3678
*/
.textContainer.textContainer {
max-width: 480px;
/* TODO: Waiting on https://github.com/mrmckeb/typescript-plugin-css-modules/issues/207 */
/* composes: container from global;
composes: text--center from global; */
}

.navigationContainer {
Expand Down
17 changes: 10 additions & 7 deletions src/pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
margin-bottom: calc(2 * var(--ifm-spacing-vertical));
}

.textContainer {
/*
* The .textContainer class duplication is a subtle trick to increase the specificity of
* this selector, as it would clash with an Infima styling otherwise. CSS injection
* order is affecting this. But it doesn't seem like an easy task to solve.
* More info:
*
* https://github.com/facebook/docusaurus/issues/3678
*/
.textContainer.textContainer {
max-width: 480px;
/* TODO: Waiting on https://github.com/mrmckeb/typescript-plugin-css-modules/issues/207 */
/* composes: container from global;
composes: text--center from global; */
}

.featuresContainer,
.quotesContainer {
/* TODO: Waiting on https://github.com/mrmckeb/typescript-plugin-css-modules/issues/207 */
/* https://github.com/css-modules/css-modules#composing-from-other-files */
/* composes: container from global; */
composes: container from global;
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--ifm-spacing-vertical) var(--ifm-spacing-horizontal);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function Home(): JSX.Element {
</p>
</section>
<section
className={`container ${styles.featuresContainer} ${styles.verticalRhythm}`}>
className={`${styles.featuresContainer} ${styles.verticalRhythm}`}>
{data.features.map((feature: LinkCardProps) => (
<LinkCard key={feature.title} {...feature} />
))}
Expand All @@ -46,7 +46,7 @@ export default function Home(): JSX.Element {
</p>
</section>
<section
className={`container ${styles.quotesContainer} ${styles.verticalRhythm}`}>
className={`${styles.quotesContainer} ${styles.verticalRhythm}`}>
{data.quotes?.map((quote: QuoteCardProps) => (
<QuoteCard key={quote.name} {...quote} />
))}
Expand Down
17 changes: 10 additions & 7 deletions src/pages/libraries/libraries.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
margin-bottom: calc(2 * var(--ifm-spacing-vertical));
}

.textContainer {
/*
* The .textContainer class duplication is a subtle trick to increase the specificity of
* this selector, as it would clash with an Infima styling otherwise. CSS injection
* order is affecting this. But it doesn't seem like an easy task to solve.
* More info:
*
* https://github.com/facebook/docusaurus/issues/3678
*/
.textContainer.textContainer {
max-width: 480px;
/* TODO: Waiting on https://github.com/mrmckeb/typescript-plugin-css-modules/issues/207 */
/* composes: container from global;
composes: text--center from global; */
}

.featuresContainer,
.quotesContainer {
/* TODO: Waiting on https://github.com/mrmckeb/typescript-plugin-css-modules/issues/207 */
/* https://github.com/css-modules/css-modules#composing-from-other-files */
/* composes: container from global; */
composes: container from global;
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--ifm-spacing-vertical) var(--ifm-spacing-horizontal);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/libraries/libraries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function Libraries(): JSX.Element {
/>
<main>
<section
className={`container ${styles.featuresContainer} ${styles.verticalRhythm}`}>
className={`${styles.featuresContainer} ${styles.verticalRhythm}`}>
{data.libraries.map((library: LinkCardProps) => (
<LinkCard key={library.title} {...library} />
))}
Expand Down
17 changes: 10 additions & 7 deletions src/pages/training/training.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
margin-bottom: calc(2 * var(--ifm-spacing-vertical));
}

.textContainer {
/*
* The .textContainer class duplication is a subtle trick to increase the specificity of
* this selector, as it would clash with an Infima styling otherwise. CSS injection
* order is affecting this. But it doesn't seem like an easy task to solve.
* More info:
*
* https://github.com/facebook/docusaurus/issues/3678
*/
.textContainer.textContainer {
max-width: 480px;
/* TODO: Waiting on https://github.com/mrmckeb/typescript-plugin-css-modules/issues/207 */
/* composes: container from global;
composes: text--center from global; */
}

.featuresContainer,
.quotesContainer {
/* TODO: Waiting on https://github.com/mrmckeb/typescript-plugin-css-modules/issues/207 */
/* https://github.com/css-modules/css-modules#composing-from-other-files */
/* composes: container from global; */
composes: container from global;
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--ifm-spacing-vertical) var(--ifm-spacing-horizontal);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/training/training.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function Training(): JSX.Element {
</p>
</section>
<section
className={`container ${styles.quotesContainer} ${styles.verticalRhythm}`}>
className={`${styles.quotesContainer} ${styles.verticalRhythm}`}>
{data.quotes.map((quote: QuoteCardProps) => (
<QuoteCard key={quote.name} {...quote} />
))}
Expand Down

0 comments on commit bf584ef

Please sign in to comment.