Git Product home page Git Product logo

gatsby-theme-ghost's Introduction

Ghost Gatsby Theme

gatsby-theme-ghost is released under the MIT license. Current npm package version. PRs welcome! Follow @akanshgulati Netlify Status


Minimalistic Gatsby theme, mobile and SEO friendly and supports author, tag and static pages

Ghost Chrome mockup

Live Preview

๐Ÿ“ฆ Installation

Gatsby

gatsby new gatsby-blog akanshgulati/gatsby-theme-ghost
This will generate a new site (with the folder name "gatsby-blog") that pre-configures use of the theme including example content.

๐Ÿ’ฅ Features

  • Code Snippet Support - Integration with remark-prismjs for beautifying code snippets on posts
  • 100% performance optimisation - It has 98+ for both mobile and desktop as per Google lighthouse benchmarks
    • Responsive lazy loading of images for desktop and mobile
    • Preloading of important resource to improve Critical Rendering Path of page load
    • Retina-rich images for iOS devices to prevent any blur images.
    • Async loading of non-essential scripts like Google Analytics, etc.
  • RSS Generator - Creates RSS for posts to be easily accessible by any RSS reader
  • SEO Friendly - SEO score of the posts and entire website is 98+
    • Sitemap - Generates sitemap for the posts, author page, tag page and static pages.
    • Structured data - Contains JSON-LD format information about the content
    • Alt info - All the images itself has alt attribute as per title of the image.
    • Title info - Links has title attributes for better understanding of link
  • Social Ready - All essential meta-tags added for sharing posts and website over Facebook, Twitter, Instagram, etc. websites
  • Analytics - Integration of Google Analytics for analyses purposes.
  • Mobile Friendly - Posts and rest of the pages are mobile friendly to be easily readable.
  • Accessibility - Scores 98+ for the posts and home page.
  • Deploy Ready - Contains configuration netlify.toml for deploying on Netlify directly.
  • Customisations - Easy to customise home page, posts and other elements of website.
  • Comment System - Integration of the Disqus commenting system

๐Ÿ‘จโ€๐Ÿ’ป Development

yarn dev
  • Runs local website with hot reloading by default at 8000 port
  • Runs GraphQL for debugging at localhost:8000/__graphql path

โš™๏ธ Configuration

Change the website configuration at utils/siteConfig.js file.

  1. Add Disqus short name for enabling comments on posts
  2. Update the navigation links shown in header of website
  3. Update username of the Twitter and Facebook for icons shown in header of website
