Create Nuxt version
This commit is contained in:
41
bit-badger-solutions/components/global/HiddenSection.vue
Normal file
41
bit-badger-solutions/components/global/HiddenSection.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<section>
|
||||
<h3 @click="toggle()">
|
||||
{{ heading }}<span class="arrow" v-html="label"></span>
|
||||
</h3>
|
||||
<slot v-if="isVisible"></slot>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue'
|
||||
export default Vue.extend({
|
||||
name: 'hidden-section',
|
||||
props: [
|
||||
'heading'
|
||||
],
|
||||
data () {
|
||||
return {
|
||||
isVisible: false,
|
||||
label: '▼'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggle () {
|
||||
this.isVisible = !this.isVisible
|
||||
this.label = this.isVisible ? '▲' : '▼'
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
h3:hover {
|
||||
cursor: hand;
|
||||
cursor: pointer;
|
||||
}
|
||||
.arrow {
|
||||
font-size: .75rem;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
</style>
|
||||
108
bit-badger-solutions/components/global/HomeSidebar.vue
Normal file
108
bit-badger-solutions/components/global/HomeSidebar.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<aside class="app-sidebar">
|
||||
<div v-for="cat in sortedCats" :key="cat">
|
||||
<div class="app-sidebar-head" v-text="cat" />
|
||||
<div v-for="sln in displayForCategegory(cat)" :key="sln.title">
|
||||
<p class="app-sidebar-name">
|
||||
<strong>{{ sln.title }}</strong><br>
|
||||
<span v-if="!sln.noAboutLink">
|
||||
<nuxt-link :to="`/solutions/${sln.slug}`" :title="aboutTitle(sln.title)">About</nuxt-link> •
|
||||
</span>
|
||||
<a :href="sln.url" :title="sln.title" target="_blank">Visit</a>
|
||||
</p>
|
||||
<p class="app-sidebar-description" v-html="sln.frontPage.text" />
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue'
|
||||
|
||||
/**
|
||||
* Sort the categories in a specific order; any not addressed will appear at the bottom.
|
||||
*/
|
||||
const categoryOrder = (x: string, y: string) => {
|
||||
if (x === 'Web Sites and Applications') { return -1 }
|
||||
if (x === 'WordPress' && y !== 'Web Sites and Applications') { return -1 }
|
||||
if (x === 'Static Sites' && y !== 'Web Sites and Applications' && y !== 'WordPress') { return -1 }
|
||||
return 1
|
||||
}
|
||||
|
||||
export default Vue.extend({
|
||||
name: 'home-sidebar',
|
||||
props: ['catNames', 'solutions'],
|
||||
computed: {
|
||||
sortedCats (): string[] {
|
||||
return [...this.catNames].sort(categoryOrder)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
displayForCategegory (category: string): any[] {
|
||||
return this.solutions
|
||||
.filter((x: any) => x.category === category)
|
||||
.sort((x: any, y: any) => x.frontPage.order - y.frontPage.order)
|
||||
},
|
||||
aboutTitle (name: string): string {
|
||||
return `About ${name} | Bit Badger Solutions`
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-sidebar {
|
||||
text-align: center;
|
||||
border-top: dotted 1px lightgray;
|
||||
padding-top: 1rem;
|
||||
font-size: .9rem;
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.app-sidebar > div {
|
||||
width: 20rem;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
@media all and (min-width: 68rem) {
|
||||
.app-sidebar {
|
||||
width: 66rem;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
@media all and (min-width: 80rem) {
|
||||
.app-sidebar {
|
||||
width: 12rem;
|
||||
border-top: none;
|
||||
border-left: dotted 1px lightgray;
|
||||
padding-top: 0;
|
||||
padding-left: 2rem;
|
||||
flex-direction: column;
|
||||
}
|
||||
.app-sidebar > div {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
.app-sidebar a {
|
||||
font-size: 10pt;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
.app-sidebar-head {
|
||||
font-family: "Oswald", "Segoe UI", Ubuntu, "DejaVu Sans", "Liberation Sans", Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
color: maroon;
|
||||
margin-bottom: .8rem;
|
||||
padding: 3px 12px;
|
||||
border-bottom: solid 2px lightgray;
|
||||
font-size: 1rem;
|
||||
}
|
||||
.app-sidebar-name, .app-sidebar-description {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.app-sidebar-description {
|
||||
font-style: italic;
|
||||
color: #555555;
|
||||
padding-bottom: .6rem;
|
||||
}
|
||||
</style>
|
||||
29
bit-badger-solutions/components/global/SolutionItem.vue
Normal file
29
bit-badger-solutions/components/global/SolutionItem.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<p>
|
||||
<span class="app-name" v-html="solution.title"></span>
|
||||
~ <nuxt-link :to="'/solutions/' + solution.slug">About</nuxt-link>
|
||||
<span v-if="!solution.isInactive">~ <a :href="solution.url" target="_blank">Visit</a></span>
|
||||
<span v-if="solution.isInactive && solution.archiveUrl">
|
||||
~ <a :href="solution.archiveUrl" target="_blank">Visit</a><em> (archive)</em>
|
||||
</span>
|
||||
<br>
|
||||
<span v-html="solution.summary"></span>
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue'
|
||||
export default Vue.extend({
|
||||
name: 'solution-item',
|
||||
props: ['solution']
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-name {
|
||||
font-family: "Oswald", "Segoe UI", Ubuntu, "DejaVu Sans", "Liberation Sans", Arial, sans-serif;
|
||||
font-size: 1.3rem;
|
||||
font-weight: bold;
|
||||
color: maroon;
|
||||
}
|
||||
</style>
|
||||
58
bit-badger-solutions/components/global/TechnologyItem.vue
Normal file
58
bit-badger-solutions/components/global/TechnologyItem.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<li>
|
||||
<a v-if="hasLink(tech[0])" :href="techLinks[tech[0]]" target="_blank">{{ tech[0] }}</a>
|
||||
<template v-else>{{ tech[0] }}</template>
|
||||
for {{ tech[1] }}
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue'
|
||||
|
||||
/** Links to various technologies */
|
||||
const techLinks: any = {
|
||||
'ASP.NET MVC': 'https://dotnet.microsoft.com/apps/aspnet/mvc',
|
||||
Azure: 'https://azure.microsoft.com/',
|
||||
'BlogEngine.NET': 'http://www.dotnetblogengine.net/',
|
||||
'Database Abstraction': 'https://github.com/danieljsummers/DatabaseAbstraction',
|
||||
'Digital Ocean': 'https://www.digitalocean.com/',
|
||||
Giraffe: 'https://github.com/giraffe-fsharp/Giraffe',
|
||||
GitHub: 'https://github.com/',
|
||||
'GitHub Pages': 'https://pages.github.com/',
|
||||
Hexo: 'https://hexo.io/',
|
||||
Hugo: 'https://gohugo.io/',
|
||||
Jekyll: 'https://jekyllrb.com/',
|
||||
MongoDB: 'https://www.mongodb.com/',
|
||||
MySQL: 'https://www.mysql.com/',
|
||||
myWebLog: 'https://github.com/bit-badger/myWebLog',
|
||||
nginx: 'http://nginx.org/',
|
||||
Orchard: 'https://orchardproject.net/',
|
||||
PHP: 'https://www.php.net/',
|
||||
PostgreSQL: 'https://www.postgresql.org/',
|
||||
'Rackspace Cloud': 'https://www.rackspace.com/cloud',
|
||||
RavenDB: 'https://ravendb.net/',
|
||||
RethinkDB: 'https://rethinkdb.com/',
|
||||
'SQL Server': 'https://www.microsoft.com/en-us/sql-server/',
|
||||
'Vue.js': 'https://vuejs.org/',
|
||||
WordPress: 'https://wordpress.org'
|
||||
}
|
||||
|
||||
export default Vue.extend({
|
||||
name: 'technology-item',
|
||||
props: [ 'tech' ],
|
||||
data () {
|
||||
return { techLinks }
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* Does the given technology have a known link?
|
||||
*
|
||||
* @param tech The technology to be checked
|
||||
* @returns True if there is a link, false if not
|
||||
*/
|
||||
hasLink (tech: string): boolean {
|
||||
return techLinks[tech] !== undefined
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user