├── dotenv-example ├── .prettierrc ├── static ├── favicon.ico └── README.md ├── .npmrc ├── components ├── global │ ├── MbBox.vue │ ├── MbParagraph.vue │ ├── MbIcon.vue │ ├── MbHeading.vue │ ├── MbLink.vue │ └── MbButton.vue ├── README.md └── Footer.vue ├── fontawesome.config.js ├── pages ├── other.vue ├── index.vue ├── jokes.vue └── demo.vue ├── jsconfig.json ├── .editorconfig ├── layouts ├── README.md └── default.vue ├── assets └── README.md ├── plugins └── README.md ├── .eslintrc.js ├── middleware └── README.md ├── store └── README.md ├── package.json ├── tailwind.config.js ├── README.md ├── .gitignore └── nuxt.config.js /dotenv-example: -------------------------------------------------------------------------------- 1 | FONTAWESOME_NPM_AUTH_TOKEN= -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/themarcba/nuxt-template/HEAD/static/favicon.ico -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | @fortawesome:registry=https://npm.fontawesome.com/ 2 | //npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN} -------------------------------------------------------------------------------- /components/global/MbBox.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /fontawesome.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | icons: { 3 | solid: ['faChevronRight', 'faChevronLeft', 'faHeart'], 4 | brands: ['faGithub'], 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /pages/other.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /components/Footer.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "~/*": ["./*"], 6 | "@/*": ["./*"], 7 | "~~/*": ["./*"], 8 | "@@/*": ["./*"] 9 | } 10 | }, 11 | "exclude": ["node_modules", ".nuxt", "dist"] 12 | } 13 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | 'plugin:prettier/recommended', 13 | 'plugin:nuxt/recommended', 14 | ], 15 | plugins: [], 16 | // add your custom rules here 17 | rules: {}, 18 | } 19 | -------------------------------------------------------------------------------- /components/global/MbParagraph.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | -------------------------------------------------------------------------------- /middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 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 middleware. 6 | Middleware let you define custom functions that can be run before rendering either a page or a group of pages. 7 | 8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). 9 | -------------------------------------------------------------------------------- /store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 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 Vuex Store files. 6 | Vuex Store option is implemented in the Nuxt.js framework. 7 | 8 | Creating a file in this directory automatically activates the option in the framework. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /components/global/MbIcon.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /pages/index.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 33 | -------------------------------------------------------------------------------- /components/global/MbHeading.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 32 | -------------------------------------------------------------------------------- /layouts/default.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 57 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt-starter", 3 | "version": "1.0.3", 4 | "author": { 5 | "name": "Marc Backes", 6 | "email": "hello@marc.dev", 7 | "url": "https://marc.dev" 8 | }, 9 | "private": true, 10 | "scripts": { 11 | "dev": "nuxt", 12 | "build": "nuxt build", 13 | "start": "nuxt start", 14 | "generate": "nuxt generate", 15 | "lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .", 16 | "lint": "yarn lint:js" 17 | }, 18 | "dependencies": { 19 | "@nuxtjs/axios": "^5.13.1", 20 | "@nuxtjs/google-fonts": "^1.3.0", 21 | "core-js": "^3.9.1", 22 | "nuxt": "^2.15.3" 23 | }, 24 | "devDependencies": { 25 | "@fortawesome/free-brands-svg-icons": "^5.15.3", 26 | "@fortawesome/free-solid-svg-icons": "^5.15.3", 27 | "@nuxtjs/eslint-config": "^6.0.0", 28 | "@nuxtjs/eslint-module": "^3.0.2", 29 | "@nuxtjs/fontawesome": "^1.1.2", 30 | "@nuxtjs/tailwindcss": "^4.0.1", 31 | "babel-eslint": "^10.1.0", 32 | "eslint": "^7.22.0", 33 | "eslint-config-prettier": "^8.1.0", 34 | "eslint-plugin-nuxt": "^2.0.0", 35 | "eslint-plugin-prettier": "^3.3.1", 36 | "eslint-plugin-vue": "^7.7.0", 37 | "nuxt-vite": "^0.1.0", 38 | "postcss": "^8.2.8", 39 | "prettier": "^2.2.1" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | const defaultTheme = require('tailwindcss/defaultTheme') 2 | 3 | module.exports = { 4 | theme: { 5 | // Custom font sizes 6 | fontSize: { 7 | xs: '.8rem', 8 | sm: '1rem', 9 | tiny: '1rem', 10 | base: '1.2rem', 11 | lg: '1.4rem', 12 | xl: '1.75rem', 13 | '2xl': '2rem', 14 | '3xl': '2.2rem', 15 | '4xl': '2.7rem', 16 | '5xl': '3rem', 17 | '6xl': '4rem', 18 | '7xl': '5rem', 19 | }, 20 | 21 | extend: { 22 | // You can cefine colors here, you can then access as 23 | // bg-accent, text-accentContrast, border-secondary, etc 24 | colors: { 25 | surface: '#fff', 26 | elevatedSurface: '#f9f3ff', 27 | accent: '#8213b4', 28 | accentContrast: '#fff', 29 | primary: '#000', 30 | secondary: '#777', 31 | success: '#2ecc71', 32 | danger: '#e74c3c', 33 | warning: '#e67e22', 34 | info: '#3498db', 35 | }, 36 | fontFamily: { 37 | // You can define fonts here 38 | sans: ['Asap', ...defaultTheme.fontFamily.sans], 39 | serif: ['Glegoo', ...defaultTheme.fontFamily.serif], 40 | }, 41 | }, 42 | variants: { 43 | background: ['responsive', 'hover', 'focus', 'active', 'group-hover'], 44 | }, 45 | }, 46 | } 47 | -------------------------------------------------------------------------------- /pages/jokes.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nuxt Template 2 | 3 | ## Nuxt + Tailwind + FontAwesome + Google Fonts 4 | 5 | This project includes a complete ready-to-go template of Nuxt, including Tailwind CSS, FontAwesome icons, and Google Fonts. 6 | 7 | Furthermore, some basic components are already included as well: 8 | 9 | - Link 10 | - Button 11 | - Headings 12 | - Paragraph 13 | - Rounded corner box 14 | - Icons 15 | 16 | Check out the [live demo](https://nuxt-starter-template.netlify.app). 17 | 18 | I have no documentation of those elements yet, but you can check out the [demo](/pages/demo.vue) page, where the elements are included. 19 | 20 | I also made an [example page](/pages/jokes.vue) on how to consume a REST API (thanks [FrancescoXX](https://github.com/FrancescoXX) for the suggestion!) 21 | 22 | ## Build Setup 23 | 24 | ```bash 25 | # install dependencies 26 | $ yarn install 27 | 28 | # serve with hot reload at localhost:3000 29 | $ yarn dev 30 | 31 | # build for production and launch server 32 | $ yarn build 33 | $ yarn start 34 | 35 | # generate static project 36 | $ yarn generate 37 | ``` 38 | 39 | ## FontAwesome 40 | 41 | If you want to use FontAwesome, you have to add your FontAwesome NPM Auth Token to the `.env` file. Copy the [dotenv-example file](/dotenv-example) and paste your key in there. 42 | 43 | For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org). 44 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /nuxt.config.js: -------------------------------------------------------------------------------- 1 | import tailwind from './tailwind.config' 2 | import fontawesome from './fontawesome.config' 3 | 4 | export default { 5 | // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode 6 | ssr: false, 7 | 8 | // Target: https://go.nuxtjs.dev/config-target 9 | target: 'static', 10 | 11 | // Global page headers: https://go.nuxtjs.dev/config-head 12 | head: { 13 | title: 'Nuxt Template', 14 | htmlAttrs: { 15 | lang: 'en', 16 | }, 17 | meta: [ 18 | { charset: 'utf-8' }, 19 | { name: 'viewport', content: 'width=device-width, initial-scale=1' }, 20 | { hid: 'description', name: 'description', content: '' }, 21 | ], 22 | link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }], 23 | bodyAttrs: { 24 | class: [ 25 | 'font-sans bg-surface transition-colors duration-300 ease-in-out m-4', 26 | ], 27 | }, 28 | }, 29 | 30 | // Global CSS: https://go.nuxtjs.dev/config-css 31 | css: [], 32 | 33 | // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins 34 | plugins: [], 35 | 36 | // Auto import components: https://go.nuxtjs.dev/config-components 37 | components: true, 38 | 39 | // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules 40 | buildModules: [ 41 | '@nuxtjs/eslint-module', 42 | '@nuxtjs/tailwindcss', 43 | '@nuxtjs/google-fonts', 44 | '@nuxtjs/fontawesome', 45 | 'nuxt-vite', 46 | ], 47 | 48 | // Modules: https://go.nuxtjs.dev/config-modules 49 | modules: [ 50 | // https://go.nuxtjs.dev/axios 51 | '@nuxtjs/axios', 52 | ], 53 | 54 | // Axios module configuration: https://go.nuxtjs.dev/config-axios 55 | axios: {}, 56 | 57 | // Build Configuration: https://go.nuxtjs.dev/config-build 58 | build: {}, 59 | 60 | tailwind, 61 | fontawesome, 62 | googleFonts: { 63 | families: { 64 | Glegoo: true, 65 | Asap: true, 66 | }, 67 | }, 68 | } 69 | -------------------------------------------------------------------------------- /components/global/MbLink.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 99 | -------------------------------------------------------------------------------- /components/global/MbButton.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /pages/demo.vue: -------------------------------------------------------------------------------- 1 | 115 | 116 | 128 | 129 | 130 | --------------------------------------------------------------------------------