- Site features:
- Search across posts
- Recommended / Related posts
- Git-based comment section using Vssue
- Analytics (Mixpanel, Sentry)
- RSS feed
- Pre-compression of static files
- SEO fetures:
- Sitemap
- Robots.txt
- Meta tags (incl. Open Graph and Twitter cards)
- Dev quality of life features:
- Markdown-based content
- Markdown frontmatter validation
- Vue and HTML inside Markdown files
- GraphQL codegen based on queries in
<page-query>
and<static-query>
blocks
- TypeScript
- In Vue files
- In
gridsome.config
andgridsome.server
files
- Fine control over the data flow:
- Validation of input data from Markdown files
- Enrichment (transformation) of internal data stored in LokiJS collections
- GraphQL schema with custom resolvers
- Modularized project structure:
core
- features / data common across all other modulesconfig
- gridsome configs, plugins, and helpers to work with thempost
- schema, logic, validation, etc, common across any kind of "Post"blogPost
- Blog postprojectPost
- Project post
- Markdown-based content
If I were to do it again, I'd go with Nuxt instead now.
There's been too many workarounds to make gridsome to work with:
- TypeScript for
gridsome.config
andgridsome.server
files - GraphQL Codegen based on
<page-query>
and<static-query>
blocks vue-remark
vs other plugins that were incompatible (e.g. the recommender plugin)- Vuetify (the vuetify loader still doesn't work)
Where source code for the project lives.
TypeScript entrypoint for gridsome config. This is transpiled to JS and imported in gridsome.config.js, so we can use TypeScript for Gridsome config.
TypeScript entrypoint for gridsome server config. This is transpiled to JS and imported in gridsome.server.js, so we can use TypeScript for Gridsome config.
Entrypoint for gridsome client (Vue).
Entrypoint for Vue app.
Project features, content, etc, are split into separate modules that house related files together.
Some of the files you may find in modules are:
myModule.gridsome.server.ts
-- File imported by gridsome.server.tsmyModule.gridsome.config.ts
-- File imported by gridsome.config.tsmyModule.gridsome.client.ts
-- File imported by main.jsmyModuleSchema.ts
-- Extension to the GraphQL schemamyModuleResolvers.ts
-- Resolvers to the schema extensionmyModuleModel.ts
-- Types defining the internal entry available in Gridsome collection once it's loaded from the source filesmyModuleValidation.ts
-- Input validation for frontmatter in markdown files found incontent
directorymyModuleTypes.ts
-- Other types relevant to this modulecontent
-- Markdown (file-based) content that's imported with@gridsome/source-filesystem
. These are turned into posts (e.g. blogs)style
-- Styling (css
/scss
files) for this moduleassets
-- Static assets used by this modulecomponents
--.vue
components.- Files suffixed with
Template
are used as gridsome templates
- Files suffixed with
pages
--.vue
components loaded as pages. These are loaded in respectivegridsome.server.ts
utils
TypeScript shims -- type definitions for third party libraries.
Autogenerated files, e.g. by Graphql Code Generator (see codegen.yml)
Place to add static files. Files in this directory will be copied directly to the dist folder during build. For example, /static/robots.txt
will be available at https://yoursite.com/robots.txt.
Scripts that are not part of the build, but might be required for tooling, build or deployment.