Skip to content

Commit 7a4e66b

Browse files
committed
feat: format title, added string utility functions module, refactor: removed unused logo component, updated gitignore for vscode
1 parent 92be999 commit 7a4e66b

File tree

8 files changed

+465
-127
lines changed

8 files changed

+465
-127
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ dist
8484
# IDE / Editor
8585
.idea
8686
.editorconfig
87+
.vscode
8788

8889
# Service worker
8990
sw.*

components/Logo.vue

-79
This file was deleted.

components/MenuLinks.vue

-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ export default {
4646
</script>
4747

4848
<style lang="scss">
49-
.row {
50-
justify-content: flex-end;
51-
}
52-
5349
.mobile {
5450
display: flex;
5551
flex-direction: column;

layouts/default.vue

+54-36
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
<template>
22
<v-app>
33
<!-- Header Area -->
4-
<v-app-bar app elevate-on-scroll height="100px" fixed flat light tile>
5-
<v-toolbar-title>BrandLogo</v-toolbar-title>
4+
<v-app-bar
5+
app
6+
elevate-on-scroll
7+
flat
8+
:height="navHeight"
9+
hide-on-scroll
10+
light
11+
scroll-threshold="200"
12+
tile
13+
>
14+
<v-toolbar-title>{{ appTitle.substring(0,10) + "..." }}</v-toolbar-title>
615
<v-spacer />
716
<v-app-bar-nav-icon class="hidden-md-and-up" @click.stop="drawer = !drawer" />
8-
<MenuLinks :general-links="generalLinks" list-class="row hidden-md-and-down" />
17+
<MenuLinks :general-links="generalLinks" list-class="hidden-sm-and-down" />
918
</v-app-bar>
1019
<!-- side/mobile navigation -->
1120
<v-navigation-drawer v-model="drawer" :mini-variant="miniVariant" fixed right>
@@ -16,15 +25,17 @@
1625
<nuxt />
1726
</v-content>
1827
<!-- Footer Area -->
19-
<v-footer>
28+
<v-footer class="py-6">
29+
<h2>{{ appTitle }}</h2>
30+
<p>{{ appDescription }}</p>
2031
<ul>
2132
<li v-for="(link, i) in footerLinks" :key="i + link.title">
2233
<v-btn text rounded>{{ link.title }}</v-btn>
2334
</li>
2435
</ul>
2536
<v-container>
26-
{{ new Date().getFullYear() }}
27-
<strong>{{title}}</strong>
37+
{{ new Date().getFullYear() }}&nbsp;-&nbsp;
38+
<strong>{{ appTitle }}</strong>
2839
</v-container>
2940
</v-footer>
3041
</v-app>
@@ -39,8 +50,10 @@ export default {
3950
},
4051
data() {
4152
return {
53+
appTitle: process.env.title,
54+
appDescription: process.env.description,
4255
drawer: false,
43-
fixed: false,
56+
// add footer links here
4457
footerLinks: [
4558
{
4659
title: 'Home',
@@ -60,31 +73,36 @@ export default {
6073
},
6174
{
6275
title: 'Blog',
63-
to: '/'
76+
to: '/blog'
6477
},
6578
{
6679
title: 'Contact Us',
6780
to: '/'
6881
}
6982
],
83+
// add main nav links here
84+
// material design icons https://materialdesignicons.com/
7085
generalLinks: [
7186
{
87+
icon: 'mdi-home',
7288
title: 'Home',
7389
to: '/'
7490
},
7591
{
92+
icon: 'mdi-post',
7693
title: 'Blog',
7794
to: '/blog'
7895
}
7996
],
80-
miniVariant: false,
81-
title: 'Nuxt Netfliy CMS Stater Kit'
97+
miniVariant: false
8298
}
8399
}
84100
}
85101
</script>
86102

87103
<style lang="scss">
104+
// global
105+
88106
*,
89107
*:before,
90108
*:after {
@@ -110,40 +128,38 @@ body {
110128
overflow-x: hidden;
111129
}
112130
113-
// nav
114-
115-
.v-toolbar__title {
116-
font-size: 2rem;
117-
font-weight: 900;
118-
margin-left: 2rem;
131+
.v-card__title {
132+
word-break: break-word;
119133
}
120134
121-
.v-list {
122-
display: flex;
123-
align-items: center;
124-
margin-right: 2rem;
135+
// main nav
125136
126-
.v-list-item {
127-
flex: 0;
128-
margin: 0 0.5rem;
129-
padding: 0 1.5rem;
137+
.v-toolbar__content {
138+
.v-toolbar__title {
139+
font-size: 2rem;
140+
font-weight: 900;
141+
margin-left: 2rem;
142+
}
130143
131-
.v-list-item__title {
132-
font-size: 1.33rem;
133-
font-weight: 400;
144+
.v-list {
145+
background: none;
146+
display: flex;
147+
align-items: center;
148+
margin-right: 2rem;
149+
150+
.v-list-item {
151+
flex: 0;
152+
margin: 0 0.5rem;
153+
padding: 0 1.5rem;
154+
155+
.v-list-item__title {
156+
font-size: 1.33rem;
157+
font-weight: 400;
158+
}
134159
}
135160
}
136161
}
137162
138-
.v-card__title {
139-
word-break: break-word;
140-
}
141-
142-
.justify-space-evenly {
143-
justify-content: space-around;
144-
justify-content: space-evenly;
145-
}
146-
147163
// footer
148164
149165
.v-footer {
@@ -164,4 +180,6 @@ body {
164180
padding: 1rem 0;
165181
}
166182
}
183+
184+
// global styles shared among pages can go here
167185
</style>

nuxt.config.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
import colors from 'vuetify/es5/util/colors'
2+
import * as strUtil from './utils/str-utils.js'
3+
4+
// format package name for title display
5+
const title = strUtil.titleCase(process.env.npm_package_name.replace(/-/g, " "));
26

37
export default {
48
mode: 'universal',
59
/*
6-
** Headers of the page
10+
** env variables used in vue components
711
*/
12+
env: {
13+
title: title || '',
14+
description: process.env.npm_package_description || '',
15+
},
816
/*
917
** Headers of the page
1018
*/
1119
head: {
1220
htmlAttrs: {
1321
lang: 'en',
1422
},
15-
title: 'Nuxt Netlify CMS Starter',
23+
title: title || '',
1624
meta: [{
1725
charset: 'utf-8'
1826
},

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
"eslint-plugin-prettier": "^3.0.1",
2626
"prettier": "^1.16.4"
2727
}
28-
}
28+
}

pages/index.vue

-5
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@
2727
</template>
2828

2929
<script>
30-
import Logo from '~/components/Logo.vue'
31-
3230
export default {
33-
components: {
34-
Logo
35-
},
3631
head() {
3732
return {
3833
script: [

0 commit comments

Comments
 (0)