Skip to content

Commit 2b73dd2

Browse files
authored
feat(#4): add nuxt image module (#5)
1 parent 6eab508 commit 2b73dd2

File tree

5 files changed

+1578
-16
lines changed

5 files changed

+1578
-16
lines changed

drupal/files/public/.htaccess

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Deny all requests from Apache 2.4+.
2+
<IfModule mod_authz_core.c>
3+
Require all denied
4+
</IfModule>
5+
6+
# Deny all requests from Apache 2.0-2.2.
7+
<IfModule !mod_authz_core.c>
8+
Deny from all
9+
</IfModule>
10+
11+
# Turn off all options we don't need.
12+
Options -Indexes -ExecCGI -Includes -MultiViews
13+
14+
# Set the catch-all handler to prevent scripts from being executed.
15+
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
16+
<Files *>
17+
# Override the handler again if we're run later in the evaluation list.
18+
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
19+
</Files>
20+
21+
# If we know how to do it safely, disable the PHP engine entirely.
22+
<IfModule mod_php7.c>
23+
php_flag engine off
24+
</IfModule>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<template>
2+
<DruxtEntity type="file--file" :uuid="model.data.id">
3+
<template #default="{ entity }">
4+
<NuxtImg :src="src(entity)" />
5+
</template>
6+
</DruxtEntity>
7+
</template>
8+
9+
<script>
10+
import { DruxtFieldMixin } from 'druxt-entity'
11+
export default {
12+
mixins: [DruxtFieldMixin],
13+
methods: {
14+
src(entity) {
15+
return [this.$druxt.settings.baseUrl, entity.attributes.uri.url].join('/')
16+
},
17+
},
18+
}
19+
</script>

nuxt/nuxt.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import opn from 'opn'
22

3-
const baseUrl = process.env.BASE_URL
3+
const baseUrl = process.env.BASE_URL || 'http://quickstart-druxt-serverless.ddev.site'
44

55
export default {
66
// Target full static build.
@@ -41,12 +41,12 @@ export default {
4141

4242
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
4343
buildModules: [
44+
['@nuxt/image', { domains: [baseUrl] }],
45+
'druxt-site',
4446
],
4547

4648
// Modules: https://go.nuxtjs.dev/config-modules
47-
modules: [
48-
'druxt-site',
49-
],
49+
modules: [],
5050

5151
// DruxtJS: https://druxtjs.org
5252
druxt: {

0 commit comments

Comments
 (0)