Bläddra i källkod

#2093 images in statics

bach 1 år sedan
förälder
incheckning
2dc06a87fc
2 ändrade filer med 21 tillägg och 2 borttagningar
  1. 13 0
      assets/css/app.scss
  2. 8 2
      src/pages/Static.vue

+ 13 - 0
assets/css/app.scss

@@ -1174,6 +1174,19 @@ section[role="main-content"]{
       }
     }
   }
+
+  #static{
+    figure{
+      margin: 2em 0;
+      img{
+        max-width: 100%;
+      }
+      figcaption{
+        @include fontcaption;
+        padding: 1em 0; 
+      }
+    }
+  }
 }
 
 footer[role="tools"]{

+ 8 - 2
src/pages/Static.vue

@@ -1,11 +1,11 @@
 <template>
-  <MainContentLayout id="not-found" class="">
+  <MainContentLayout id="static" class="">
     <template v-slot:header>
       <span v-if="!page" class="loading">Chargement ...</span>
       <h1 v-else>{{ page.title }}</h1>
     </template>
 
-    <div v-if="page" v-html="page.tei" />
+    <div v-if="page" v-html="page.tei_parsed" />
 
   </MainContentLayout>
 </template>
@@ -66,6 +66,12 @@ export default {
           this.page = this.colophon[i]
         }
       }
+      this.parseContentImages()
+    },
+    parseContentImages () {
+      console.log('parseContentImages')
+      this.page.tei_parsed = this.page.tei.replace(/src="\/gdp\/static\/images\/(\w+)\.jpg"/g, `src="${window.apipath}/gdp/static/images/$1.jpg"`)
+      console.log(this.page.tei_parsed)
     }
   },
   metaInfo () {