Add tags to projects dropdown links
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
"name": "Projects",
|
"name": "Projects",
|
||||||
"link": "/projects",
|
"link": "/projects",
|
||||||
"external": false,
|
"external": false,
|
||||||
"expandable": false
|
"expandable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "People",
|
"name": "People",
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
:key="element.name"
|
:key="element.name"
|
||||||
v-for="(element, index) in $static.metadata.navigation"
|
v-for="(element, index) in $static.metadata.navigation"
|
||||||
:class="{
|
:class="{
|
||||||
'mr-4':
|
'mr-2':
|
||||||
index != Object.keys($static.metadata.navigation).length - 1,
|
index != Object.keys($static.metadata.navigation).length - 1,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
x-data="{ open: false }"
|
x-data="{ open: false }"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
@click="open = !open"
|
@click="setActive(index)"
|
||||||
class="flex flex-row items-center w-full md:w-auto md:inline md:mt-0 md:ml-4 animated-link"
|
class="flex flex-row items-center w-full md:w-auto md:inline md:mt-0 md:ml-4 animated-link"
|
||||||
>
|
>
|
||||||
<span class="uppercase">{{ element.name }}</span>
|
<span class="uppercase">{{ element.name }}</span>
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<div
|
<div
|
||||||
v-if="open"
|
v-if="active == index"
|
||||||
x-show="open"
|
x-show="open"
|
||||||
x-transition:enter="transition ease-out duration-100"
|
x-transition:enter="transition ease-out duration-100"
|
||||||
x-transition:enter-start="transform opacity-0 scale-95"
|
x-transition:enter-start="transform opacity-0 scale-95"
|
||||||
@@ -131,6 +131,25 @@
|
|||||||
class="absolute w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48 z-30"
|
class="absolute w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48 z-30"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
v-if="element.name == 'Projects'"
|
||||||
|
class="px-2 py-2 bg-white rounded-md shadow dark:bg-gray-700"
|
||||||
|
>
|
||||||
|
<g-link
|
||||||
|
:to="element.link"
|
||||||
|
class="block px-4 py-2 mt-2 text-sm font-semibold bg-transparent rounded-lg dark:bg-transparent dark:hover:bg-gray-600 dark-:focus:bg-gray-600 dark:focus:text-white dark:hover:text-white dark:text-gray-200 md:mt-0 hover:text-gray-900 focus:text-gray-900 hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline"
|
||||||
|
>All</g-link
|
||||||
|
>
|
||||||
|
<g-link
|
||||||
|
v-for="edge in $static.allProjectTag.edges"
|
||||||
|
:key="edge.node.id"
|
||||||
|
class="block px-4 py-2 mt-2 text-sm font-semibold bg-transparent rounded-lg dark:bg-transparent dark:hover:bg-gray-600 dark-:focus:bg-gray-600 dark:focus:text-white dark:hover:text-white dark:text-gray-200 md:mt-0 hover:text-gray-900 focus:text-gray-900 hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline"
|
||||||
|
:to="edge.node.path"
|
||||||
|
>{{ edge.node.title }}</g-link
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-else
|
||||||
class="px-2 py-2 bg-white rounded-md shadow dark:bg-gray-700"
|
class="px-2 py-2 bg-white rounded-md shadow dark:bg-gray-700"
|
||||||
>
|
>
|
||||||
<g-link
|
<g-link
|
||||||
@@ -236,6 +255,7 @@ export default {
|
|||||||
isOpen: false,
|
isOpen: false,
|
||||||
search: "",
|
search: "",
|
||||||
open: false,
|
open: false,
|
||||||
|
active: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -249,6 +269,9 @@ export default {
|
|||||||
result() {
|
result() {
|
||||||
window.location.href = `/search?query=${this.search}`;
|
window.location.href = `/search?query=${this.search}`;
|
||||||
},
|
},
|
||||||
|
setActive(index) {
|
||||||
|
this.active = index;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -285,6 +308,15 @@ query {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
allProjectTag{
|
||||||
|
edges{
|
||||||
|
node{
|
||||||
|
id
|
||||||
|
title
|
||||||
|
path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</static-query>
|
</static-query>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user