Ghost is an open source professional publishing platform based on the modern Node.js technology stack

Ghost is an open source professional publishing platform based on the modern Node.js technology stack

2022-10-19 0 852
Resource Number 46083 Last Updated 2025-02-24
¥ 0HKD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

Ghost is an open source professional publishing platform based on the modern Node.js technology stack.

Ghost is an open source professional publishing platform based on the modern Node.js technology stack插图

Ghost is an open source professional publishing platform based on the modern Node.js technology stack, designed for teams that need power, flexibility, and performance.

Ghost feature

Very fast

Reliable and safe

Great design

Modern technology

Open source

Own your brand + data

Using custom fields

Control your website design

No review

Built-in SEO control

Native REST API

Integrated SDK

Built-in membership and subscription
Business function

For any front-end
or static web site framework

How to install Ghost

The quickest way to get started is to set up a site on Ghost(Pro). If you are running a self-hosted instance, we strongly recommend that you use an Ubuntu server with at least 1GB of memory to run Ghost.

Local installation Ghost

Ghost-CLI is a command line tool that helps you quickly and easily install and configure Ghost for use. The npm module can be installed on the local computer, and npm can also install yarn on the local computer, depending on your preference.

npm install ghost-cli@latest  -g

After installation, you can always run ghost help to see a list of available commands.

In your terminal, cd goes to an empty directory and runs the installation command:

ghost install local

After installation, you will be able to access your new site http://localhost:2368 and
http://localhost:2368/ghost access Ghost Admin.

Start and stop

Ghost runs in a separate background process and keeps running until you stop it or restart your computer. So you may find these commands useful for using it:

  • ghost stop Stop ghost
  • ghost start ghost
  • ghost log
  • ghost ls Lists all running Ghost blogs

Verification using GScan

GScan is a tool to verify that the Ghost theme is compatible with the latest version of Ghost. Ghost automatically runs this tool when the theme is uploaded or activated. For development purposes, you can also run these checks yourself by installing it locally.

# Install gscan globally
npm install gscan -g

# Scan a theme directory for compatibility
gscan /path/to/ghost/content/themes/casper

# Scan a theme zip file for compatibility
gscan -z /path/to/downloads/theme.zip

Install Ghost from source code

First create a GitHub branch: First, you need to create a branch of the Ghost and ghost-admin repositories. Click the fork button on the top right and wait for a copy to be created on your personal GitHub account.

The next step is to configure the Git repository for local development: the main Ghost repository contains the full Ghost package, including admin clients and default themes, which will also be set up automatically

# First clone Ghost with submodules and make it  your working dir
git clone --recurse-submodules git@github.com:TryGhost/Ghost & &  cd Ghost

Rename

# Rename origin to upstream
git remote rename origin upstream

# Add your fork as an origin, editing in < YourUsername> ! 
git remote add origin git@github.com:< YourUsername> /Ghost.git

Because ghost-admin is a submodule repository for the Ghost main repository, you need to repeat the same steps to configure Git here as well.

# Switch to Ghost-Admin dir
cd core/admin

Update Ghost-Admin

# Quick check that everything is on  latest
git checkout main & &  git pull upstream main

# Then return to Ghost root directory
cd .. /.. /

Run setup and installation

# Only ever run this once
yarn setup

This setup task installs dependencies, initializes the database, sets up git hooks, initializes submodules, and runs the administrator’s first build.

Test

< Server test

Run the test using SQlite. To use MySQL, add NODE_ENV=testing-mysql

before the command

yarn test:unit
# Run unit tests

yarn test:acceptance
# Run acceptance tests

yarn test:regression
# Run regression tests

yarn test path/to/test.js
# Run a single test

yarn test test/unit/helpers
# Run a folder of tests

yarn test:all
# Run all tests

yarn lint
# Make sure your code doesn't suck

Client test

Client tests should always run inside the core/admin directory. Any time yarn dev runs client tests
http://localhost:4200/tests

ember test
# Run all tests in Chrome + Firefox

ember test --server
# Run all tests, leave results open, and watch for changes

ember test -f 'gh-my-component'
# Run tests where `describe()` or `it()` matches supplied argument
# Note: Case sensitive

ember test --launch=chrome
# Run all tests in Chrome only

ember test -s -f 'Acceptance:  Settings - General' --launch=chrome
# Most useful test comment for continuous local development
# Targets specific test of area being worked on
# Only using Chrome to keep resource usage minimal

Troubleshooting

ERROR: (EADDRINUSE) Failed to start Ghost

This error indicates that Ghost is already running and you need to stop it.

ERROR: ENOENT

This error means that the mentioned file does not exist.

