Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The source code for my personal website

License

NotificationsYou must be signed in to change notification settings

eddiesigner/eduardogomez.io

Repository files navigation

The source code for my personal website built withGatsby andGhost as a headless CMS.

 

Installing

Install Gatsby and clone the repository

# Install the Gatsby CLInpm install -g gatsby-cli
# Clone the repositorygit clone https://github.com/eddiesigner/eduardogomez.io.git

Then install dependencies

npm install

 

Running

Create the file.env.development in the root directory and paste the following variables:

NODE_ENV=developmentSITEURL=http://localhost:8000GHOST_API_URL=https://gatsby.ghost.ioGHOST_CONTENT_API_KEY=9cc5c67c358edfdd81455149d0GTM_ID=GTM-XXXXXXX

The API URL is the URL of your Ghost site. For Ghost(Pro) customers, this is the Ghost URL ending in.ghost.io, and for people using the self-hosted version of Ghost, it's the same URL used to access your site.

A Content API Key can be provided by creating an integration within Ghost Admin. Navigate to Integrations and click "Add new integration". Name the integration appropriately and click create.

Start the development server. You now have a Gatsby site pulling content from headless Ghost.

gatsby develop

Finally, configure your desired URL insiteConfig.js, so links (e. g. canonical links) are generated correctly. You can also update other default values, such aspostsPerPage in this file.

 

Production Build

Create the file.env.production in the root directory, paste the same development variables and change the values accordingly.

# Run a production build, locallygatsby build# Serve a production build, locallygatsby serve

Gatsbydevelop uses thedevelopment variables in.env.development - while Gatsbybuild uses theproduction variables in.env.production.

 

Deploying with Netlify

The project contains three config files specifically for deploying with Netlify. Anetlify.toml file for build settings, a/static/_headers file with default security headers set for all routes, and/static/_redirects to set Netlify custom domain redirects.

To deploy to your Netlify account, hit the button below.

Deploy to Netlify

The environment variables including your Content API Keys must be set asNetlify ENV variables for production builds.

Once deployed, you can set up aGhost + Netlify Integration to use deploy hooks from Ghost to trigger Netlify rebuilds. That way, any time data changes in Ghost, your site will rebuild on Netlify.

 

Optimising

You can disable the default Ghost Handlebars Theme front-end by enabling theMake this site private flag within your Ghost settings. This enables password protection in front of the Ghost install and sets<meta name="robots" content="noindex" /> so your Gatsby front-end becomes the source of truth for SEO.

 

About

The source code for my personal website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp