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

A Docker-based pipeline to publish the content of a local Ghost 4 server as static pages.

License

NotificationsYou must be signed in to change notification settings

rija/ghost-ssg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Docker-based pipeline to publish the content of a local Ghost 4 server as static pages.

How it works

┌──────────────────────────────┐                    ┌──────────────────────────────┐                        ┌──────────────────────────────┐                  ┌──────────────────────────────┐│                              │                    │                              │                        │                              │                  │                              ││                              │                    │                              │                        │                              │                  │                              ││                              │    export          │                              │      preview           │                              │   git push       │                              ││ Post editing and management  ├────────────────────► Static pages on file system  ├────────────────────────►Site served on local web server──────────────────►Site served on GitLab Pages   ││                              │                    │                              │                        │                              │                  │                              ││                              │                    │                              │                        │                              │                  │                              │└──────────────────────────────┘                    └──────────────────────────────┘                        └──────────────────────────────┘                  └──────────────────────────────┘

Prerequisites

  1. You need to have installed on your system already:
  • Docker
  • bash
  • git
  • bats-core (optional, for running the test suite)
  1. To publish to remote destination, you need to have a git-enabled remote static page hosting setup and configured:
Host typeNeeds done beforeMore infos
Bitbuckethave created a new repository on Bitbucket.orghttps://support.atlassian.com/bitbucket-cloud/docs/publishing-a-website-on-bitbucket-cloud/
Codeberghave created a new public repo named "pages" on Codeberg.orghttps://docs.codeberg.org/codeberg-pages/
GitHubhave followed instructions in the docs on Github.comhttps://docs.github.com/en/pages/quickstart
GitLabhave created a new project of type "Pages/Plain HTML" on GitLab.comhttps://docs.gitlab.com/ee/user/project/pages/

Disclaimer: at time of writing, I have only tested with GitLab.com (it may work on other GitLab-based forges - like framagit.org - , not sure for the other ones)

Usage

  1. Run the setup script:
$ ./setup

Then edit .env file to assign a value toDEST_REPO, ensure the value for PAGES_REPO_PATH and DEST_BRANCH are correct

  1. Start the servers (the blog editor, the preview server and the backup server)
$ ./up

Ghost is now available athttp://localhost:2368

  1. Export the content of Ghost as static file for preview
$ ./preview

A preview of the static website can be viewed athttp://localhost:9999

  1. Publish the content of Ghost
$ ./publish

The static web pages are first exported in thepublic directory inside the directory defined by the $PAGES_REPO_PATH variable.Then the changes are commited and pushed to the remote git repository.

  1. Backup your installation
$ ./backup

This will backup the SQL database and the content directory

  1. Shutdown the servers
$ ./down

Troubleshooting

  • Show what server is up:
$ ./whatsup
  • Inspect the server logs:
$ ./log
  • Show the current versions of the dependencies
$ ./versions
  • Run the test suite
$ ./test
  • Restore from backup
$ ./restore

[8]ページ先頭

©2009-2025 Movatter.jp