ERROR Error: Module not found

Installation not complete. Run yarn:fix.

Error: Module not found”
./build/default/DTraceProviderBindings”

You switched node versions. Run yarn:fix.

ENOENT: no such file or directory, showing ‘path/to/favicon.ico’

at error (local)

Your administrative client has not yet been built. Run yarn dev.

TypeError: Cannot read property ‘tagName’ of undefined

You cannot run yarn dev at the same time as ember test. Wait for the test to complete before continuing, and wait for the “build successful” message before loading the administrator.

Topic development

The

Ghost theme uses the Handlebars template language, which uses helper programs to establish a strong separation between templates (HTML) and any JavaScript logic. This allows themes to be very fast, have dynamic client applications, and publish content on the server side as static HTML sent to the browser.

Ghost also uses an add-on library called express-hbs that adds some additional functionality to Handlebars, such as layout and localisation.

If you’ve built themes for other popular platforms before, it’s pretty easy to use the Ghost theme layer. This document gives you the tools you need to create static HTML and CSS for your theme, using Handlebars expressions when you need to render dynamic data.
To use GScan as a command line tool, install the gscannpm package globally:

# Install the npm package
npm install -g gscan

# Use gscan < file path>  anywhere to run gscan against a folder
gscan /path/to/ghost/content/themes/casper

# Run gscan on a zip file
gscan -z /path/to/download/theme.zip

Topic recommendation

Ghost is an open source professional publishing platform based on the modern Node.js technology stack插图1

Ghost is an open source professional publishing platform based on the modern Node.js technology stack插图2

Ghost is an open source professional publishing platform based on the modern Node.js technology stack插图3

—END—

Open Source protocol: MIT license

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free Source Code Ghost is an open source professional publishing platform based on the modern Node.js technology stack https://ictcoder.com/ghost-an-open-source-professional-publishing-platform-based-on-modern-node-js-technology-stack/

Share free open-source source code

Q&A
  • 1. Automatic: After making an online payment, click the (Download) link to download the source code; 2. Manual: Contact the seller or the official to check if the template is consistent. Then, place an order and make payment online. The seller ships the goods, and both parties inspect and confirm that there are no issues. ICTcoder will then settle the payment for the seller. Note: Please ensure to place your order and make payment through ICTcoder. If you do not place your order and make payment through ICTcoder, and the seller sends fake source code or encounters any issues, ICTcoder will not assist in resolving them, nor can we guarantee your funds!
View details
  • 1. Default transaction cycle for source code: The seller manually ships the goods within 1-3 days. The amount paid by the user will be held in escrow by ICTcoder until 7 days after the transaction is completed and both parties confirm that there are no issues. ICTcoder will then settle with the seller. In case of any disputes, ICTcoder will have staff to assist in handling until the dispute is resolved or a refund is made! If the buyer places an order and makes payment not through ICTcoder, any issues and disputes have nothing to do with ICTcoder, and ICTcoder will not be responsible for any liabilities!
View details
  • 1. ICTcoder will permanently archive the transaction process between both parties and snapshots of the traded goods to ensure the authenticity, validity, and security of the transaction! 2. ICTcoder cannot guarantee services such as "permanent package updates" and "permanent technical support" after the merchant's commitment. Buyers are advised to identify these services on their own. If necessary, they can contact ICTcoder for assistance; 3. When both website demonstration and image demonstration exist in the source code, and the text descriptions of the website and images are inconsistent, the text description of the image shall prevail as the basis for dispute resolution (excluding special statements or agreements); 4. If there is no statement such as "no legal basis for refund" or similar content, any indication on the product that "once sold, no refunds will be supported" or other similar declarations shall be deemed invalid; 5. Before the buyer places an order and makes payment, the transaction details agreed upon by both parties via WhatsApp or email can also serve as the basis for dispute resolution (in case of any inconsistency between the agreement and the description of the conflict, the agreement shall prevail); 6. Since chat records and email records can serve as the basis for dispute resolution, both parties should only communicate with each other through the contact information left on the system when contacting each other, in order to prevent the other party from denying their own commitments. 7. Although the probability of disputes is low, it is essential to retain important information such as chat records, text messages, and email records, in case a dispute arises, so that ICTcoder can intervene quickly.
View details
  • 1. As a third-party intermediary platform, ICTcoder solely protects transaction security and the rights and interests of both buyers and sellers based on the transaction contract (product description, agreed content before the transaction); 2. For online trading projects not on the ICTcoder platform, any consequences are unrelated to this platform; regardless of the reason why the seller requests an offline transaction, please contact the administrator to report.
View details

Related Source code

ICTcoder Customer Service

24-hour online professional services