2018-09-04 23:30:36 +00:00
|
|
|
<template>
|
2018-12-16 16:57:08 +00:00
|
|
|
<div>
|
2019-05-15 22:48:18 +00:00
|
|
|
<div class="md:flex">
|
2019-06-14 11:29:58 +00:00
|
|
|
<div class="w-full flex items-center md:w-1/3 lg:w-1/4">
|
2019-06-06 22:58:40 +00:00
|
|
|
<div class="w-3/4 py-6">
|
2019-03-26 01:53:09 +00:00
|
|
|
<div class="text-sm">
|
2019-03-26 15:57:08 +00:00
|
|
|
<a
|
2019-05-09 18:57:23 +00:00
|
|
|
href="/"
|
2019-06-06 22:19:39 +00:00
|
|
|
class="font-semibold text-white"
|
2019-03-26 15:57:08 +00:00
|
|
|
tabindex="-1"
|
|
|
|
>
|
2019-03-26 01:53:09 +00:00
|
|
|
{{ siteTitle }}
|
|
|
|
</a>
|
|
|
|
</div>
|
2018-12-29 23:41:01 +00:00
|
|
|
</div>
|
2018-09-04 23:30:36 +00:00
|
|
|
|
2019-05-15 22:48:18 +00:00
|
|
|
<div class="w-1/4 text-right md:hidden">
|
2019-03-26 15:57:08 +00:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="nav-toggle appearance-none"
|
|
|
|
aria-label="Toggle main menu"
|
|
|
|
@click="hidden = !hidden"
|
|
|
|
>
|
2019-06-06 22:19:39 +00:00
|
|
|
<svg class="fill-current text-white w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M16.4 9H3.6c-.552 0-.6.447-.6 1 0 .553.048 1 .6 1h12.8c.552 0 .6-.447.6-1 0-.553-.048-1-.6-1zm0 4H3.6c-.552 0-.6.447-.6 1 0 .553.048 1 .6 1h12.8c.552 0 .6-.447.6-1 0-.553-.048-1-.6-1zM3.6 7h12.8c.552 0 .6-.447.6-1 0-.553-.048-1-.6-1H3.6c-.552 0-.6.447-.6 1 0 .553.048 1 .6 1z"/></svg>
|
2018-12-19 20:41:47 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
2018-12-18 22:57:51 +00:00
|
|
|
</div>
|
2018-12-19 20:41:47 +00:00
|
|
|
|
2018-12-16 16:57:08 +00:00
|
|
|
<nav
|
2019-06-14 11:29:58 +00:00
|
|
|
class="block w-full absolute py-4 -mx-4 mt-2px bg-blue-700 border-b md:mt-0 md:mx-0 md:relative md:flex md:flex-wrap md:flex-1 md:justify-end md:bg-blue-500 md:border-b-0"
|
2019-06-06 22:19:39 +00:00
|
|
|
style="margin-top: 3px"
|
|
|
|
:class="{ hidden: hidden }"
|
2018-12-16 16:57:08 +00:00
|
|
|
role="navigation"
|
|
|
|
>
|
|
|
|
<a
|
2019-03-27 13:57:34 +00:00
|
|
|
v-for="(item, index) in items"
|
2019-03-26 15:57:08 +00:00
|
|
|
:key="index"
|
2019-06-14 11:29:58 +00:00
|
|
|
class="block py-3 px-4 mx-4 mt-1 -mb-px rounded text-sm text-white no-underline hover:underline focus:outline-none md:py-1 md:px-2 md:mx-2 md:mt-0 md:mr-0"
|
|
|
|
:class="{ 'cursor-default bg-blue-500 hover:border-blue-600 hover:no-underline md:bg-blue-700': isActive(item) }"
|
2018-12-19 20:45:19 +00:00
|
|
|
:href="item.href"
|
2018-12-16 16:57:08 +00:00
|
|
|
>
|
2018-12-19 20:45:19 +00:00
|
|
|
<span class="flex items-center h-full">{{ item.title }}</span>
|
2018-12-16 16:57:08 +00:00
|
|
|
</a>
|
|
|
|
</nav>
|
2018-09-04 23:30:36 +00:00
|
|
|
</div>
|
2018-12-16 16:57:08 +00:00
|
|
|
</div>
|
2018-09-04 23:30:36 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-12-19 20:30:35 +00:00
|
|
|
export default {
|
2018-12-19 20:37:10 +00:00
|
|
|
props: {
|
2019-03-26 15:57:08 +00:00
|
|
|
siteTitle: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
pageUrl: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
2018-12-19 20:30:35 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-12-18 22:57:51 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2018-12-19 20:45:19 +00:00
|
|
|
hidden: true,
|
2018-09-04 23:30:36 +00:00
|
|
|
|
2018-12-19 20:45:19 +00:00
|
|
|
items: [
|
2018-12-19 20:30:35 +00:00
|
|
|
{
|
|
|
|
title: 'About',
|
|
|
|
href: '/',
|
|
|
|
pattern: '^/.$',
|
|
|
|
},
|
2019-04-05 23:51:45 +00:00
|
|
|
{
|
|
|
|
title: 'Projects',
|
|
|
|
href: '/projects',
|
|
|
|
pattern: '^/projects/?$',
|
|
|
|
},
|
2018-12-19 20:30:35 +00:00
|
|
|
{
|
2019-01-15 08:34:39 +00:00
|
|
|
title: 'Articles',
|
|
|
|
href: '/articles',
|
|
|
|
pattern: '^/articles/?',
|
2018-12-19 20:30:35 +00:00
|
|
|
},
|
2019-01-15 22:35:23 +00:00
|
|
|
{
|
|
|
|
title: 'Talks',
|
|
|
|
href: '/talks',
|
|
|
|
pattern: '^/talks/?',
|
|
|
|
},
|
2019-03-08 10:11:46 +00:00
|
|
|
{
|
|
|
|
title: 'Podcasts',
|
|
|
|
href: '/podcasts',
|
|
|
|
pattern: '^/podcasts/?',
|
|
|
|
},
|
2018-12-19 20:30:35 +00:00
|
|
|
{
|
|
|
|
title: 'Book',
|
|
|
|
href: '/test-driven-drupal',
|
|
|
|
pattern: '^/test-driven-drupal/?$',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Contact',
|
|
|
|
href: '/contact',
|
|
|
|
pattern: '^/contact/?',
|
2018-12-19 20:45:19 +00:00
|
|
|
},
|
|
|
|
],
|
2018-12-19 20:30:35 +00:00
|
|
|
}
|
2018-12-19 20:45:19 +00:00
|
|
|
},
|
2019-03-26 15:57:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
isActive(item) {
|
|
|
|
return this.pageUrl.match(new RegExp(item.pattern))
|
|
|
|
}
|
|
|
|
}
|
2018-12-16 16:57:08 +00:00
|
|
|
}
|
2018-09-04 23:30:36 +00:00
|
|
|
</script>
|