Skip to content

Commit

Permalink
minor: primary navigation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TalhaFaisalglor committed May 1, 2024
1 parent 94339f3 commit 7987cb1
Show file tree
Hide file tree
Showing 37 changed files with 213 additions and 936 deletions.
11 changes: 9 additions & 2 deletions src/client-side/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ function setupNavHandlers() {

setupNavHandlers();

function openModalIFrame(url:string) {
function openModalIFrame(url: string) {
const template = document.querySelector<HTMLTemplateElement>('#modal-iframe-template');

const frag = template?.content.cloneNode(true) as DocumentFragment;
const frag = template?.content.cloneNode(true) as DocumentFragment;
console.log(frag)
if (frag) {
const div = frag.querySelector(".modal-iframe");
Expand Down Expand Up @@ -161,3 +161,10 @@ const openDetailsOnFragmentIdNavigation = () => {
openDetailsOnFragmentIdNavigation();
window.addEventListener("hashchange", openDetailsOnFragmentIdNavigation);

// Ensure all links open in the same tab
const allLinks: NodeListOf<HTMLAnchorElement> = document.querySelectorAll('a');
allLinks.forEach((link: HTMLAnchorElement) => {
link.setAttribute('target', '_self');
});


3 changes: 2 additions & 1 deletion src/pages/_data/navigation/headerNav.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{ title: "Ideology", url: "/ideology/", class:"" },
{ title: "Concepts", url: "/concepts/", class:"" },
{ title: "Developer Onboarding", url: "/dev-onboarding/", class:"" },
{ title: "Glossary", url: "/glossary/", class:"" },
{ title: "Training", url: "/training/", class:"" },
{ title: "Help", url: "/help/", class:"" },
]
}
164 changes: 67 additions & 97 deletions src/pages/_data/navigation/mainNav.json5
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
{
links: [
"links": [
{
title: "Getting Started", url: "/getting-started/", children: [
"title": "Getting Started",
"url": "/getting-started/",
"children": [
{
title: "Where to start", children: [
{ title: "Start from Scratch", url: "/getting-started/from-scratch/" },
{ title: "IOS", url: "/getting-started/frameworks/ios/" },
{ title: "Ruby", url: "/getting-started/frameworks/ruby/" },
{ title: "Android", url: "/getting-started/frameworks/android/" },
{ title: "Python", url: "/getting-started/frameworks/python/" },
{ title: "Laravel", url: "/getting-started/frameworks/laravel/" },
{ title: "Django", url: "/getting-started/frameworks/django/" },
{ title: "Flask", url: "/getting-started/frameworks/flask/" },
{ title: "React", url: "/getting-started/frameworks/react/" },
{ title: "Spring", url: "/getting-started/frameworks/spring/" },
{ title: "Groovy", url: "/getting-started/frameworks/groovy/" },]
"title": "Where to start",
"children": [
{ "title": "Start from Scratch", "url": "/getting-started/from-scratch/" },
{ "title": "IOS", "url": "/getting-started/frameworks/ios/" },
{ "title": "Ruby", "url": "/getting-started/frameworks/ruby/" },
{ "title": "Android", "url": "/getting-started/frameworks/android/" },
{ "title": "Python", "url": "/getting-started/frameworks/python/" },
{ "title": "Laravel", "url": "/getting-started/frameworks/laravel/" },
{ "title": "Django", "url": "/getting-started/frameworks/django/" },
{ "title": "Flask", "url": "/getting-started/frameworks/flask/" },
{ "title": "React", "url": "/getting-started/frameworks/react/" },
{ "title": "Spring", "url": "/getting-started/frameworks/spring/" },
{ "title": "Groovy", "url": "/getting-started/frameworks/groovy/" }
]
},
{
title: "Development Theatre", url: "/getting-started/development-theatre/", children: []
},
"title": "Development Theatre",
"url": "/getting-started/development-theatre/",
"children": []
}
]
},
{
Expand All @@ -29,98 +35,62 @@
"title": "Learn",
"url": "/dev-onboarding/learn/",
"children": [
{
"title": "Building a Root Skill View",
"url": "/dev-onboarding/learn/rootskillview/"
},
{
"title": "Managing your Family Members",
"url": "/dev-onboarding/learn/members/"
},
{
"title": "Managing your Metadata",
"url": "/dev-onboarding/learn/metadata/"
},
{
"title": "Creating Multi-card Forms",
"url": "/dev-onboarding/learn/multi-card-forms/"
},
{
"title": "Generating Personalized Stories",
"url": "/dev-onboarding/learn/personalized-stories/"
},
{
"title": "Long Running Operations",
"url": "/dev-onboarding/learn/long-running-operations/"
},
{
"title": "Sharing the Story",
"url": "/dev-onboarding/learn/share-story/"
}
]
},
{
"title": "Train",
"url": "/dev-onboarding/train/",
"children": [
{
"title": "Errors",
"url": "/dev-onboarding/train/errors/"
},
{
"title": "Schemas",
"url": "/dev-onboarding/train/schemas/"
},
{
"title": "Stores",
"url": "/dev-onboarding/train/stores/"
},
{
"title": "Events",
"url": "/dev-onboarding/train/events/"
},
{
"title": "Tests",
"url": "/dev-onboarding/train/tests/"
},
{
"title": "Views",
"url": "/dev-onboarding/train/views/"
},
{
"title": "Listeners",
"url": "/dev-onboarding/train/listeners/"
},
{
"title": "Mercury",
"url": "/dev-onboarding/train/mercury/"
}
{ "title": "Building a Root Skill View", "url": "/dev-onboarding/learn/rootskillview/" },
{ "title": "Managing your Family Members", "url": "/dev-onboarding/learn/members/" },
{ "title": "Managing your Metadata", "url": "/dev-onboarding/learn/metadata/" },
{ "title": "Creating Multi-card Forms", "url": "/dev-onboarding/learn/multi-card-forms/" },
{ "title": "Generating Personalized Stories", "url": "/dev-onboarding/learn/personalized-stories/" },
{ "title": "Long Running Operations", "url": "/dev-onboarding/learn/long-running-operations/" },
{ "title": "Sharing the Story", "url": "/dev-onboarding/learn/share-story/" }
]
}
]
},
{
title: "Concepts", url: "/concepts/", children: [
{ title: "Errors", url: "/concepts/mercury/" },
{ title: "Events", url: "/concepts/views/" },
{ title: "Listeners", url: "/concepts/tests/" },
{ title: "Schemas", url: "/concepts/events/" },
{ title: "Stores", url: "/concepts/stores/" },
{ title: "Tests", url: "/concepts/schemas/" },
{ title: "Views", url: "/concepts/listeners/" },
{ title: "Mercury", url: "/concepts/errors/" },
"title": "Training",
"url": "/training/",
"children": [
{ "title": "Building a Root Skill View", "url": "/training/errors/" },
{ "title": "Managing your Family Members", "url": "/training/schemas/" },
{ "title": "Managing your Metadata", "url": "/training/stores/" },
{ "title": "Creating Multi-card Forms", "url": "/training/events/" },
{ "title": "Generating Personalized Stories", "url": "/training/tests/" },
{ "title": "Long Running Operations", "url": "/training/views/" },
{ "title": "Sharing the Story", "url": "/training/listeners/" },
{ "title": "Sharing the Story", "url": "/training/mercury/" }
]
},
{
title: "Ideology", url: "/ideology/", children: [
{ title: "Architecture", url: "/ideology/architecture/" },
{ title: "Test-Driven Development", url: "/ideology/tdd/" },
{ title: "Clean Code", url: "/ideology/clean-code/" },
"title": "Concepts",
"url": "/concepts/",
"children": [
{ "title": "Errors", "url": "/concepts/errors/" },
{ "title": "Events", "url": "/concepts/views/" },
{ "title": "Listeners", "url": "/concepts/tests/" },
{ "title": "Schemas", "url": "/concepts/events/" },
{ "title": "Stores", "url": "/concepts/stores/" },
{ "title": "Tests", "url": "/concepts/schemas/" },
{ "title": "Views", "url": "/concepts/listeners/" },
{ "title": "Mercury", "url": "/concepts/mercury/" },
{ "title": "Permissions", "url": "/concepts/permissions/" }
]
},
{
title: "Glossary", url: "/glossary/", children: [
"title": "Ideology",
"url": "/ideology/",
"children": [
{ "title": "Architecture", "url": "/ideology/architecture/" },
{ "title": "Test-Driven Development", "url": "/ideology/tdd/" },
{ "title": "Clean Code", "url": "/ideology/clean-code/" }
]
},
{
"title": "Help",
"url": "/help/",
"children": [
{ "title": "Glossary", "url": "/help/glossary/" },
{ "title": "Contact", "url": "/help/contact/" }
]
}
]
}
}
16 changes: 16 additions & 0 deletions src/pages/_includes/widgets/home-tiles.njk
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,20 @@
<p>Onboarding materials that ensure a seamless initiation process into the Sprucebot ecosystem.</p>
</div>
{% endlinkTile %}

{% linkTile "/training/" | url, "home-tile" %}
{{ personReadingIcon() }}
<div class="text-wrapper">
<h2>Training</h2>
<p>Learn how to use Sprucebot to its full potential.</p>
</div>
{% endlinkTile %}

{% linkTile "/help/" | url, "home-tile" %}
{{ rocketshipIcon() }}
<div class="text-wrapper">
<h2>Help</h2>
<p>Get help with Sprucebot.</p>
</div>
{% endlinkTile %}
</div>
4 changes: 2 additions & 2 deletions src/pages/_includes/widgets/navigation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<a href="{{ '/getting-started/' | url }}" class="btn-text">Getting Started</a>
<a href="{{ '/ideology/' | url }}" class="btn-text">Ideology</a>
<a href="{{ '/concepts/' | url }}" class="btn-text">Concepts</a>
<a href="{{ '/dev-onboarding/' | url }}" class="btn-text">Developer Onboarding</a>
<a href="{{ '/glossary/' | url }}" class="btn-text">Glossary</a>
<a href="{{ '/dev-onboarding/' | url }}" class="btn-text">Training</a>
<a href="{{ '/glossary/' | url }}" class="btn-text">Help</a>
</li>
{% for topLink in mainNavData.links %}
{% set isCurrentParent = topLink.url == activeParent.url %}
Expand Down
63 changes: 1 addition & 62 deletions src/pages/concepts/concepts.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,6 @@
---
title: Concepts
---
<style>
.guide-sections {
display: flex;
flex-direction: column;
gap: 10px;
}

.section-link {
display: flex;
align-items: center;
text-decoration: none;
padding: 10px;
border-radius: 5px;
background-color: #f0f0f0;
color: #333;
transition: background-color 0.3s, transform 0.3s;
}

.section-link:hover {
background-color: #0EDDD3;
transform: scale(1.05); /* Slightly increase the size */
}

.section-number {
font-weight: bold;
margin-right: 10px;
}

.disabled {
opacity: 0.5;
cursor: default;
}

.disabled:hover {
background-color: #f0f0f0;
transform: none; /* No transformation for disabled links */
}
</style>

Concepts are a key part of spruce development, they handle the different parts of a sprucebot application, such as errors, stores, events, etc. This section of our guide offers a breakdown of all the sprucebot concepts.

Expand Down Expand Up @@ -75,27 +37,4 @@ Concepts are a key part of spruce development, they handle the different parts o
<span class="section-number">Section 8</span>
<span class="section-title">Mercury</span>
</a>
</div>

<script>
document.addEventListener('DOMContentLoaded', (event) => {
// Select all chapter links
const sectionLinks = document.querySelectorAll('.section-link');

// Add a click event listener to each chapter link
sectionLinks.forEach(link => {
link.addEventListener('click', function(e) {
// Prevent default action if the link is disabled
if (this.classList.contains('disabled')) {
e.preventDefault();
}
});
});

// Ensure all links open in the same tab
const allLinks = document.querySelectorAll('a');
allLinks.forEach(link => {
link.setAttribute('target', '_self');
});
});
</script>
</div>
3 changes: 3 additions & 0 deletions src/pages/concepts/permissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title:: Permissions
---
Loading

0 comments on commit 7987cb1

Please sign in to comment.