Skip to content

Commit

Permalink
Merge pull request #74 from kalwalt/fixing-#68
Browse files Browse the repository at this point in the history
Fixing #68
  • Loading branch information
kalwalt committed Apr 12, 2019
2 parents dab8029 + 94697b0 commit 82d9e61
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import menuTree from '../data/menuTree'
const getIdJsonUrl = (id, langKey, jsonData) => {
if(id !== 'undefined'){
let res;
id = Number(id - 1);
switch (langKey) {
//we get the name of the page according the id
case 'en':
Expand Down Expand Up @@ -78,8 +77,9 @@ class TemplateWrapper extends Component {
this.langKey = getCurrentLangKey(langs, defaultLangKey, url);
this.homeLink = `/${this.langKey}/`;
this.langsMenu = getLangs(langs, this.langKey, getUrlForLang(this.homeLink, url));
const id_article = data.markdownRemark.frontmatter.id;
const basename = check_path(this.langKey, url, id_article, jsonData);
const id_article = data.markdownRemark.frontmatter.id;;
const id = Number(id_article) - 1;
const basename = check_path(this.langKey, url, id, jsonData);
var basePath = startPath(this.langKey, this.langsMenu, basename[0], url);
//finally here we set the desired url...
setLangsMenu( this.langsMenu, basename[1], basePath, jsonData);
Expand Down
3 changes: 2 additions & 1 deletion src/pages/blog/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ title: Blog index page.
date: 2019-03-24
description: Index page for all blog posts.
lang: en
path: /en/blog/
path: /en/blog
slug: /en/blog
tags:
- art
---
3 changes: 2 additions & 1 deletion src/pages/blog/index.it.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ title: Pagina indice blog.
date: 2019-03-24
description: Pagina indice per tutti i blog posts.
lang: it
path: /it/blog/
path: /it/blog
slug: /it/blog
tags:
- art
---
4 changes: 2 additions & 2 deletions src/templates/blog-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ BlogIndexPage.propTypes = {
}

export const pageQuery = graphql`
query BlogIndex
query BlogIndex($id: String!)
{
site {
siteMetadata {
Expand All @@ -76,7 +76,7 @@ export const pageQuery = graphql`
}
}
}
markdownRemark
markdownRemark(id: { eq: $id })
{
id
html
Expand Down

0 comments on commit 82d9e61

Please sign in to comment.