├── .browserslistrc ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── README.md ├── babel.config.js ├── custom_types ├── index.json └── page.json ├── package-lock.json ├── package.json ├── public ├── favicon.png └── index.html ├── src ├── App.vue ├── assets │ ├── css │ │ ├── prismic-edit-button.css │ │ ├── resetr.css │ │ └── tutorial │ │ │ ├── highlight.min.css │ │ │ └── tutorial.min.css │ └── img │ │ ├── prismic-logo.svg │ │ ├── tutorial │ │ ├── bb.gif │ │ ├── chevron.svg │ │ ├── open.svg │ │ └── rocket.svg │ │ └── vue-logo.png ├── components │ └── FooterPrismic.vue ├── main.js ├── prismic │ ├── html-serializer.js │ └── link-resolver.js ├── router.js └── views │ ├── NotFound.vue │ ├── Preview.vue │ └── Tutorial.vue └── vue.config.js /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 8 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Prismic Vue.js Starter 2 | 3 | > [Vue.js](https://vuejs.org) starter project with content managed in [Prismic](https://prismic.io) 4 | 5 | ## How to launch this project in your local environment 6 | 7 | Run the following commands: 8 | 9 | ``` bash 10 | npm install 11 | npm run serve 12 | ``` 13 | 14 | Then you can access it at [http://localhost:8080](http://localhost:8080). 15 | You'll find a tutorial that explains how to create your first Vue component filled with content retrieved from Prismic. 16 | 17 | ## How to remove the tutorial from this project 18 | 19 | - Remove Tutorial import and route in src/router/index.js 20 | - Delete Tutorial component file `rm src/views/Tutorial.vue` 21 | - Delete Tutorial assets `rm -r src/assets/css/tutorial/ && rm -r src/assets/img/tutorial/` 22 | - Remove vue-highlightjs dependency `npm uninstall vue-highlightjs` 23 | 24 | ## Project setup 25 | ``` bash 26 | npm install 27 | ``` 28 | 29 | ### Compiles and hot-reloads for development 30 | ``` bash 31 | npm run serve 32 | ``` 33 | 34 | ### Compiles and minifies for production 35 | ``` bash 36 | npm run build 37 | ``` 38 | 39 | ### Lints and fixes files 40 | ``` bash 41 | npm run lint 42 | ``` 43 | 44 | ## License 45 | 46 | This software is licensed under the Apache 2 license, quoted below. 47 | 48 | Copyright 2013-2018 Prismic (http://prismic.io). 49 | 50 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 51 | 52 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 53 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /custom_types/index.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "id": "page", 3 | "name": "Page", 4 | "repeatable": true, 5 | "value": "page.json" 6 | }] -------------------------------------------------------------------------------- /custom_types/page.json: -------------------------------------------------------------------------------- 1 | { 2 | "Main" : { 3 | "uid" : { 4 | "type" : "UID", 5 | "config" : { 6 | "placeholder" : "UID...", 7 | "label" : "UID" 8 | } 9 | }, 10 | "title" : { 11 | "type" : "StructuredText", 12 | "config" : { 13 | "single" : "heading1", 14 | "label" : "Title", 15 | "placeholder" : "Title..." 16 | } 17 | }, 18 | "description" : { 19 | "type" : "StructuredText", 20 | "config" : { 21 | "multi" : "paragraph, heading2, strong, em, hyperlink", 22 | "allowTargetBlank" : true, 23 | "label" : "Description", 24 | "placeholder" : "Description..." 25 | } 26 | }, 27 | "cta_link" : { 28 | "type" : "Link", 29 | "config" : { 30 | "allowTargetBlank" : true, 31 | "label" : "CTA link", 32 | "placeholder" : "CTA link..." 33 | } 34 | }, 35 | "cta_text" : { 36 | "type" : "StructuredText", 37 | "config" : { 38 | "single" : "paragraph", 39 | "label" : "CTA text", 40 | "placeholder" : "CTA text..." 41 | } 42 | }, 43 | "icon" : { 44 | "type" : "Image" 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prismic-vuejs-starter", 3 | "version": "1.2.0", 4 | "description": "Vue.js starter project with content managed in Prismic", 5 | "license": "Apache-2.0", 6 | "repository": "github:prismicio/vuejs-starter", 7 | "author": "Prismic", 8 | "scripts": { 9 | "serve": "vue-cli-service serve", 10 | "build": "vue-cli-service build" 11 | }, 12 | "dependencies": { 13 | "prismic-dom": "^2.1.0", 14 | "prismic-vue": "^1.3.0", 15 | "vue": "^2.5.16", 16 | "vue-highlightjs": "^1.3.3", 17 | "vue-router": "^3.0.1" 18 | }, 19 | "devDependencies": { 20 | "@vue/cli-plugin-babel": "^3.0.0-rc.5", 21 | "@vue/cli-service": "^3.0.0-rc.5", 22 | "vue-template-compiler": "^2.5.16" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prismicio/vuejs-starter/80f73e7883c834ec298cf80ff7f9e4b3f0f266f5/public/favicon.png -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Prismic Vue.js Starter 8 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | 22 |
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | 19 | 23 | -------------------------------------------------------------------------------- /src/assets/css/prismic-edit-button.css: -------------------------------------------------------------------------------- 1 | .wio-link { 2 | position: fixed; 3 | bottom: 30px; 4 | right: 30px; 5 | 6 | display: inline-flex; 7 | justify-content: center; 8 | align-items: center; 9 | width: 48px; 10 | height: 48px; 11 | border-radius: 24px; 12 | background-color: #fafafa; 13 | box-shadow: 0 2px 7px 0 rgba(90, 90, 140, 0.40); 14 | } 15 | -------------------------------------------------------------------------------- /src/assets/css/resetr.css: -------------------------------------------------------------------------------- 1 | /** 2 | * resetr.css v3.0.0 3 | * MIT License 4 | * github.com/jbdebiasio/resetr.css 5 | * 6 | * Based on ress.css v1.2.2 and normalize.css v8.0.0 7 | * github.com/filipelinhares/ress 8 | * github.com/necolas/normalize.css 9 | */ 10 | 11 | /* # ================================================================= 12 | # Global selectors 13 | # ================================================================= */ 14 | 15 | html { 16 | box-sizing: border-box; 17 | background: white; 18 | color: black; 19 | font-family: sans-serif; 20 | font-size: 16px; 21 | line-height: 1.15; 22 | -ms-text-size-adjust: 100%; 23 | -webkit-text-size-adjust: 100%; /* iOS 8+ */ 24 | } 25 | 26 | *, 27 | ::before, 28 | ::after { 29 | box-sizing: inherit; 30 | } 31 | 32 | ::before, 33 | ::after { 34 | text-decoration: inherit; /* Inherit text-decoration and vertical align to ::before and ::after pseudo elements */ 35 | vertical-align: inherit; 36 | } 37 | 38 | * { 39 | padding: 0; /* Reset `padding` and `margin` of all elements */ 40 | margin: 0; 41 | font: inherit; 42 | } 43 | 44 | /* # ================================================================= 45 | # General elements 46 | # ================================================================= */ 47 | 48 | /* Add the correct display in iOS 4-7.*/ 49 | audio:not([controls]) { 50 | display: none; 51 | height: 0; 52 | } 53 | 54 | hr { 55 | height: 0; 56 | overflow: visible; /* Show the overflow in Edge and IE */ 57 | } 58 | 59 | /* 60 | * Correct `block` display not defined for any HTML5 element in IE 8/9 61 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 62 | * and Firefox 63 | * Correct `block` display not defined for `main` in IE 11 64 | */ 65 | article, 66 | aside, 67 | details, 68 | figcaption, 69 | figure, 70 | footer, 71 | header, 72 | main, 73 | menu, 74 | nav, 75 | section, 76 | summary { 77 | display: block; 78 | } 79 | 80 | summary { 81 | display: list-item; /* Add the correct display in all browsers */ 82 | } 83 | 84 | small { 85 | font-size: 80%; /* Set font-size to 80% in `small` elements */ 86 | } 87 | 88 | [hidden], 89 | template { 90 | display: none; /* Add the correct display in IE */ 91 | } 92 | 93 | abbr[title] { 94 | border-bottom: none; 95 | text-decoration: underline; 96 | text-decoration: underline dotted; 97 | } 98 | 99 | a { 100 | background-color: transparent; /* Remove the gray background on active links in IE 10 */ 101 | color: inherit; 102 | text-decoration: none; 103 | -webkit-text-decoration-skip: objects; /* Remove gaps in links underline in iOS 8+ and Safari 8+ */ 104 | } 105 | 106 | a:active, 107 | a:hover { 108 | outline-width: 0; /* Remove the outline when hovering in all browsers */ 109 | } 110 | 111 | code, 112 | kbd, 113 | pre, 114 | samp { 115 | font-family: monospace, monospace; /* Specify the font family of code elements */ 116 | } 117 | 118 | /* Correct style set to `bold` in Edge 12+, Safari 6.2+, and Chrome 18+ */ 119 | strong { 120 | font-weight: bolder; 121 | } 122 | 123 | /* Addition */ 124 | em { 125 | font-style: italic; 126 | } 127 | 128 | /* Address styling not present in IE 8/9 */ 129 | mark { 130 | background-color: #ff0; 131 | color: #000; 132 | } 133 | 134 | /* https://gist.github.com/unruthless/413930 */ 135 | sub, 136 | sup { 137 | font-size: 75%; 138 | line-height: 0; 139 | position: relative; 140 | vertical-align: baseline; 141 | } 142 | 143 | sub { 144 | bottom: -0.25em; 145 | } 146 | 147 | sup { 148 | top: -0.5em; 149 | } 150 | 151 | /* # ================================================================= 152 | # Forms 153 | # ================================================================= */ 154 | 155 | input { 156 | border-radius: 0; 157 | } 158 | 159 | /* Apply cursor pointer to button elements */ 160 | button, 161 | [type="button"], 162 | [type="reset"], 163 | [type="submit"], 164 | [role="button"] { 165 | cursor: pointer; 166 | } 167 | 168 | /* Replace pointer cursor in disabled elements */ 169 | [disabled] { 170 | cursor: default; 171 | } 172 | 173 | [type="number"] { 174 | width: auto; /* Firefox 36+ */ 175 | } 176 | 177 | [type="search"]::-webkit-search-cancel-button, 178 | [type="search"]::-webkit-search-decoration { 179 | -webkit-appearance: none; /* Safari 8 */ 180 | } 181 | 182 | textarea { 183 | overflow: auto; /* Internet Explorer 11+ */ 184 | resize: vertical; /* Specify textarea resizability */ 185 | } 186 | 187 | button, 188 | input { 189 | overflow: visible; /* Address `overflow` set to `hidden` in IE 8/9/10/11 */ 190 | } 191 | 192 | /* Remove inner padding and border in Firefox 4+ */ 193 | button::-moz-focus-inner, 194 | [type="button"]::-moz-focus-inner, 195 | [type="reset"]::-moz-focus-inner, 196 | [type="submit"]::-moz-focus-inner { 197 | border-style: 0; 198 | padding: 0; 199 | } 200 | 201 | /* Replace focus style removed in the border reset above */ 202 | button:-moz-focusring, 203 | [type="button"]::-moz-focus-inner, 204 | [type="reset"]::-moz-focus-inner, 205 | [type="submit"]::-moz-focus-inner { 206 | outline: 1px dotted ButtonText; 207 | } 208 | 209 | button, 210 | html [type="button"], /* Prevent a WebKit bug where (2) destroys native `audio` and `video`controls in Android 4 */ 211 | [type="reset"], 212 | [type="submit"] { 213 | -webkit-appearance: button; /* Correct the inability to style clickable types in iOS */ 214 | } 215 | 216 | button, 217 | select { 218 | text-transform: none; /* Firefox 40+, Internet Explorer 11- */ 219 | } 220 | 221 | /* Remove the default button styling in all browsers */ 222 | button, 223 | input, 224 | select, 225 | textarea { 226 | background-color: transparent; 227 | border-style: none; 228 | color: inherit; 229 | } 230 | 231 | /* Correct the cursor style of increment and decrement buttons in Chrome. */ 232 | [type="number"]::-webkit-inner-spin-button, 233 | [type="number"]::-webkit-outer-spin-button { 234 | height: auto; 235 | } 236 | 237 | /* Style select like a standard input */ 238 | select { 239 | -moz-appearance: none; /* Firefox 36+ */ 240 | -webkit-appearance: none; /* Chrome 41+ */ 241 | } 242 | 243 | select::-ms-expand { 244 | display: none; /* Internet Explorer 11+ */ 245 | } 246 | 247 | select::-ms-value { 248 | color: currentColor; /* Internet Explorer 11+ */ 249 | } 250 | 251 | legend { 252 | border: 0; /* Correct `color` not being inherited in IE 8/9/10/11 */ 253 | color: inherit; /* Correct the color inheritance from `fieldset` elements in IE */ 254 | display: table; /* Correct the text wrapping in Edge and IE */ 255 | max-width: 100%; /* Correct the text wrapping in Edge and IE */ 256 | white-space: normal; /* Correct the text wrapping in Edge and IE */ 257 | } 258 | 259 | ::-webkit-file-upload-button { 260 | -webkit-appearance: button; /* Correct the inability to style clickable types in iOS and Safari */ 261 | font: inherit; /* Change font properties to `inherit` in Chrome and Safari */ 262 | } 263 | 264 | [type="search"] { 265 | -webkit-appearance: textfield; /* Correct the odd appearance in Chrome and Safari */ 266 | outline-offset: -2px; /* Correct the outline style in Safari */ 267 | } 268 | 269 | /* # ================================================================= 270 | # Specify media element style 271 | # ================================================================= */ 272 | 273 | img { 274 | border-style: none; /* Remove border when inside `a` element in IE 8/9/10 */ 275 | } 276 | 277 | /* Add the correct vertical alignment in Chrome, Firefox, and Opera */ 278 | progress { 279 | vertical-align: baseline; 280 | } 281 | 282 | svg:not(:root) { 283 | overflow: hidden; /* Internet Explorer 11- */ 284 | } 285 | 286 | img, 287 | svg, 288 | audio, 289 | canvas, 290 | progress, 291 | video { 292 | display: inline-block; /* Internet Explorer 11+, Windows Phone 8.1+ */ 293 | } 294 | 295 | /* # ================================================================= 296 | # Accessibility 297 | # ================================================================= */ 298 | 299 | /* Hide content from screens but not screenreaders */ 300 | @media screen { 301 | [hidden~="screen"] { 302 | display: inherit; 303 | } 304 | [hidden~="screen"]:not(:active):not(:focus):not(:target) { 305 | position: absolute !important; 306 | clip: rect(0 0 0 0) !important; 307 | } 308 | } 309 | 310 | /* Specify the progress cursor of updating elements */ 311 | [aria-busy="true"] { 312 | cursor: progress; 313 | } 314 | 315 | /* Specify the pointer cursor of trigger elements */ 316 | [aria-controls] { 317 | cursor: pointer; 318 | } 319 | 320 | /* Specify the unstyled cursor of disabled, not-editable, or otherwise inoperable elements */ 321 | [aria-disabled] { 322 | cursor: default; 323 | } 324 | 325 | /* # ================================================================= 326 | # Selection 327 | # ================================================================= */ 328 | 329 | /* Specify text selection background color and omit drop shadow */ 330 | 331 | ::-moz-selection { 332 | background-color: #b3d4fc; /* Required when declaring ::selection */ 333 | color: #000; 334 | text-shadow: none; 335 | } 336 | 337 | ::selection { 338 | background-color: #b3d4fc; /* Required when declaring ::selection */ 339 | color: #000; 340 | text-shadow: none; 341 | } 342 | -------------------------------------------------------------------------------- /src/assets/css/tutorial/highlight.min.css: -------------------------------------------------------------------------------- 1 | .hljs{display:block;overflow-x:auto;padding:0.5em;background:#F0F0F0}.hljs,.hljs-subst{color:#444}.hljs-comment{color:#888888}.hljs-keyword,.hljs-attribute,.hljs-selector-tag,.hljs-meta-keyword,.hljs-doctag,.hljs-name{font-weight:bold}.hljs-type,.hljs-string,.hljs-number,.hljs-selector-id,.hljs-selector-class,.hljs-quote,.hljs-template-tag,.hljs-deletion{color:#880000}.hljs-title,.hljs-section{color:#880000;font-weight:bold}.hljs-regexp,.hljs-symbol,.hljs-variable,.hljs-template-variable,.hljs-link,.hljs-selector-attr,.hljs-selector-pseudo{color:#BC6060}.hljs-literal{color:#78A960}.hljs-built_in,.hljs-bullet,.hljs-code,.hljs-addition{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold} 2 | -------------------------------------------------------------------------------- /src/assets/css/tutorial/tutorial.min.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i);#prismic-tutorial a,#prismic-tutorial header nav a:hover{text-decoration:underline}#prismic-tutorial .hljs-emphasis,#prismic-tutorial section em{font-style:italic}#prismic-tutorial{color:#516677;font-family:Lato,Arial,sans-serif;font-size:18px;line-height:1.9;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#prismic-tutorial header{color:#fff;background-image:linear-gradient(-180deg,#4545AE 0,#673AB7 100%);padding:35px 50px 0;line-height:1.6em;margin:auto;height:940px;position:relative}#prismic-tutorial header .hero-curve{-webkit-clip-path:polygon(100% 100%,100% 0,0 100%);-moz-clip-path:polygon(100% 100%,100% 0,0 100%);-o-clip-path:polygon(100% 100%,100% 0,0 100%);clip-path:polygon(100% 100%,100% 0,0 100%);display:block;position:absolute;bottom:0;left:0;z-index:1;width:100%;height:300px;background-color:#fff}#prismic-tutorial header nav{display:flex;justify-content:space-between;max-width:960px;margin:auto}#prismic-tutorial header nav a{color:#fff;text-decoration:none;font-size:16px}#prismic-tutorial header nav a.doc{color:#d8d8ff;display:flex}#prismic-tutorial header nav a.doc img{margin-left:10px}#prismic-tutorial header nav a strong{font-weight:700}#prismic-tutorial header .wrapper{max-width:550px;margin:70px auto 0;text-align:center}#prismic-tutorial header h1{font-weight:700;font-size:26px}#prismic-tutorial header .wrapper p{font-size:18px;font-weight:400;text-align:center;line-height:30px}#prismic-tutorial header .flip-flap{width:960px;max-width:90%;position:absolute;left:50%;transform:translateX(-50%);bottom:40px;z-index:1;perspective:960px}#prismic-tutorial header .flip-flap .flipper{transition:.6s;transform-style:preserve-3d;position:relative;animation-name:flipFlap;animation-duration:4s;animation-delay:2s;animation-iteration-count:1;animation-timing-function:ease-in-out}@-webkit-keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}@-moz-keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}@-o-keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}@keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}#prismic-tutorial header .flip-flap .gif,#prismic-tutorial header .flip-flap .guide{backface-visibility:hidden}#prismic-tutorial header .flip-flap .guide{padding:40px 80px;background-color:#fff;box-shadow:0 10px 17px 0 rgba(44,49,126,.2);transform:rotateX(0);position:relative;z-index:2;border-radius:4px}#prismic-tutorial header .flip-flap .gif{height:480px;background-image:url(../../img/tutorial/bb.gif);background-size:102%;background-position:-3px 90%;box-shadow:0 10px 17px 0 rgba(44,49,126,.2);transform:rotateX(180deg);position:absolute;top:-35px;left:0;right:0;bottom:0}#prismic-tutorial header .guide a{color:#516677;text-decoration:none}#prismic-tutorial header .guide a:hover{text-decoration:underline}#prismic-tutorial section{max-width:800px;margin:auto;padding:100px 50px 50px}#prismic-tutorial section strong{font-weight:700}#prismic-tutorial h1{margin:10px 0;font-size:28px;font-weight:400;line-height:52px;text-align:center}#prismic-tutorial h2,#prismic-tutorial h3{font-size:24px;color:#324150}#prismic-tutorial h2{margin:40px 0;font-weight:700}#prismic-tutorial h3{position:relative;margin:40px 0;font-weight:400;padding:0 0 0 45px}#prismic-tutorial h3 span,#prismic-tutorial ul li span{position:absolute;background:#FFCE80;border-radius:100%;padding:4px 13px;font-weight:400;font-size:14px;color:#fff;left:0;top:7px}#prismic-tutorial ul li span{top:20px;padding:0 10px}#prismic-tutorial .guide ul li span{top:25px}#prismic-tutorial h4{font-size:18px;line-height:32px;font-weight:700;margin:15px 0;color:#324150}#prismic-tutorial section p{margin-bottom:10px}#prismic-tutorial ul{list-style:none;padding:0;margin:0}#prismic-tutorial ul li{align-items:center;color:#516677;font-size:16px;font-weight:700;position:relative;padding:25px 0 25px 45px;border-bottom:1px solid #E0EAF1}#prismic-tutorial ul li img{position:absolute;right:0}#prismic-tutorial ul li.done{opacity:.4}#prismic-tutorial ul li.done:after{content:"Done!";position:absolute;right:0;font-weight:initial}#prismic-tutorial ul li:last-child{border-bottom:none}#prismic-tutorial .source-code{position:relative;width:100%;margin:40px 0}#prismic-tutorial .source-code code{width:100%;padding:20px;line-height:1.5;font-family:monospace;font-size:14px}#prismic-tutorial .hljs{display:block;overflow-x:auto;padding:.5em;background:#F1F6F8;border-radius:10px;font-size:16px;color:#506677}#prismic-tutorial .hljs-doctag,#prismic-tutorial .hljs-keyword,#prismic-tutorial .hljs-name,#prismic-tutorial .hljs-section,#prismic-tutorial .hljs-selector-tag,#prismic-tutorial .hljs-strong,#prismic-tutorial .hljs-title{color:#DC982C;font-weight:400}#prismic-tutorial .hljs-comment{color:#9AACBB}#prismic-tutorial .hljs-addition,#prismic-tutorial .hljs-attribute,#prismic-tutorial .hljs-built_in,#prismic-tutorial .hljs-bullet,#prismic-tutorial .hljs-deletion,#prismic-tutorial .hljs-link,#prismic-tutorial .hljs-literal,#prismic-tutorial .hljs-meta,#prismic-tutorial .hljs-name,#prismic-tutorial .hljs-quote,#prismic-tutorial .hljs-regexp,#prismic-tutorial .hljs-section,#prismic-tutorial .hljs-selector-class,#prismic-tutorial .hljs-selector-id,#prismic-tutorial .hljs-string,#prismic-tutorial .hljs-subst,#prismic-tutorial .hljs-symbol,#prismic-tutorial .hljs-tag,#prismic-tutorial .hljs-template-variable,#prismic-tutorial .hljs-title,#prismic-tutorial .hljs-type,#prismic-tutorial .hljs-variable{color:#68D496} 2 | -------------------------------------------------------------------------------- /src/assets/img/prismic-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Logo-Main-Version 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/assets/img/tutorial/bb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prismicio/vuejs-starter/80f73e7883c834ec298cf80ff7f9e4b3f0f266f5/src/assets/img/tutorial/bb.gif -------------------------------------------------------------------------------- /src/assets/img/tutorial/chevron.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/assets/img/tutorial/open.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/assets/img/tutorial/rocket.svg: -------------------------------------------------------------------------------- 1 | Artboard 2 | -------------------------------------------------------------------------------- /src/assets/img/vue-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prismicio/vuejs-starter/80f73e7883c834ec298cf80ff7f9e4b3f0f266f5/src/assets/img/vue-logo.png -------------------------------------------------------------------------------- /src/components/FooterPrismic.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 25 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import PrismicVue from 'prismic-vue' 3 | import linkResolver from './prismic/link-resolver' 4 | import htmlSerializer from './prismic/html-serializer' 5 | import App from './App.vue' 6 | import router from './router' 7 | 8 | Vue.config.productionTip = false 9 | 10 | Vue.use(PrismicVue, { 11 | endpoint: window.prismic.endpoint, 12 | linkResolver, 13 | htmlSerializer 14 | }) 15 | 16 | new Vue({ 17 | router, 18 | render: h => h(App) 19 | }).$mount('#app') 20 | -------------------------------------------------------------------------------- /src/prismic/html-serializer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * To learn more about HTML Serializer check out the Prismic documentation 3 | * https://prismic.io/docs/vuejs/beyond-the-api/html-serializer 4 | */ 5 | 6 | import prismicDOM from 'prismic-dom' 7 | import linkResolver from './link-resolver' 8 | 9 | const Elements = prismicDOM.RichText.Elements 10 | 11 | export default function (type, element, content, children) { 12 | // Generate links to Prismic Documents as components 13 | // Present by default, it is recommended to keep this 14 | if (type === Elements.hyperlink) { 15 | let result = '' 16 | const url = prismicDOM.Link.url(element.data, linkResolver) 17 | 18 | if (element.data.link_type === 'Document') { 19 | result = `${content}` 20 | } else { 21 | const target = element.data.target ? `target="'${element.data.target}'" rel="noopener"` : '' 22 | result = `${content}` 23 | } 24 | return result 25 | } 26 | 27 | // If the image is also a link to a Prismic Document, it will return a component 28 | // Present by default, it is recommended to keep this 29 | if (type === Elements.image) { 30 | let result = `${element.alt || ''}` 31 | 32 | if (element.linkTo) { 33 | const url = prismicDOM.Link.url(element.linkTo, linkResolver) 34 | 35 | if (element.linkTo.link_type === 'Document') { 36 | result = `${result}` 37 | } else { 38 | const target = element.linkTo.target ? `target="${element.linkTo.target}" rel="noopener"` : '' 39 | result = `${result}` 40 | } 41 | } 42 | const wrapperClassList = [element.label || '', 'block-img'] 43 | result = `

${result}

` 44 | return result 45 | } 46 | 47 | // Return null to stick with the default behavior for everything else 48 | return null 49 | } 50 | -------------------------------------------------------------------------------- /src/prismic/link-resolver.js: -------------------------------------------------------------------------------- 1 | /** 2 | * To learn more about Link Resolving check out the Prismic documentation 3 | * https://prismic.io/docs/vuejs/beyond-the-api/link-resolving 4 | */ 5 | 6 | export default function (doc) { 7 | if (doc.isBroken) { 8 | return '/not-found' 9 | } 10 | 11 | if (doc.type === 'home') { 12 | return '/' 13 | } 14 | 15 | if (doc.type === 'page') { 16 | return '/page/' + doc.uid 17 | } 18 | 19 | return '/not-found' 20 | } 21 | -------------------------------------------------------------------------------- /src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import NotFound from './views/NotFound.vue' 4 | import Preview from './views/Preview.vue' 5 | import Tutorial from './views/Tutorial.vue' 6 | 7 | Vue.use(Router) 8 | 9 | export default new Router({ 10 | mode: 'history', 11 | routes: [ 12 | { 13 | path: '/', 14 | redirect: { name: 'tutorial' } 15 | }, 16 | { 17 | path: '/not-found', 18 | name: 'not-found', 19 | component: NotFound 20 | }, 21 | { 22 | path: '/preview', 23 | name: 'preview', 24 | component: Preview 25 | }, 26 | { 27 | path: '/tutorial', 28 | name: 'tutorial', 29 | component: Tutorial 30 | }, 31 | { 32 | path: '*', 33 | redirect: { name: 'not-found' } 34 | } 35 | ] 36 | }) 37 | -------------------------------------------------------------------------------- /src/views/NotFound.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /src/views/Preview.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 22 | -------------------------------------------------------------------------------- /src/views/Tutorial.vue: -------------------------------------------------------------------------------- 1 | 283 | 284 | 294 | 295 | 299 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | runtimeCompiler: true 3 | } 4 | --------------------------------------------------------------------------------