├── .prettierrc ├── static ├── favicon.ico └── README.md ├── assets ├── css │ └── tailwind.css └── README.md ├── components ├── README.md ├── layout │ └── AppHeader.vue └── ui │ ├── ArticleCard.vue │ └── SearchBox.vue ├── .editorconfig ├── layouts ├── README.md └── default.vue ├── pages ├── README.md ├── index.vue ├── topics │ └── _slug.vue └── _slug.vue ├── plugins └── README.md ├── .eslintrc.js ├── README.md ├── utils ├── seo.js └── sitemap.js ├── tailwind.config.js ├── package.json ├── .gitignore └── nuxt.config.js /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexjoverm/narutodose/HEAD/static/favicon.ico -------------------------------------------------------------------------------- /assets/css/tailwind.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss/base'; 2 | @import 'tailwindcss/components'; 3 | @import 'tailwindcss/utilities'; 4 | -------------------------------------------------------------------------------- /components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | The components directory contains your Vue.js Components. 6 | 7 | _Nuxt.js doesn't supercharge these components._ 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Application Layouts. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). 8 | -------------------------------------------------------------------------------- /pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the `*.vue` files inside this directory and creates the router of your application. 5 | 6 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). 7 | -------------------------------------------------------------------------------- /assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). 8 | -------------------------------------------------------------------------------- /plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). 8 | -------------------------------------------------------------------------------- /.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 | '@nuxtjs', 12 | 'prettier', 13 | 'prettier/vue', 14 | 'plugin:prettier/recommended', 15 | 'plugin:nuxt/recommended', 16 | ], 17 | plugins: ['prettier'], 18 | // add your custom rules here 19 | rules: {}, 20 | } 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mini-vuedose 2 | 3 | ## Build Setup 4 | 5 | ```bash 6 | # install dependencies 7 | $ npm install 8 | 9 | # serve with hot reload at localhost:3000 10 | $ npm run dev 11 | 12 | # build for production and launch server 13 | $ npm run build 14 | $ npm run start 15 | 16 | # generate static project 17 | $ npm run generate 18 | ``` 19 | 20 | For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org). 21 | -------------------------------------------------------------------------------- /static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your static files. 6 | Each file inside this directory is mapped to `/`. 7 | Thus you'd want to delete this README.md before deploying to production. 8 | 9 | Example: `/static/robots.txt` is mapped as `/robots.txt`. 10 | 11 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). 12 | -------------------------------------------------------------------------------- /utils/seo.js: -------------------------------------------------------------------------------- 1 | export const createSEOMeta = (data) => [ 2 | { hid: 'og:title', property: 'og:title', content: data.title }, 3 | { hid: 'description', name: 'description', content: data.description }, 4 | { 5 | hid: 'og:description', 6 | property: 'og:description', 7 | content: data.description, 8 | }, 9 | { hid: 'og:image', property: 'og:image', content: data.image }, 10 | { 11 | hid: 'og:url', 12 | property: 'og:url', 13 | content: process.env.HOST_NAME + '/' + data.url, 14 | }, 15 | { 16 | hid: 'twitter:card', 17 | name: 'twitter:card', 18 | content: data.cardType || 'summary_large_image', 19 | }, 20 | ] 21 | -------------------------------------------------------------------------------- /layouts/default.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 30 | -------------------------------------------------------------------------------- /utils/sitemap.js: -------------------------------------------------------------------------------- 1 | import StoryblokClient from 'storyblok-js-client' 2 | import kebabCase from 'lodash/kebabCase' 3 | 4 | export const fetchSitemapRoutes = async () => { 5 | const routes = [] 6 | const client = new StoryblokClient({ accessToken: process.env.STORYBLOK_KEY }) 7 | 8 | const { data: articlesData } = await client.get('cdn/links', { 9 | starts_with: 'articles/', 10 | }) 11 | const { data: tagsData } = await client.get('cdn/tags') 12 | 13 | Object.values(articlesData.links).forEach((article) => 14 | routes.push(`/${article.slug}`) 15 | ) 16 | tagsData.tags.forEach((tag) => routes.push(`/topics/${kebabCase(tag.name)}`)) 17 | 18 | return routes 19 | } 20 | -------------------------------------------------------------------------------- /components/layout/AppHeader.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 30 | -------------------------------------------------------------------------------- /components/ui/ArticleCard.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 30 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** TailwindCSS Configuration File 3 | ** 4 | ** Docs: https://tailwindcss.com/docs/configuration 5 | ** Default: https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js 6 | */ 7 | const { theme } = require('tailwindcss/defaultConfig') 8 | 9 | module.exports = { 10 | theme: { 11 | extend: { 12 | colors: { 13 | main: theme.colors.teal['500'], // #38b2ac 14 | }, 15 | }, 16 | }, 17 | variants: {}, 18 | plugins: [require('@tailwindcss/typography')], 19 | purge: { 20 | // Learn more on https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css 21 | enabled: process.env.NODE_ENV === 'production', 22 | content: [ 23 | 'components/**/*.vue', 24 | 'layouts/**/*.vue', 25 | 'pages/**/*.vue', 26 | 'plugins/**/*.js', 27 | 'nuxt.config.js', 28 | ], 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mini-vuedose", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "nuxt", 7 | "build": "nuxt build", 8 | "start": "nuxt start", 9 | "generate": "nuxt generate", 10 | "serve": "nuxt serve", 11 | "lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .", 12 | "lint": "npm run lint:js" 13 | }, 14 | "dependencies": { 15 | "@nuxtjs/axios": "^5.11.0", 16 | "@nuxtjs/markdownit": "^1.2.10", 17 | "@nuxtjs/sitemap": "^2.4.0", 18 | "@tailwindcss/typography": "^0.2.0", 19 | "lodash-es": "^4.17.15", 20 | "markdown-it-prism": "^2.1.0", 21 | "nuxt": "^2.14.3", 22 | "storyblok-nuxt": "^1.2.0" 23 | }, 24 | "devDependencies": { 25 | "@nuxtjs/eslint-config": "^3.0.0", 26 | "@nuxtjs/eslint-module": "^2.0.0", 27 | "@nuxtjs/tailwindcss": "^2.0.0", 28 | "babel-eslint": "^10.1.0", 29 | "eslint": "^7.2.0", 30 | "eslint-config-prettier": "^6.11.0", 31 | "eslint-plugin-nuxt": "^1.0.0", 32 | "eslint-plugin-prettier": "^3.1.4", 33 | "prettier": "^2.0.5" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /pages/index.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Node template 3 | # Logs 4 | /logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # TypeScript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | 62 | # parcel-bundler cache (https://parceljs.org/) 63 | .cache 64 | 65 | # next.js build output 66 | .next 67 | 68 | # nuxt.js build output 69 | .nuxt 70 | 71 | # Nuxt generate 72 | dist 73 | 74 | # vuepress build output 75 | .vuepress/dist 76 | 77 | # Serverless directories 78 | .serverless 79 | 80 | # IDE / Editor 81 | .idea 82 | 83 | # Service worker 84 | sw.* 85 | 86 | # macOS 87 | .DS_Store 88 | 89 | # Vim swap files 90 | *.swp 91 | -------------------------------------------------------------------------------- /pages/topics/_slug.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 53 | -------------------------------------------------------------------------------- /components/ui/SearchBox.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 64 | -------------------------------------------------------------------------------- /pages/_slug.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 71 | -------------------------------------------------------------------------------- /nuxt.config.js: -------------------------------------------------------------------------------- 1 | import { createSEOMeta } from './utils/seo' 2 | import { fetchSitemapRoutes } from './utils/sitemap' 3 | 4 | export default async () => { 5 | const routes = await fetchSitemapRoutes() 6 | 7 | return { 8 | /* 9 | ** Nuxt rendering mode 10 | ** See https://nuxtjs.org/api/configuration-mode 11 | */ 12 | mode: 'universal', 13 | /* 14 | ** Nuxt target 15 | ** See https://nuxtjs.org/api/configuration-target 16 | */ 17 | target: 'static', 18 | /* 19 | ** Headers of the page 20 | ** See https://nuxtjs.org/api/configuration-head 21 | */ 22 | head: { 23 | title: 'NarutoDose', 24 | meta: [ 25 | ...createSEOMeta({ 26 | title: 'NarutoDose', 27 | description: 28 | 'Get to know all about Naruto and its characters in tiny bits of info.', 29 | image: '[Insert_NarutoDose_Image_URL]', 30 | url: process.env.HOST_NAME, 31 | }), 32 | { charset: 'utf-8' }, 33 | { name: 'viewport', content: 'width=device-width, initial-scale=1' }, 34 | ], 35 | link: [ 36 | { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, 37 | { 38 | rel: 'stylesheet', 39 | href: 40 | 'https://cdn.jsdelivr.net/npm/prismjs@1.20.0/themes/prism-tomorrow.css', 41 | }, 42 | ], 43 | }, 44 | /* 45 | ** Global CSS 46 | */ 47 | css: [], 48 | /* 49 | ** Plugins to load before mounting the App 50 | ** https://nuxtjs.org/guide/plugins 51 | */ 52 | plugins: [], 53 | /* 54 | ** Auto import components 55 | ** See https://nuxtjs.org/api/configuration-components 56 | */ 57 | components: true, 58 | /* 59 | ** Nuxt.js dev-modules 60 | */ 61 | buildModules: [ 62 | // Doc: https://github.com/nuxt-community/eslint-module 63 | '@nuxtjs/eslint-module', 64 | // Doc: https://github.com/nuxt-community/nuxt-tailwindcss 65 | '@nuxtjs/tailwindcss', 66 | ], 67 | /* 68 | ** Nuxt.js modules 69 | */ 70 | modules: [ 71 | // Doc: https://axios.nuxtjs.org/usage 72 | '@nuxtjs/axios', 73 | [ 74 | 'storyblok-nuxt', 75 | { 76 | accessToken: process.env.STORYBLOK_KEY, 77 | cacheProvider: 'memory', 78 | }, 79 | ], 80 | [ 81 | '@nuxtjs/markdownit', 82 | { html: true, injected: true, use: ['markdown-it-prism'] }, 83 | ], 84 | '@nuxtjs/sitemap', 85 | ], 86 | 87 | sitemap: { 88 | hostname: process.env.HOST_NAME, 89 | 90 | routes, 91 | }, 92 | /* 93 | ** Axios module configuration 94 | ** See https://axios.nuxtjs.org/options 95 | */ 96 | axios: {}, 97 | /* 98 | ** Build configuration 99 | ** See https://nuxtjs.org/api/configuration-build/ 100 | */ 101 | build: {}, 102 | } 103 | } 104 | --------------------------------------------------------------------------------