module.exports = {  
  siteUrl: `https://gatsby-theme-ghost.netlify.com`, // Site domain. Do not include a trailing slash!  
  
  postsPerPage: 12, // Number of posts shown on paginated pages (changes this requires sometimes to delete the cache)  
  
  siteTitleMeta: `Gatsby Theme Ghost`, // This allows an alternative site title for meta data for pages.  
  siteDescriptionMeta: `Minimalistic Gatsby theme for blogs`, // This allows an alternative site description for meta data for pages.  
  siteTwitterHandle: `@akanshgulati`,  
  siteFacebookHandle: `akanshgulati`,  
  language: `en`
  // ...

๐Ÿ“ Adding Content

New Post

  1. Create a directory for every post under src/posts directory, having a markdown file (.md extension)
  2. Add following meta information:
    • title*: The title of the post
    • date*: The creation date of the markdown file
    • slug*: Url of the post
    • draft*: Accepts true/false as value for visibility of the post
    • tags*: Add tag_id of different tags in yaml format
    • author*: Add author_id of author
    • comment*: To show comment on the page bottom
    • feature_image*: The URL of the image shown at the top of the article
    • created_at*: Date of the creation of the post (same as date above)
    • published_at*: The date of the publishing of the post
    • updated_at*: The date of the updating of the post
      1. Add all images and other media content in the same directory as markdown file.

Note: Create all tags and authors markdown files before adding it in post.

New Tag

  1. Create a markdown file by the new tag name under src/tags directory.
  2. Add following meta information:
    • tag_id*: The id which is mapped with post's tags
    • name*: Name as shown on posts if added
    • slug*: Url of the tag page
    • description: Description shown on the tag pages before the list of posts

New Author

  1. Create a markdown file by the new tag name under src/authors directory.
  2. Add following meta information:
    • author_id*: The id which is mapped with post's author name
    • name*: Name as shown on posts if added
    • slug*: Url of the author page
    • profile_image*: Url of the author image for each post on home page and author page.
    • description: Description shown on the author pages before the list of posts
    • twitter: Username of the Twitter for author page
    • facebook: Username of the Facebook for author page
    • website: URL of the personal website of the author

New Page

  1. Create a markdown file by the new tag name under src/pages directory.
  2. Add following meta information:
    • title*: The title shown at the top of the page
    • date*: Date of creation of the page
    • draft*: Decides if the page is to be shown to public, can have true/false value
    • slug*: URL of the page
    • created_at*: Date of the creation of the page (same as date above)
    • published_at*: The date of the publishing of the page
    • updated_at*: The date of the updating of the page
  3. Add body content of the page after the meta information

*Required


๐Ÿ”ญ Directory Structure

.    
โ”œโ”€โ”€ plugins    
โ”‚   โ””โ”€โ”€ gatsby-plugin-ghost-manifest    
โ”œโ”€โ”€ public    
โ”œโ”€โ”€ src  
โ”‚   โ”œโ”€โ”€ authors  
โ”‚   โ”‚   โ”œโ”€โ”€ akansh.md  
โ”‚   โ”œโ”€โ”€ pages    
โ”‚   โ”‚   โ””โ”€โ”€ about    
โ”‚   โ”œโ”€โ”€ posts    
โ”‚   โ”‚   โ”œโ”€โ”€ best-practises-to-select-cdn  
โ”‚   โ”‚   โ”œโ”€โ”€ ...    
โ”‚   โ”‚   โ””โ”€โ”€ ...   
โ”‚   โ”œโ”€โ”€ tags  
โ”‚   โ”‚   โ”œโ”€โ”€ javascript.md  
โ”‚   โ”œโ”€โ”€ components    
โ”‚   โ”‚   โ””โ”€โ”€ common    
โ”‚   โ”‚       โ””โ”€โ”€ meta  
โ”‚   โ”œโ”€โ”€ styles   
โ”‚   โ”œโ”€โ”€ templates    
โ”‚   โ””โ”€โ”€ utils    
โ”‚       โ””โ”€โ”€ rss    
โ””โ”€โ”€ static    
    
  • plugins: Contains custom plugins created for Gatsby
  • public: Contains build files accessible over web
  • src: Contains React components as well as content of blog as followed
    • authors: Has markdown files for each author specifying social links, image, name, etc.
    • pages: Has directory for each static page in markdown format
    • posts: Has directory for each blog post having images and markdown format post content
    • tags: Has file for each tag having description, slug, featured image, etc. information
    • components: Has React components for different sections of the website
    • styles: Has CSS(stylesheet) file for the blog
    • templates: Has template in React for post, static page, author page and tag page.
    • utils: Has RSS generator script and site configuration.
  • static: All the content is copied directly in the public folder on build, stores website favicon, robots.txt file and other files required at root of publicly accessible directory.

โ˜‘๏ธ Todo

  • Previous and Next post widget
  • Add subscription widget
  • Netlify CMS integration

๐Ÿ’ช Maintainer

Akansh Gulati

gatsby-theme-ghost's People

Contributors

akansh-ixigo avatar akanshgulati avatar yunkii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gatsby-theme-ghost's Issues

npm run dev can't work well

I use npm to run program, but something wrong

> [email protected] dev
> gatsby develop


 ERROR  UNKNOWN

There was a problem loading the local develop command. Gatsby may not be installed in your site's "node_modules" directory. Perhaps you need to run "npm install"? You
might need to delete your "package-lock.json" as well.

then i run npm install to install node_modules, but...
``npm WARN deprecated [email protected]: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (debug-js/debug#797)
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (debug-js/debug#797)
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (debug-js/debug#797)
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /home/ivan/ๆกŒ้ข/blog-gatsby-theme-ghost-master/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c -- (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! make: ่ฟ›ๅ…ฅ็›ฎๅฝ•โ€œ/home/ivan/ๆกŒ้ข/blog-gatsby-theme-ghost-master/node_modules/sharp/buildโ€
npm ERR! TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR! CXX(target) Release/obj.target/sharp/src/common.o
npm ERR! make: ็ฆปๅผ€็›ฎๅฝ•โ€œ/home/ivan/ๆกŒ้ข/blog-gatsby-theme-ghost-master/node_modules/sharp/buildโ€
npm ERR! info sharp Using cached /home/ivan/.npm/_libvips/libvips-8.7.4-linux-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.9.12 found at "/home/ivan/anaconda3/bin/python3"
npm ERR! gyp info spawn /home/ivan/anaconda3/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/ivan/ๆกŒ้ข/blog-gatsby-theme-ghost-master/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/ivan/.cache/node-gyp/18.13.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/home/ivan/.cache/node-gyp/18.13.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/ivan/.cache/node-gyp/18.13.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/ivan/ๆกŒ้ข/blog-gatsby-theme-ghost-master/node_modules/sharp',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! : warning: "_GLIBCXX_USE_CXX11_ABI" redefined
npm ERR! : note: this is the location of the previous definition
npm ERR! In file included from /home/ivan/.cache/node-gyp/18.13.0/include/node/v8-local-handle.h:12,
npm ERR! from /home/ivan/.cache/node-gyp/18.13.0/include/node/v8-array-buffer.h:12,
npm ERR! from /home/ivan/.cache/node-gyp/18.13.0/include/node/v8.h:24,
npm ERR! from /home/ivan/.cache/node-gyp/18.13.0/include/node/node.h:73,
npm ERR! from ../src/common.cc:22:
npm ERR! /home/ivan/.cache/node-gyp/18.13.0/include/node/v8-internal.h: In function โ€˜void v8::internal::PerformCastCheck(T*)โ€™:
npm ERR! /home/ivan/.cache/node-gyp/18.13.0/include/node/v8-internal.h:646:38: error: โ€˜remove_cv_tโ€™ is not a member of โ€˜stdโ€™; did you mean โ€˜remove_cvโ€™?
npm ERR! 646 | !std::is_same<Data, std::remove_cv_t>::value>::Perform(data);
npm ERR! | ^~~~~~~~~~~
npm ERR! | remove_cv
npm ERR! /home/ivan/.cache/node-gyp/18.13.0/include/node/v8-internal.h:646:38: error: โ€˜remove_cv_tโ€™ is not a member of โ€˜stdโ€™; did you mean โ€˜remove_cvโ€™?
npm ERR! 646 | !std::is_same<Data, std::remove_cv_t>::value>::Perform(data);
npm ERR! | ^~~~~~~~~~~
npm ERR! | remove_cv
npm ERR! /home/ivan/.cache/node-gyp/18.13.0/include/node/v8-internal.h:646:50: error: template argument 2 is invalid
npm ERR! 646 | !std::is_same<Data, std::remove_cv_t>::value>::Perform(data);
npm ERR! | ^
npm ERR! /home/ivan/.cache/node-gyp/18.13.0/include/node/v8-internal.h:646:63: error: โ€˜::Performโ€™ has not been declared
npm ERR! 646 | !std::is_same<Data, std::remove_cv_t>::value>::Perform(data);
npm ERR! | ^~~~~~~
npm ERR! In file included from ../../nan/nan.h:2818,
npm ERR! from ../src/common.cc:24:
npm ERR! ../../nan/nan_typedarray_contents.h: In constructor โ€˜Nan::TypedArrayContents::TypedArrayContents(v8::Localv8::Value)โ€™:
npm ERR! ../../nan/nan_typedarray_contents.h:34:43: error: โ€˜class v8::ArrayBufferโ€™ has no member named โ€˜GetContentsโ€™
npm ERR! 34 | data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
npm ERR! | ^~~~~~~~~~~
npm ERR! make: *** [sharp.target.mk:140๏ผšRelease/obj.target/sharp/src/common.o] ้”™่ฏฏ 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.15.0-53-generic
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/ivan/ๆกŒ้ข/blog-gatsby-theme-ghost-master/node_modules/sharp
npm ERR! gyp ERR! node -v v18.13.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ivan/.npm/_logs/2023-01-10T04_12_40_613Z-debug-0.log

what should i do next?

MDX Support

Hi,

First of all thanks for this awesome starter.
I am trying to get mdx to work, tried a few times. Would you know how to enable support for this?

Yarn dev error

Hi,
I can build or serve the gatsby due to error following;
React will try to recreate this component tree from scratch using the error boundary you provided, App.

New Gatsby-Theme-Ghost Project won't run on develop

Welcome to the Gatsby theme Ghost repository! ๐Ÿ‘‹๐ŸŽ‰

For questions related to the usage of Gatsby or GraphQL, please check out their docs at https://www.gatsbyjs.org/ and https://graphql.org/

If your issue is with Gatsby.js itself, please report it at the Gatsby repo โžก๏ธย https://github.com/gatsbyjs/gatsby/issues/new.

Issue Summary

Hooks problem causes gatsby develop to fail.
GatsbyDevelopError

To Reproduce

execute:
gatsby new gatsby-blog akanshgulati/gatsby-theme-ghost
cd gatsby-blog
gatsby develop

Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?

I would expect develop to run successfully, hosting the page in develop.

Technical details:

  • Node Version: 12.14.0
  • OS: Windows 10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.