Skip to content

Commit

Permalink
feat: support home page parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
albanm committed May 16, 2018
1 parent e9b9f30 commit 13213cd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/custom-environment-variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
__format: 'json'
},
contact: 'CONTACT',
homePage: 'HOME_PAGE',
secret: {
public: 'PUBLIC_KEY',
private: 'PRIVATE_KEY'
Expand Down
1 change: 1 addition & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
},
admins: ['[email protected]'],
contact: '[email protected]',
homePage: null,
storage: {
// One of 'file' and 'mongo'
type: 'mongo',
Expand Down
1 change: 1 addition & 0 deletions config/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
port: 5689,
publicUrl: 'http://localhost:5689',
admins: ['[email protected]'],
homePage: 'https://koumoul.com',
maildev: {
active: true
},
Expand Down
3 changes: 2 additions & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ module.exports = {
},
env: {
publicUrl: config.publicUrl,
theme: config.theme
theme: config.theme,
homePage: config.homePage
},
head: {
title: i18n.messages[config.defaultLocale].root.title,
Expand Down
6 changes: 5 additions & 1 deletion public/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@
<v-toolbar-side-icon @click.stop="drawer = !drawer"/>
<template v-if="localePath('index') !== $route.path">
<div class="logo-container">
<nuxt-link :to="localePath('index')" :title="$t('common.home')">
<a v-if="env.homePage" :href="env.homePage" :title="$t('common.home')">
<img v-if="env.theme.logo" :src="env.theme.logo">
<logo v-else/>
</a>
<nuxt-link v-else :to="localePath('index')" :title="$t('common.home')">
<img v-if="env.theme.logo" :src="env.theme.logo">
<logo v-else/>
</nuxt-link>
Expand Down

0 comments on commit 13213cd

Please sign in to comment.