-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(content): added published and unlisted property in blogpost
feat(translation): added banner to indicate when translation is available fix(SEO): add site description on HTML title page fix(translation): hide flag is language = default language (multilangPosts is no longer used. In config use `defaultLang` props) fix(translation): related post have wrong flag when language !== en docs(translation): added new example of translation (in MDX post)
- Loading branch information
Showing
21 changed files
with
168 additions
and
23 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,20 @@ | ||
--- | ||
title: this post is a ghost | ||
slug: invisible-post | ||
date: 2020-01-01 | ||
|
||
# optional fields | ||
published: false | ||
unlisted: true | ||
generate-card: false | ||
language: fr | ||
cover: ./cover.jpeg | ||
imageShare: ./cover.jpeg | ||
tags: ['fake'] | ||
translations: | ||
- link: 'https://www.maxpou.fr/about' | ||
language: 'french' | ||
--- | ||
|
||
This exists to populate GraphQL fields and avoid null errors. It should contain | ||
all of the available frontmatter. |
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,52 @@ | ||
--- | ||
title: Utiliser MDX | ||
slug: using-mdx-fr | ||
date: 2019-07-10 | ||
language: fr | ||
unlisted: true | ||
generate-card: false | ||
tags: ['gatsby', 'translation'] | ||
translations: | ||
- link: '/using-mdx' | ||
language: 'English' | ||
--- | ||
|
||
## Salut les gens! | ||
|
||
Grace a à MDX, il est maintenant possible d'ajouter du JSX dans du Markdown! Juste en dessous, un example de JSX intégré dans du Markdown <br /> | ||
|
||
> MDX est un format autorisable qui vous permet d'écrire en toute transparence JSX dans vos documents Markdown. Vous pouvez importer des composants, tels que des graphiques interactifs ou des alertes, et les intégrer dans votre contenu. Cela rend l'écriture de contenu longue forme avec des composants un souffle 🚀. | ||
|
||
**Example:** | ||
|
||
<div style={{ padding: '20px', backgroundColor: 'tomato' }}> | ||
<h3>Voila du JSX dans du Markdown</h3> | ||
{console.log('Salut MDX')} | ||
</div> | ||
|
||
Code: | ||
|
||
```jsx | ||
<div style={{ padding: '20px', backgroundColor: 'tomato' }}> | ||
<h3>Voila du JSX dans du Markdown</h3> | ||
{console.log('Salut MDX')} | ||
</div> | ||
``` | ||
|
||
|
||
## How-to? | ||
|
||
```jsx{5} | ||
import MySuperComponent from '../path/to/MySuperComponent' | ||
# Du text en Markdown | ||
<MySuperComponent /> | ||
Un autre texte en markdown | ||
``` | ||
|
||
## Read more | ||
|
||
👉 https://mdxjs.com |
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
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,43 @@ | ||
import React, { Fragment } from 'react' | ||
import styled from 'styled-components' | ||
import { colors } from '../tokens' | ||
|
||
const TranslationContainer = styled.div` | ||
border-radius: 5px; | ||
padding: 10px; | ||
margin-top: 10px; | ||
background-color: ${colors.lightYellow}; | ||
border: 1px solid ${colors.grey700}; | ||
` | ||
|
||
const InfoText = styled.span` | ||
color: ${colors.grey900}; | ||
` | ||
|
||
const TranslationLink = styled.a` | ||
color: ${colors.grey900}; | ||
text-decoration: underline; | ||
` | ||
|
||
class Translations extends React.Component { | ||
render() { | ||
const { translations } = this.props | ||
|
||
return ( | ||
<TranslationContainer> | ||
<InfoText>This article also exists in: </InfoText> | ||
{translations.map((translation, i) => { | ||
return ( | ||
<Fragment key={`translation-${i}`}> | ||
<TranslationLink href={translation.link}> | ||
{translation.language} | ||
</TranslationLink> | ||
{i < translations.length - 1 ? ', ' : ''} | ||
</Fragment> | ||
) | ||
})} | ||
</TranslationContainer> | ||
) | ||
} | ||
} | ||
export default Translations |
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 |
---|---|---|
|
@@ -64,6 +64,10 @@ export const pageQuery = graphql` | |
imageShare { | ||
publicURL | ||
} | ||
translations { | ||
language | ||
link | ||
} | ||
} | ||
} | ||
} | ||
|
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