5 | Recent Posts. 6 |
7 |12 | {{ post.title }} 13 |
14 |19 | 20 | by {{ post.author}} 21 | \\ {{ post.published }} 22 | 23 |
├── .eslintrc.js
├── .gitignore
├── README.md
├── components
├── AppLogo.vue
├── Posts.vue
└── README.md
├── layouts
├── README.md
└── default.vue
├── nuxt.config.js
├── package-lock.json
├── package.json
├── pages
├── README.md
├── about.vue
├── index.vue
└── post
│ └── _id
│ └── index.vue
└── posts.json
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | browser: true,
5 | node: true
6 | },
7 | parserOptions: {
8 | parser: 'babel-eslint'
9 | },
10 | extends: [
11 | // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
12 | // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
13 | 'plugin:vue/essential'
14 | ],
15 | // required to lint *.vue files
16 | plugins: [
17 | 'vue'
18 | ],
19 | // add your custom rules here
20 | rules: {}
21 | }
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # dependencies
2 | node_modules
3 |
4 | # logs
5 | npm-debug.log
6 |
7 | # Nuxt build
8 | .nuxt
9 |
10 | # Nuxt generate
11 | dist
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Nuxt.js: A Universal Vue.js Application Framework
2 |
3 | Improve the loading performance and SEO of your Vue.js apps with Server-side rendering (SSR). Learn to build a universal Vue app with the Nuxt.js framework.
4 |
5 | Article on SitePoint: https://www.sitepoint.com/nuxt-js-universal-vue-js/
6 |
7 | You can see the demo app here: https://nuxt-ssr-blog.firebaseapp.com/
8 |
9 | ## Requirements
10 |
11 | * [Node.js](http://nodejs.org/)
12 |
13 | ## Installation Steps (if applicable)
14 |
15 | 1. Clone repo
16 | 2. Run `npm install`
17 | 3. Run `npm run dev` to serve with hot reload at http://localhost:3000
18 | 4. Run `npm run build` then `npm start` to build for production and launch server
19 | 5. Run `npm run generate` to generate the static project
20 |
21 | ## License
22 |
23 | SitePoint's code archives and code examples are licensed under the MIT license.
24 |
25 | Copyright © 2017 SitePoint
26 |
27 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
28 |
29 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
30 |
31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 |
33 |
--------------------------------------------------------------------------------
/components/AppLogo.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 | {{ post.title }}
13 | Curabitur accumsan turpis pharetra augue tincidunt blandit. Quisque condimentum maximus mi, sit amet commodo arcu rutrum id. Proin pretium urna vel cursus venenatis. Suspendisse potenti. Etiam mattis sem rhoncus lacus dapibus facilisis. Donec at dignissim dui. Ut et neque nisl.
5 | Recent Posts.
6 |
7 |
19 |
20 | by {{ post.author}}
21 | \\ {{ post.published }}
22 |
23 | About this website.
5 |
7 | What we hope to achieve:
8 |
9 |
14 |
7 | Welcome to the JavaScript SSR Blog.
8 |
9 |
10 | Hope you find something you like.
11 |
12 | {{ post.title }}
5 |
6 |
7 | by {{ post.author }} at {{ post.published }}
8 |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
", 7 | "author": "Jane Doe", 8 | "published": "08:00 - 07/06/2017" 9 | }, 10 | { 11 | "id": 3, 12 | "title": "Great SSR Use cases", 13 | "summary": "See simple and rich server rendered JavaScript apps.", 14 | "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
", 15 | "author": "Jane Doe", 16 | "published": "17:00 - 06/06/2017" 17 | }, 18 | { 19 | "id": 2, 20 | "title": "SSR in Vue.js", 21 | "summary": "Learn about SSR in Vue.js, and where Nuxt.js can make it all faster.", 22 | "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
", 23 | "author": "Jane Doe", 24 | "published": "13:00 - 06/06/2017" 25 | }, 26 | { 27 | "id": 1, 28 | "title": "Introduction to SSR", 29 | "summary": "Learn about SSR in JavaScript and how it can be super cool.", 30 | "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
", 31 | "author": "John Doe", 32 | "published": "11:00 - 06/06/2017" 33 | } 34 | ] 35 | --------------------------------------------------------------------------------