├── .nvmrc ├── src ├── assets │ └── styles │ │ └── _globals.scss ├── favicon.png ├── components │ └── README.md ├── layouts │ ├── README.md │ └── Default.vue ├── pages │ ├── README.md │ ├── About.vue │ └── Index.vue ├── templates │ └── README.md └── main.js ├── .prettierrc ├── .vscode ├── extensions.json └── settings.json ├── .gitignore ├── jsconfig.json ├── .dependabot └── config.yml ├── static └── README.md ├── .github ├── PULL_REQUEST_TEMPLATE └── workflows │ ├── build.yml │ ├── auto-merge.yml │ ├── deploy.yml │ ├── eslint.yml │ ├── stale-issues.yml │ └── lighthouse.yml ├── .eslintrc.js ├── README.md ├── gridsome.server.js ├── netlify.toml ├── package.json └── gridsome.config.js /.nvmrc: -------------------------------------------------------------------------------- 1 | 13.7.0 -------------------------------------------------------------------------------- /src/assets/styles/_globals.scss: -------------------------------------------------------------------------------- 1 | $main-color: #e5554f; 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } -------------------------------------------------------------------------------- /src/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codegram/gridsome-starter/master/src/favicon.png -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["esbenp.prettier-vscode", "octref.vetur"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .cache 3 | .DS_Store 4 | src/.temp 5 | node_modules 6 | dist 7 | .env 8 | .env.* 9 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": ["./src/**/*"], 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "paths": { 6 | "@/*": ["src/*"] 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.dependabot/config.yml: -------------------------------------------------------------------------------- 1 | version: 1 2 | update_configs: 3 | - package_manager: 'javascript' 4 | directory: '/' 5 | update_schedule: 'live' 6 | default_labels: 7 | - 'dependency-update' 8 | -------------------------------------------------------------------------------- /src/components/README.md: -------------------------------------------------------------------------------- 1 | Add components that will be imported to Pages and Layouts to this folder. 2 | Learn more about components here: https://gridsome.org/docs/components/ 3 | 4 | You can delete this file. 5 | -------------------------------------------------------------------------------- /static/README.md: -------------------------------------------------------------------------------- 1 | Add static files here. Files in this directory will be copied directly to `dist` folder during build. For example, /static/robots.txt will be located at https://yoursite.com/robots.txt. 2 | 3 | This file should be deleted. -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | #### :tophat: What? Why? 2 | Brief explanation of the scope of this PR. 3 | 4 | #### :pushpin: Related Issues 5 | - Related to #? 6 | - Fixes #? 7 | 8 | ### :link: URL(s) (optional) 9 | * https://... 10 | * https://... -------------------------------------------------------------------------------- /src/layouts/README.md: -------------------------------------------------------------------------------- 1 | Layout components are used to wrap pages and templates. Layouts should contain components like headers, footers or sidebars that will be used across the site. 2 | 3 | Learn more about Layouts: https://gridsome.org/docs/layouts/ 4 | 5 | You can delete this file. 6 | -------------------------------------------------------------------------------- /src/pages/README.md: -------------------------------------------------------------------------------- 1 | Pages are usually used for normal pages or for listing items from a GraphQL collection. 2 | Add .vue files here to create pages. For example **About.vue** will be **site.com/about**. 3 | Learn more about pages: https://gridsome.org/docs/pages/ 4 | 5 | You can delete this file. 6 | -------------------------------------------------------------------------------- /src/templates/README.md: -------------------------------------------------------------------------------- 1 | Templates for **GraphQL collections** should be added here. 2 | To create a template for a collection called `WordPressPost` 3 | create a file named `WordPressPost.vue` in this folder. 4 | 5 | Learn more: https://gridsome.org/docs/templates/ 6 | 7 | You can delete this file. 8 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "vetur.completion.autoImport": true, 3 | "vetur.format.enable": false, 4 | "vetur.validation.style": true, 5 | "vetur.grammar.customBlocks": { 6 | "page-query": "graphql", 7 | "static-query": "graphql" 8 | }, 9 | "editor.formatOnPaste": true, 10 | "editor.formatOnSave": true, 11 | "editor.formatOnType": true 12 | } 13 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // This is the main.js file. Import global CSS and scripts here. 2 | // The Client API can be used here. Learn more: gridsome.org/docs/client-api 3 | 4 | import DefaultLayout from '~/layouts/Default.vue' 5 | 6 | export default function(Vue, { _router, _head, _isClient }) { 7 | // Set default layout as a global component 8 | Vue.component('Layout', DefaultLayout) 9 | } 10 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: [ 7 | 'plugin:vue/recommended', 8 | 'eslint:recommended', 9 | 'plugin:prettier/recommended', 10 | 'prettier/vue' 11 | ], 12 | rules: { 13 | 'no-console': ['error'], 14 | 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }], 15 | 'no-inline-html': 'off' 16 | }, 17 | parserOptions: { 18 | parser: 'babel-eslint' 19 | } 20 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Default starter for Gridsome 2 | 3 | This is the project you get when you run `gridsome create new-project`. 4 | 5 | ### 1. Install Gridsome CLI tool if you don't have 6 | 7 | `npm install --global @gridsome/cli` 8 | 9 | ### 2. Create a Gridsome project 10 | 11 | 1. `gridsome create my-gridsome-site` to install default starter 12 | 2. `cd my-gridsome-site` to open the folder 13 | 3. `gridsome develop` to start a local dev server at `http://localhost:8080` 14 | 4. Happy coding 🎉🙌 15 | -------------------------------------------------------------------------------- /src/pages/About.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 20 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-16.04 8 | 9 | strategy: 10 | matrix: 11 | node-version: [13.x] 12 | 13 | steps: 14 | - uses: actions/checkout@v1 15 | - name: Use Node.js ${{ matrix.node-version }} 16 | uses: actions/setup-node@v1 17 | with: 18 | node-version: ${{ matrix.node-version }} 19 | - name: Install dependencies 20 | run: | 21 | npm install 22 | - name: Build 23 | run: | 24 | npm run build 25 | -------------------------------------------------------------------------------- /.github/workflows/auto-merge.yml: -------------------------------------------------------------------------------- 1 | name: Auto merge Dependabot updates 2 | 3 | on: 4 | check_suite: 5 | types: 6 | - completed 7 | pull_request: 8 | types: 9 | - edited 10 | - labeled 11 | - opened 12 | - ready_for_review 13 | - reopened 14 | - synchronize 15 | - unlabeled 16 | - unlocked 17 | 18 | jobs: 19 | auto-merge: 20 | name: Auto merge 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Auto merge 24 | uses: ridedott/dependabot-auto-merge-action@master 25 | with: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /gridsome.server.js: -------------------------------------------------------------------------------- 1 | // Server API makes it possible to hook into various parts of Gridsome 2 | // on server-side and add custom data to the GraphQL data layer. 3 | // Learn more: https://gridsome.org/docs/server-api/ 4 | 5 | // Changes here require a server restart. 6 | // To restart press CTRL + C in terminal and run `gridsome develop` 7 | 8 | module.exports = function(api) { 9 | api.loadSource(({ _addCollection }) => { 10 | // Use the Data Store API here: https://gridsome.org/docs/data-store-api/ 11 | }) 12 | 13 | api.createPages(({ _createPage }) => { 14 | // Use the Pages API here: https://gridsome.org/docs/pages-api/ 15 | }) 16 | } 17 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Build and Deploy 2 | on: 3 | push: 4 | branches: 5 | - master 6 | 7 | jobs: 8 | build-and-deploy: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout 12 | uses: actions/checkout@v2 13 | - name: Use Node.js ${{ matrix.node-version }} 14 | uses: actions/setup-node@v1 15 | with: 16 | node-version: 13.x 17 | - name: Install dependencies 18 | run: | 19 | npm install 20 | - name: Build 21 | env: 22 | BASE_DIR: '/gridsome-starter' 23 | run: | 24 | npm run build 25 | - name: Deploy 26 | uses: JamesIves/github-pages-deploy-action@releases/v3 27 | with: 28 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 29 | BRANCH: gh-pages 30 | FOLDER: dist 31 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | # Settings in the [build] context are global and are applied to all contexts 2 | # unless otherwise overridden by more specific contexts. 3 | [build] 4 | # Directory to change to before starting a build. 5 | # This is where we will look for package.json/.nvmrc/etc. 6 | base = "/" 7 | 8 | # Directory (relative to root of your repo) that contains the deploy-ready 9 | # HTML files and assets generated by the build. If a base directory has 10 | # been specified, include it in the publish directory path. 11 | publish = "dist/" 12 | 13 | # Default build command. 14 | command = "npm run build" 15 | 16 | # Directory with the serverless Lambda functions to deploy to AWS. 17 | functions = "functions/" 18 | 19 | # The following redirect is intended for use with most SPAs that handle 20 | # routing internally. 21 | [[redirects]] 22 | from = "/*" 23 | to = "/index.html" 24 | status = 200 -------------------------------------------------------------------------------- /.github/workflows/eslint.yml: -------------------------------------------------------------------------------- 1 | name: "Lint" 2 | on: 3 | push: 4 | branches-ignore: 5 | - master 6 | 7 | env: 8 | NODE_VERSION: "13.x" 9 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 10 | 11 | jobs: 12 | lint: 13 | name: Lint 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@master 17 | - name: Use Node.js ${{ env.NODE_VERSION }} 18 | uses: actions/setup-node@v1 19 | with: 20 | node-version: ${{ env.NODE_VERSION }} 21 | - name: Cache node_modules 22 | id: cache-primes 23 | uses: actions/cache@v1 24 | with: 25 | path: node_modules 26 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} 27 | restore-keys: | 28 | ${{ runner.os }}-node- 29 | - name: npm install 30 | run: | 31 | npm install 32 | - name: ESLint checks 33 | uses: gimenete/eslint-action@1.0 -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gridsome-starter", 3 | "private": true, 4 | "scripts": { 5 | "build": "gridsome build", 6 | "develop": "gridsome develop", 7 | "explore": "gridsome explore", 8 | "format": "npm run prettier && npm run lint-fix", 9 | "lint": "eslint --ext .js,.vue --ignore-path .gitignore .", 10 | "lint-fix": "npm run lint-js -- --fix", 11 | "prettier": "prettier --ignore-path .gitignore --write ./**/*.{js,vue,scss}" 12 | }, 13 | "dependencies": { 14 | "@gridsome/plugin-sitemap": "^0.4.0", 15 | "gridsome": "^0.7.23", 16 | "node-sass": "^5.0.0", 17 | "sass-loader": "^10.1.1", 18 | "style-resources-loader": "^1.4.1" 19 | }, 20 | "devDependencies": { 21 | "babel-eslint": "^10.1.0", 22 | "eslint": "^7.19.0", 23 | "eslint-config-prettier": "^7.2.0", 24 | "eslint-plugin-prettier": "^3.3.1", 25 | "eslint-plugin-vue": "^7.5.0", 26 | "prettier": "^2.2.1" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/pages/Index.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 35 | 36 | 42 | -------------------------------------------------------------------------------- /src/layouts/Default.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | query { 18 | metadata { 19 | siteName 20 | } 21 | } 22 | 23 | 24 | 52 | -------------------------------------------------------------------------------- /.github/workflows/stale-issues.yml: -------------------------------------------------------------------------------- 1 | name: "Close stale Issues and PRs" 2 | on: 3 | schedule: 4 | - cron: "0 8 * * *" 5 | 6 | env: 7 | DAYS_BEFORE_STALE: 30 8 | DAYS_BEFORE_CLOSE: 7 9 | STALE_ISSUE_LABEL: 'no-issue-activity' 10 | EXEMPT_ISSUE_LABEL: 'awaiting-approval' 11 | STALE_PR_LABEL: 'no-pr-activity' 12 | EXEMPT_PR_LABEL: 'awaiting-approval' 13 | 14 | jobs: 15 | stale: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/stale@v1 19 | with: 20 | repo-token: ${{ secrets.GITHUB_TOKEN }} 21 | days-before-stale: ${{ env.DAYS_BEFORE_STALE }} 22 | days-before-close: ${{ env.DAYS_BEFORE_CLOSE }} 23 | stale-issue-message: "This issue has become stale after ${{ env.DAYS_BEFORE_STALE }} days of inactivity. If you don't want it to be marked as stale, please add the `awaiting-approval` label." 24 | stale-pr-message: "This Pull Request has become stale after ${{ env.DAYS_BEFORE_STALE }} days of inactivity. If you don't want it to be marked as stale, please add the `awaiting-approval` label." 25 | stale-issue-label: ${{ env.STALE_ISSUE_LABEL }} 26 | exempt-issue-label: ${{ env.EXEMPT_ISSUE_LABEL }} 27 | stale-pr-label: ${{ env.STALE_PR_LABEL }} 28 | exempt-pr-label: ${{ env.EXEMPT_PR_LABEL }} -------------------------------------------------------------------------------- /gridsome.config.js: -------------------------------------------------------------------------------- 1 | // This is where project configuration and plugin options are located. 2 | // Learn more: https://gridsome.org/docs/config 3 | 4 | // Changes here require a server restart. 5 | // To restart press CTRL + C in terminal and run `gridsome develop` 6 | 7 | const path = require('path') 8 | 9 | function addStyleResource(rule) { 10 | rule 11 | .use('style-resource') 12 | .loader('style-resources-loader') 13 | .options({ 14 | patterns: [path.resolve(__dirname, './src/assets/styles/_globals.scss')] 15 | }) 16 | } 17 | 18 | module.exports = { 19 | siteName: 'Gridsome', 20 | 21 | // Preconfigured for Netlify. 22 | siteUrl: process.env.BRANCH 23 | ? process.env.BRANCH == 'master' 24 | ? process.env.URL 25 | : process.env.DEPLOY_PRIME_URL 26 | : 'https://localhost', 27 | 28 | pathPrefix: process.env.BASE_DIR || '', 29 | 30 | titleTemplate: `%s | Gridsome`, 31 | 32 | plugins: [ 33 | { 34 | use: '@gridsome/plugin-sitemap' 35 | } 36 | ], 37 | 38 | chainWebpack(config) { 39 | // Load variables for all vue-files 40 | const types = ['vue-modules', 'vue', 'normal-modules', 'normal'] 41 | 42 | types.forEach(type => { 43 | addStyleResource(config.module.rule('sass').oneOf(type)) 44 | }) 45 | 46 | // or if you use scss 47 | types.forEach(type => { 48 | addStyleResource(config.module.rule('scss').oneOf(type)) 49 | }) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /.github/workflows/lighthouse.yml: -------------------------------------------------------------------------------- 1 | name: Lighthouse Accessibility / SEO check 2 | on: [pull_request] 3 | 4 | env: 5 | NODE_VERSION: '13.x' 6 | NODE_ENV: production 7 | BUILD_COMMAND: npm run build 8 | BUILD_DIR: dist 9 | 10 | jobs: 11 | lighthouse-check: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@master 15 | - name: Use Node.js ${{ env.NODE_VERSION }} 16 | uses: actions/setup-node@v1 17 | with: 18 | node-version: ${{ env.NODE_VERSION }} 19 | - name: Cache node_modules 20 | id: cache-primes 21 | uses: actions/cache@v1 22 | with: 23 | path: node_modules 24 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} 25 | restore-keys: | 26 | ${{ runner.os }}-node- 27 | - name: Install & build 28 | run: | 29 | npm install 30 | ${{ env.BUILD_COMMAND }} 31 | - name: Start web server 32 | run: | 33 | cd ${{ env.BUILD_DIR }} 34 | npx local-web-server & 35 | - name: Run Lighthouse 36 | uses: foo-software/lighthouse-check-action@master 37 | id: lighthouseCheck 38 | with: 39 | # Uncomment the line below to have the workflow report via PR comments. 40 | # accessToken: ${{ secrets.GITHUB_TOKEN }} 41 | # You can put several URLs (in fact it's a good idea) separating them by commas. 42 | urls: 'http://localhost:8000, http://localhost:8000/whatever' 43 | - name: Handle Lighthouse Check results 44 | uses: foo-software/lighthouse-check-status-action@master 45 | with: 46 | lighthouseCheckResults: ${{ steps.lighthouseCheck.outputs.lighthouseCheckResults }} 47 | minAccessibilityScore: '95' 48 | minBestPracticesScore: '85' 49 | minSeoScore: '90' 50 | # minProgressiveWebAppScore: "50" 51 | # The following check is not advised as performance varies greatly between runs. 52 | # minPerformanceScore: "50" 53 | --------------------------------------------------------------------------------