Skip to content

Commit

Permalink
refactor: use single LOCATION variable
Browse files Browse the repository at this point in the history
  • Loading branch information
danrocha committed May 20, 2021
1 parent d734f1f commit 84af782
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/HeaderCompact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="flex items-center justify-between pt-4 mx-auto">
<NuxtLink to="/" class="flex items-center space-x-2">
<NuxtImg src="/icon.png" class="w-10 h-10" />
<NuxtImg src="/icon-location.png" class="w-10 h-10" />
<NuxtImg :src="`/icon-${location}.png`" class="w-10 h-10" />
<p
v-if="content"
class="pl-4 font-bold tracking-wide text-gray-500 uppercase"
Expand All @@ -26,12 +26,12 @@ import {
export default defineComponent({
setup() {
const { $content } = useContext()
const { $content, env } = useContext()
const content = ref(null)
useFetch(async () => {
content.value = await $content('term').fetch()
})
return { content }
return { content, location: env.NUXT_APP_LOCATION }
},
})
</script>
7 changes: 6 additions & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
const LOCATION = 'bln'

export default {
env: {
NUXT_APP_LOCATION: LOCATION,
},
// Target: https://go.nuxtjs.dev/config-target
target: 'static',
generate: {
Expand Down Expand Up @@ -61,7 +66,7 @@ export default {

// Content module configuration: https://go.nuxtjs.dev/config-content
content: {
dir: 'content-bln',
dir: `content-${LOCATION}`,
},

// https://www.npmjs.com/package/@nuxtjs/markdownit
Expand Down
File renamed without changes

0 comments on commit 84af782

Please sign in to comment.