aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example/config.json3
-rw-r--r--example/readme.md6
-rw-r--r--example/src/Glacier 3000/_DSC5475.jpg (renamed from example/Glacier 3000/_DSC5475.jpg)bin363216 -> 363216 bytes
-rw-r--r--example/src/Glacier 3000/_DSC5475.jpg.yaml (renamed from example/Glacier 3000/_DSC5475.jpg.yaml)0
-rw-r--r--example/src/Glacier 3000/_DSC5542.jpg (renamed from example/Glacier 3000/_DSC5542.jpg)bin457873 -> 457873 bytes
-rw-r--r--example/src/Glacier 3000/_DSC5542.jpg.yaml (renamed from example/Glacier 3000/_DSC5542.jpg.yaml)0
-rw-r--r--example/src/Glacier 3000/thumbnail.jpg (renamed from example/Glacier 3000/thumbnail.jpg)bin457873 -> 457873 bytes
-rw-r--r--example/src/_DSC8808-1.jpg (renamed from example/_DSC8808-1.jpg)bin1010643 -> 1010643 bytes
-rw-r--r--example/src/_DSC8808-1.jpg.yaml (renamed from example/_DSC8808-1.jpg.yaml)0
-rw-r--r--example/src/gallery.yaml (renamed from example/gallery.yaml)0
-rw-r--r--ldgallery.1.md6
-rw-r--r--scripts/win_compile_example.cmd4
-rw-r--r--viewer/.env6
-rw-r--r--viewer/.env.development3
-rw-r--r--viewer/public/config.json.example (renamed from viewer/public/config.json)1
-rw-r--r--viewer/readme.md4
-rw-r--r--viewer/src/@types/gallery.d.ts4
-rw-r--r--viewer/src/components/LdPicture.vue12
-rw-r--r--viewer/src/components/LdThumbnail.vue7
-rw-r--r--viewer/src/store/galleryStore.ts18
-rw-r--r--viewer/src/views/MainLayout.vue3
-rw-r--r--viewer/vue.config.js2
22 files changed, 51 insertions, 28 deletions
diff --git a/example/config.json b/example/config.json
new file mode 100644
index 0000000..6483257
--- /dev/null
+++ b/example/config.json
@@ -0,0 +1,3 @@
1{
2 "galleryRoot": "out/"
3}
diff --git a/example/readme.md b/example/readme.md
index d5a7563..e455f03 100644
--- a/example/readme.md
+++ b/example/readme.md
@@ -8,7 +8,8 @@ Content
8------- 8-------
9 9
10``` 10```
11./example 11./example/out -- the output directory for the compiled version of the gallery
12./example/src -- source directory with pictures, configuration, tags and metadata
12├── _DSC8808-1.jpg -- a picture 13├── _DSC8808-1.jpg -- a picture
13├── _DSC8808-1.jpg.yaml -- its associated sidecar metadata file 14├── _DSC8808-1.jpg.yaml -- its associated sidecar metadata file
14├── Glacier 3000 -- a directory grouping gallery items 15├── Glacier 3000 -- a directory grouping gallery items
@@ -17,6 +18,5 @@ Content
17│   ├── _DSC5475.jpg.yaml 18│   ├── _DSC5475.jpg.yaml
18│   ├── _DSC5542.jpg 19│   ├── _DSC5542.jpg
19│   └── _DSC5542.jpg.yaml 20│   └── _DSC5542.jpg.yaml
20├── gallery.yaml -- gallery settings file 21└── gallery.yaml -- gallery settings file
21└── readme.md -- this README
22``` 22```
diff --git a/example/Glacier 3000/_DSC5475.jpg b/example/src/Glacier 3000/_DSC5475.jpg
index 9835447..9835447 100644
--- a/example/Glacier 3000/_DSC5475.jpg
+++ b/example/src/Glacier 3000/_DSC5475.jpg
Binary files differ
diff --git a/example/Glacier 3000/_DSC5475.jpg.yaml b/example/src/Glacier 3000/_DSC5475.jpg.yaml
index 3454a68..3454a68 100644
--- a/example/Glacier 3000/_DSC5475.jpg.yaml
+++ b/example/src/Glacier 3000/_DSC5475.jpg.yaml
diff --git a/example/Glacier 3000/_DSC5542.jpg b/example/src/Glacier 3000/_DSC5542.jpg
index 19a716e..19a716e 100644
--- a/example/Glacier 3000/_DSC5542.jpg
+++ b/example/src/Glacier 3000/_DSC5542.jpg
Binary files differ
diff --git a/example/Glacier 3000/_DSC5542.jpg.yaml b/example/src/Glacier 3000/_DSC5542.jpg.yaml
index d174911..d174911 100644
--- a/example/Glacier 3000/_DSC5542.jpg.yaml
+++ b/example/src/Glacier 3000/_DSC5542.jpg.yaml
diff --git a/example/Glacier 3000/thumbnail.jpg b/example/src/Glacier 3000/thumbnail.jpg
index 19a716e..19a716e 100644
--- a/example/Glacier 3000/thumbnail.jpg
+++ b/example/src/Glacier 3000/thumbnail.jpg
Binary files differ
diff --git a/example/_DSC8808-1.jpg b/example/src/_DSC8808-1.jpg
index 51b43b0..51b43b0 100644
--- a/example/_DSC8808-1.jpg
+++ b/example/src/_DSC8808-1.jpg
Binary files differ
diff --git a/example/_DSC8808-1.jpg.yaml b/example/src/_DSC8808-1.jpg.yaml
index b946ff7..b946ff7 100644
--- a/example/_DSC8808-1.jpg.yaml
+++ b/example/src/_DSC8808-1.jpg.yaml
diff --git a/example/gallery.yaml b/example/src/gallery.yaml
index ea23d8a..ea23d8a 100644
--- a/example/gallery.yaml
+++ b/example/src/gallery.yaml
diff --git a/ldgallery.1.md b/ldgallery.1.md
index 8928693..f071344 100644
--- a/ldgallery.1.md
+++ b/ldgallery.1.md
@@ -126,9 +126,6 @@ compiler.pictureMaxResolution.width
126compiler.pictureMaxResolution.height 126compiler.pictureMaxResolution.height
127: Maximum height in pixels of the picture items, unlimited by default. 127: Maximum height in pixels of the picture items, unlimited by default.
128 128
129viewer.defaultSearchMode [TODO]
130: Default search view mode ("highlight" or "filter"). Defaults to "filter".
131
132viewer.defaultSearchQuery [TODO] 129viewer.defaultSearchQuery [TODO]
133: Default search query string. 130: Default search query string.
134 131
@@ -138,9 +135,6 @@ viewer.defaultSortOrder [TODO]
138viewer.tagGroups[].tag [TODO] 135viewer.tagGroups[].tag [TODO]
139: Tag prefix defining the tag group. 136: Tag prefix defining the tag group.
140 137
141viewer.tagGroups[].order [TODO]
142: Order in which to display tag groups.
143
144viewer.tagGroups[].colour [TODO] 138viewer.tagGroups[].colour [TODO]
145: Colour associated to the tag group. 139: Colour associated to the tag group.
146 140
diff --git a/scripts/win_compile_example.cmd b/scripts/win_compile_example.cmd
index e89b302..1226269 100644
--- a/scripts/win_compile_example.cmd
+++ b/scripts/win_compile_example.cmd
@@ -3,8 +3,8 @@ SET rebuild=--rebuild
3CHOICE /M "Rebuild all ('--rebuild' argument)?" 3CHOICE /M "Rebuild all ('--rebuild' argument)?"
4IF ERRORLEVEL 2 SET rebuild= 4IF ERRORLEVEL 2 SET rebuild=
5echo. 5echo.
6cd ..\compiler\
6 7
7@echo on 8@echo on
8cd ..\compiler\ 9stack exec ldgallery-compiler-exe -- %rebuild% --clean-output -i=../example/src/ -o=../example/out/
9stack exec ldgallery-compiler-exe -- %rebuild% --clean-output -i=../example/ -o=../example/out/
10@pause 10@pause
diff --git a/viewer/.env b/viewer/.env
index 959477b..0914292 100644
--- a/viewer/.env
+++ b/viewer/.env
@@ -1,5 +1,5 @@
1# Override with .env.development.local and .env.production.local
2
1VUE_APP_I18N_LOCALE=en 3VUE_APP_I18N_LOCALE=en
2VUE_APP_I18N_FALLBACK_LOCALE=en 4VUE_APP_I18N_FALLBACK_LOCALE=en
3VUE_APP_EXAMPLE_PROJECT=../example/out/ 5VUE_APP_DATA_URL=./
4VUE_APP_DATA_URL=gallery/
5VUE_APP_DEVSERVER_PORT=8085
diff --git a/viewer/.env.development b/viewer/.env.development
new file mode 100644
index 0000000..0d87cf4
--- /dev/null
+++ b/viewer/.env.development
@@ -0,0 +1,3 @@
1VUE_APP_DEVSERVER_PORT=8085
2VUE_APP_DEVSERVER_CONFIG_PATH=../example/
3VUE_APP_DATA_URL=~/
diff --git a/viewer/public/config.json b/viewer/public/config.json.example
index 7023edb..90c5f74 100644
--- a/viewer/public/config.json
+++ b/viewer/public/config.json.example
@@ -1,4 +1,3 @@
1{ 1{
2 "generationTimestamp": 0,
3 "galleryRoot": "gallery/" 2 "galleryRoot": "gallery/"
4} \ No newline at end of file 3} \ No newline at end of file
diff --git a/viewer/readme.md b/viewer/readme.md
index 864dcc6..3757f3e 100644
--- a/viewer/readme.md
+++ b/viewer/readme.md
@@ -8,6 +8,10 @@ npm install
8``` 8```
9 9
10### Compiles and hot-reloads for development 10### Compiles and hot-reloads for development
11
12The viewer DevServer will serve the compiled version of the example gallery by default.
13To override, create a file .env.development.local
14
11``` 15```
12npm run serve 16npm run serve
13``` 17```
diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.d.ts
index 14a7ed9..03d21fc 100644
--- a/viewer/src/@types/gallery.d.ts
+++ b/viewer/src/@types/gallery.d.ts
@@ -18,6 +18,10 @@
18*/ 18*/
19 19
20declare namespace Gallery { 20declare namespace Gallery {
21 interface Config {
22 galleryRoot: string,
23 }
24
21 interface Other extends Item { 25 interface Other extends Item {
22 properties: OtherProperties, 26 properties: OtherProperties,
23 } 27 }
diff --git a/viewer/src/components/LdPicture.vue b/viewer/src/components/LdPicture.vue
index 8a9a08e..a5faeb3 100644
--- a/viewer/src/components/LdPicture.vue
+++ b/viewer/src/components/LdPicture.vue
@@ -28,7 +28,7 @@
28 @dragscrollend="dragScrollClickFix.onDragScrollEnd()" 28 @dragscrollend="dragScrollClickFix.onDragScrollEnd()"
29 > 29 >
30 <v-lazy-image 30 <v-lazy-image
31 :src="pictureSrc()" 31 :src="pictureSrc(picture.properties.resource)"
32 :class="{'slow-loading': Boolean(slowLoadingStyle)}" 32 :class="{'slow-loading': Boolean(slowLoadingStyle)}"
33 :style="slowLoadingStyle" 33 :style="slowLoadingStyle"
34 @load="clearSlowLoading" 34 @load="clearSlowLoading"
@@ -67,15 +67,17 @@ export default class LdPicture extends Vue {
67 this.loader = false; 67 this.loader = false;
68 } 68 }
69 69
70 pictureSrc() { 70 pictureSrc(resource: string) {
71 return `${process.env.VUE_APP_DATA_URL}${this.picture.properties.resource}`; 71 return `${process.env.VUE_APP_DATA_URL}${this.$galleryStore.config!.galleryRoot}${resource}`;
72 } 72 }
73 73
74 generateSlowLoadingStyle() { 74 generateSlowLoadingStyle() {
75 this.clearSlowLoading(); 75 this.clearSlowLoading();
76 this.loader = true; 76 this.loader = true;
77 if (this.picture.thumbnail) 77 if (this.picture.thumbnail) {
78 this.slowLoadingStyle = `background-image: url('${process.env.VUE_APP_DATA_URL}${this.picture.thumbnail.resource}');`; 78 const url = this.pictureSrc(this.picture.thumbnail.resource);
79 this.slowLoadingStyle = `background-image: url('${url}');`;
80 }
79 } 81 }
80} 82}
81</script> 83</script>
diff --git a/viewer/src/components/LdThumbnail.vue b/viewer/src/components/LdThumbnail.vue
index 17c7659..13468e1 100644
--- a/viewer/src/components/LdThumbnail.vue
+++ b/viewer/src/components/LdThumbnail.vue
@@ -21,7 +21,7 @@
21 <div :class="{'preload': loading}"> 21 <div :class="{'preload': loading}">
22 <v-lazy-image 22 <v-lazy-image
23 v-if="item.thumbnail" 23 v-if="item.thumbnail"
24 :src="pictureSrc()" 24 :src="pictureSrc(item.thumbnail.resource)"
25 :style="pictureStyle()" 25 :style="pictureStyle()"
26 :title="item.title" 26 :title="item.title"
27 @intersect="loading=true" 27 @intersect="loading=true"
@@ -44,9 +44,8 @@ export default class LdThumbnail extends Vue {
44 44
45 loading: boolean = false; 45 loading: boolean = false;
46 46
47 pictureSrc() { 47 pictureSrc(resource: string) {
48 const resource = this.item.thumbnail!.resource; 48 return `${process.env.VUE_APP_DATA_URL}${this.$galleryStore.config!.galleryRoot}${resource}`;
49 return `${process.env.VUE_APP_DATA_URL}${resource}`;
50 }