Skip to content

Commit

Permalink
Merge pull request #910 from zirreal/robonomics-wiki-test
Browse files Browse the repository at this point in the history
fixed navigation buttons
  • Loading branch information
zirreal authored Oct 24, 2024
2 parents 5cb6adc + feb5511 commit d765ad1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
17 changes: 15 additions & 2 deletions src/assets/css/pages/doc/doc.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
flex-direction: column;
text-align: right;
padding: 1rem;
grid-column-start: 1;
grid-column-end: 2;
/* grid-column-start: 1;
grid-column-end: 2; */
}

.pageNextPrev a.second {
Expand Down Expand Up @@ -160,4 +160,17 @@
}
}

@media screen and (max-width: 460px) {
.pageNextPrev {
display: flex;
flex-direction: column;
}

.pageNextPrev a {
display: flex;
width: 100%;
}

}


9 changes: 4 additions & 5 deletions src/assets/js/components/navButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ document.addEventListener('DOMContentLoaded', function () {
let prev = prevPage(flatten(config), index)
let next = nextPage(flatten(config),index)

const translatedNext = translateLine(next.title, language);
const translatedPrev = translateLine(prev.title, language);


if(curr.next) {
next = curr.next[0]
}
Expand All @@ -82,10 +78,13 @@ document.addEventListener('DOMContentLoaded', function () {
prev = curr.prev[0]
}

const translatedNext = translateLine(next.title, language);
const translatedPrev = translateLine(prev.title, language);

const prevLink = prev.topic ? prev.url + '/?topic=' + prev.topic.replace(/\s+/g, '-').toLowerCase() : prev.url;
const nextLink = next.topic ? next.url + '/?topic=' + next.topic.replace(/\s+/g, '-').toLowerCase() : next.url;

navigationBlock.innerHTML = `<a href="${language !== 'en' ? "/" + language + prevLink : prevLink}" class="button inline-block secondary button__medium custom"><span class="additional-text">${translateLine('previous', language)}</span> ← ${translatedPrev ? translatedPrev : prev.title}</a><a href="${language !== 'en' ? "/" + language + nextLink : nextLink}" class="button inline-block secondary button__medium"><span class="additional-text">${translateLine('next', language)}</span> ${translatedNext ? translatedNext : next.title} →</a>`
navigationBlock.innerHTML = `<a href="${language !== 'en' ? "/" + language + prevLink : prevLink}" class="button inline-block secondary button__medium custom"><span class="additional-text">${translateLine('previous', language)}</span> ← ${translatedPrev ? translatedPrev : prev.title}</a><a href="${language !== 'en' ? "/" + language + nextLink : nextLink}" class="button inline-block secondary button__medium custom"><span class="additional-text">${translateLine('next', language)}</span> ${translatedNext ? translatedNext : next.title} →</a>`
}

}
Expand Down
6 changes: 0 additions & 6 deletions src/ko/pages/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,3 @@ description: Learn Robonomics through tutorials and practically useful experimen
</div>


{# for translation
{{'Home Assistant integration' | t}}
{{'Robonomics smart devices' | t}}
{{'Working with parachain' | t}}
#}

0 comments on commit d765ad1

Please sign in to comment.