Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject lang into getStaticProps and company #93

Merged
merged 2 commits into from
Mar 24, 2020

Conversation

aralroca
Copy link
Owner

@aralroca aralroca commented Mar 24, 2020

Closes #92

from now on the lang will be available on getStaticProps, getStaticProps and getServerSideProps.

I'm going to explain it better in the docs for 0.13.0 version. But a simple example:

export function getStaticProps({ lang }){
   return { props: { data: getDataFromLang(lang) } }
}

@aralroca aralroca self-assigned this Mar 24, 2020
@aralroca aralroca changed the title Inject lang get static props and company Inject lang into getStaticProps and company Mar 24, 2020
@aralroca aralroca merged commit 0639694 into master Mar 24, 2020
@aralroca aralroca deleted the inject-lang-getStaticProps-and-company branch March 24, 2020 06:14
@aralroca aralroca added this to the 0.13.0 milestone Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access current lang in getStaticProps and getStaticPaths
1 participant