Giter VIP home page Giter VIP logo

next-cms-ghost's Introduction

next-cms-ghost

next-cms-ghost

PRs welcome!

The fastest React frontend for headless Ghost CMS.

Create and publish flaring fast blogs with next-cms-ghost. Powered by the React framework Next.js and content fed by headless Ghost, you'll get a production ready hybrid frontend that combines the best of static and server-rendered sites. Most importantly, your website can be easily distributed globally to be served from the edge. At the same time your content creators can continue to work with the Ghost authoring system they are used to.

 

✨ Features

Ghost CMS integration
  • Supports Ghost `v3` and `v4`
Ghost Casper look & feel
  • Infinite scroll
  • Fully responsive
  • Sticky navigation headers
  • Hover on author avatar
  • Styled 404 page
  • Preview Section in posts
  • Sitemap
  • RSS feed
  • SEO optimized
Extened Casper Styles ✨
  • Dark Mode
  • Featured posts pinned on top
  • Customizable navigation headers
  • Zoom images on click to full-screen
  • Render GitHub Gists
Images with Next/Images 🚀
  • Feature and inline images
  • Auto-optimized images
  • No content shifts due to consistent placeholders
Advanced Routing
  • Auto-detects custom paths
  • Configurable collections
Developer friendly
  • MIT licenced
  • Truly open-source
  • Easy to contribute
  • Made typesafe with TypeScript
Integrated Plugins
  • Member Subscriptions
  • Commenting with Commento or Disqus
  • Syntax highlighting with PrismJS
  • Table Of Contents
  • Contact Page with built-in notification service
  • Google Analytics
NextJS Features
  • Incremental Regeneration
  • Support for Preview

 

🚀 Performance

Lighthouse Score

Scores calculated with Lighthouse 6.4.0.

 

🏁 Getting Started

git clone https://github.com/styxlab/next-cms-ghost.git
cd next-cms-ghost
yarn

# Development
yarn dev

# Production
yarn build

 

🌀 NextJS image optimizations

The IMAGE_DOMAINS environment variable must contain a comma separated list of all domains that you use for in-sourcing images. For example:

IMAGE_DOMAINS=res.cloudinary.com,yoursource.imgix.net

Image optimization is automatically turned off when deploying to Netlify, because it is currently on supported on Netlify.

 

🌎 Domain Settings

The SITE_URL environment variable should be set to the public facing URL of your site, in most cases to your custom domain.

Key Value (example)
SITE_URL https://www.your-blog.org

If you don't specify SITE_URL, it will get populated according to the following defaults:

Platform System Value Conditions
Vercel VERCEL_URL Automatically expose System Environment Variables must be checked
Netlify URL

In all other cases SITE_URL is set to http://localhost:3000.

 

🔑 Ghost Content API keys

All content is sourced from a Ghost CMS. Choose the method according to your build scenario.

Building locally

Create a new text file .env.local in the project root folder with the following content:

CMS_GHOST_API_URL=http://localhost:2368
CMS_GHOST_API_KEY=9fccdb0e4ea5b572e2e5b92942

Change CMS_GHOST_API_URL and CMS_GHOST_API_KEY with the values that you can generate in your Ghost Admin under Integrations.

Building with cloud providers

If you build your project with a cloud provider, the best option is to provide the keys with environment variables:

Key Value (example)
CMS_GHOST_API_URL https://your-ghost-cms.org
CMS_GHOST_API_KEY 9fccdb0e4ea5b572e2e5b92942

 

💫 Deploy

For best results, deploying to Vercel is recommended. As an alternative, you can also deploy to Netlify.

Deploy with Vercel

Deploy to Netlify

 

🤯 Ensure headless mode of Ghost CMS

For best SEO results it is strongly recommended to disable the default Ghost Handlebars theme front-end by selecting the Make this site private flag within your Ghost admin settings.

 

💣 Reporting issues

Please report all bugs and issues at next-cms-ghost/issues.

 

🎈 Contributions

PRs are welcome! Consider contributing to this project if you want to make a better web.

Special thanks goes to these wonderful people (emoji key):


Vince Fulco

📖

Manuel Taberna

🌍

Akshat Mittal

💻

christianlauer

🐛

Rahul Suresh

🐛

Miguel Bernard

💻

Stevan Aji

💻

Toan Le

🐛

Davor Budimir

🐛

Simon Holdorf

🐛

Sumit Kumar

🐛

francolamcn

🐛

Charles Chan

💻

Raihan Ameen

🐛

Andy Grunwald

📖

Hikz

💻

Huy

🐛

Laurent Meyer

💻

Garfounkel

💻

Orleando Dassi

💻

Flavio Li Volsi

💻

Nat Ring

💻

VITOR PEREIRA

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

 

🧐 Disclaimer

This project is not affiliated with NextJS or Ghost.

 

Copyright & License

Copyright (c) 2020 - 2021 styxlab - Released under the MIT license.

next-cms-ghost's People

Contributors

akshatmittal avatar allcontributors[bot] avatar dassiorleando avatar flaviolivolsi avatar harunor avatar marsflow avatar mtaberna avatar nring avatar styxlab avatar vitoropereira avatar weisisheng 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

next-cms-ghost's Issues

Script injection

Hi, thanks for the awesome project.

Wanted to know if script injection in header/footer is supported? I used the ghost admin UI to add script to header. But seems it doesn't get loaded when I load the website. Also, couldn't find those tags in code either. Is script injection supported?

Thanks for your time.

Images from Ghost Headless CMS not loading on NextJS instance.

Hi there, the images I am hosting on the Ghost CMS server does not pull through to my next.js instance of the site. I have the url configured in next.config.js.

You can see what happens here->

The images on Next is pulling through as plain/text and the header preview reads:

Bad request
INVALID_IMAGE_OPTIMIZE_REQUEST

This is the console screenshot on the Next Instance ->
image

No Ghost Admin Panel?

Im new to the whole deployment to cloud even with ghost. I have it deployed successfully, however, I am confused if there is an admin panel like domain.com/ghost/ or not. Else, how do we make posts and what-not?

Deploying on Vercel results in 404 for index page

Deploying to Vercel works pretty nice in general.

However, I have an issue right not that my site (https://thesmartcoder.dev) is showing a 404 page on the index route on Vercel. If you click on Go to the front page → though, the site loads correctly. I've tested in Chrome, Firefox, and on Mobile so far. A new deployment fixes this issue but only for some random amount of time. The internal vercel URL does work though, so maybe it's something with domain resolution and I have to contact Vercel directly? Strange....

Don't manage to connect front end to headless ghost CMS.

I must be missing an step in the guide or it might be an issue from my Ghost Cms installation, as I cannot load the content in the front end.

I have deployed the demo project on Vercel, and added environment variables (type: Plaintext ) as per this step:
image

where Ghost_api_url corresponds to the URL of an existing Ghost installation on an Aws Lightsail instance.
I've created the following integration and added their values inside Vercel's environment:
image

I have set up Ghost to be headless by checking "Make this site private" on the CMS admin (potential issue: the password I set for accessing the site -not the admin- does not go forward, but neither do I get a "Wrong password" message).

Thanks for any help!

Vercel ISR error

Hi @styxlab

My page has 170 posts in homepage
After deployed to Vercel i got below error with JAMIFY_NEXT_ISR enabled.

Screen Shot 2021-02-14 at 15 40 56

[GET] /danh-sach-trang-dia-chi-rut-tien
15:37:24:53
2021-02-14T08:37:28.760Z	a9ca75de-b312-4dc9-88cf-6feb44a734e5	ERROR	Unhandled error during request: Error: Error: EROFS: read-only file system, open '/var/task/.cache/https%3A%2F%2Fcms.comoex.com%2Fcontent%2Fimages%2F2021%2F02%2Feditor-uploads-2F1549702739553-1549702739552.jpeg.txt'
    at getPostBySlug (/var/task/.next/serverless/pages/[...slug].js:9300:134)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async getStaticProps (/var/task/.next/serverless/pages/[...slug].js:1549:10)
    at async renderToHTML (/var/task/node_modules/next/dist/next-server/server/render.js:28:109)
    at async renderReqToHTML (/var/task/.next/serverless/pages/[...slug].js:2871:334)
    at async render (/var/task/.next/serverless/pages/[...slug].js:2875:626)
2021-02-14T08:37:28.760Z	a9ca75de-b312-4dc9-88cf-6feb44a734e5	ERROR	Error: Error: EROFS: read-only file system, open '/var/task/.cache/https%3A%2F%2Fcms.comoex.com%2Fcontent%2Fimages%2F2021%2F02%2Feditor-uploads-2F1549702739553-1549702739552.jpeg.txt'
    at getPostBySlug (/var/task/.next/serverless/pages/[...slug].js:9300:134)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async getStaticProps (/var/task/.next/serverless/pages/[...slug].js:1549:10)
    at async renderToHTML (/var/task/node_modules/next/dist/next-server/server/render.js:28:109)
    at async renderReqToHTML (/var/task/.next/serverless/pages/[...slug].js:2871:334)
    at async render (/var/task/.next/serverless/pages/[...slug].js:2875:626)
2021-02-14T08:37:28.761Z	a9ca75de-b312-4dc9-88cf-6feb44a734e5	ERROR	Unhandled Promise Rejection 	{"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: Error: EROFS: read-only file system, open '/var/task/.cache/https%3A%2F%2Fcms.comoex.com%2Fcontent%2Fimages%2F2021%2F02%2Feditor-uploads-2F1549702739553-1549702739552.jpeg.txt'","reason":{"errorType":"Error","errorMessage":"Error: EROFS: read-only file system, open '/var/task/.cache/https%3A%2F%2Fcms.comoex.com%2Fcontent%2Fimages%2F2021%2F02%2Feditor-uploads-2F1549702739553-1549702739552.jpeg.txt'","stack":["Error: Error: EROFS: read-only file system, open '/var/task/.cache/https%3A%2F%2Fcms.comoex.com%2Fcontent%2Fimages%2F2021%2F02%2Feditor-uploads-2F1549702739553-1549702739552.jpeg.txt'","    at getPostBySlug (/var/task/.next/serverless/pages/[...slug].js:9300:134)","    at processTicksAndRejections (internal/process/task_queues.js:93:5)","    at async getStaticProps (/var/task/.next/serverless/pages/[...slug].js:1549:10)","    at async renderToHTML (/var/task/node_modules/next/dist/next-server/server/render.js:28:109)","    at async renderReqToHTML (/var/task/.next/serverless/pages/[...slug].js:2871:334)","    at async render (/var/task/.next/serverless/pages/[...slug].js:2875:626)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: Error: EROFS: read-only file system, open '/var/task/.cache/https%3A%2F%2Fcms.comoex.com%2Fcontent%2Fimages%2F2021%2F02%2Feditor-uploads-2F1549702739553-1549702739552.jpeg.txt'","    at process.<anonymous> (/var/runtime/index.js:35:15)","    at process.emit (events.js:327:22)","    at processPromiseRejections (internal/process/promises.js:245:33)","    at processTicksAndRejections (internal/process/task_queues.js:94:32)"]}
Unknown application error occurred

I'm not sure why this happened. It would be great if you could take a look.
Thanks

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

I get this error when trying to deploy directly to Vercel from the ReadMe "Deploy" link:

20:44:38 $ next-sitemap
20:44:38 Done in 48.01s.
20:44:47 Traced Next.js serverless functions for external files in: 8665.374ms
20:44:48 Compressed shared serverless function files: 1757.039ms
20:44:49 All serverless functions created in: 230.176ms
20:44:49 TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
20:44:49 at validateString (internal/validators.js:120:11)
20:44:49 at Object.join (path.js:1039:7)
20:44:49 at Object.build (/vercel/0a7b738f43024159/.build-utils/.builder/node_modules/@vercelruntimes/next/dist/index.js:1:524138)
20:44:49 at async buildStep (/var/task/sandbox-worker.js:116502:24)
20:44:49 at async /var/task/sandbox-worker.js:116184:27 {
20:44:49 code: 'ERR_INVALID_ARG_TYPE'
-- --
20:44:49 }
20:44:51 Done with "package.json"
-- --

I originally had it on my own forked version, so I tested it on the original repo. It happens at the end of the build, and doesn't occur in a local build process. Can't figure out what exactly is happening, and didn't find any very similar issues to troubleshoot with. Seems like it may be an issue with the serverless functions being generated?

Thanks so much for the awesome work and any response!

EDIT: Tested it with updated version of next-sitemap in case that was causing an issue; it didn't make any difference.
EDIT2: Tested it without postbuild script of next-sitemap; no dice :(

QnA

I have some questions with this project.. where i can contact you?

I can't make it run locally following the readme guide.

Hi @styxlab,
Thank you for this sample that merges NextJS and Ghost.

I just tried it but I couldn't succeed in making it work, I have cloned the repo, defined the env variables and hit yarn then yarn dev.

Here's the output: TypeError: sizes.matchAll(...) is not a function or its return value is not iterable

I'm attaching the full error log from the console:

TypeError: sizes.matchAll(...) is not a function or its return value is not iterable at getWidths (webpack-internal:///./node_modules/next/dist/client/image.js:45:36) at generateImgAttrs (webpack-internal:///./node_modules/next/dist/client/image.js:105:7) at Image (webpack-internal:///./node_modules/next/dist/client/image.js:355:169) at processChild (/projet/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14) at resolve (/projet/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5) at ReactDOMServerRenderer.render (/projet/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22) at ReactDOMServerRenderer.read (/projet/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29) at renderToString (/projet/node_modules/react-dom/cjs/react-dom-server.node.development.js:4298:27) at Object.renderPage (/projet/node_modules/next/dist/next-server/server/render.js:54:854) at Function.getInitialProps (webpack-internal:///./node_modules/next/dist/pages/_document.js:128:19) at Function.getInitialProps (webpack-internal:///./pages/_document.tsx:26:24) at loadGetInitialProps (/projet/node_modules/next/dist/next-server/lib/utils.js:5:101) at renderToHTML (/projet/node_modules/next/dist/next-server/server/render.js:54:1145) at process._tickCallback (internal/process/next_tick.js:68:7)

Thanks in advance for your reply.

Idea: Any way to respect responsive image size?

I'm not sure how this can be done or is it possible, but on Ghost we have many image sizes depending on device and screen size, e.g.:
w300: https://cms.vokabula.com/content/images/size/w300/2021/04/blog5-7-problema-kod-u-enja-njema-kog-2.png
w600: https://cms.vokabula.com/content/images/size/w600/2021/04/blog5-7-problema-kod-u-enja-njema-kog-2.png

However, on headless cms there is only one image size, original one, e.g.:

https://cms.vokabula.com/content/images/2021/04/blog5-7-problema-kod-u-enja-njema-kog-2.png

If we have +100 articles, this can cause heavy page size, e.g.:

https://postimg.cc/gallery/rMJWYzX

PS. images have been optimised and reuploaded to ghost image directory, but still too heavy...

Do you think this is possible, styxlab?

Getting "Error: Index creation failed"

Issue:
After cloning the repository on an EC2 instance running Ubuntu 20 and doing the "yarn dev" command, I get the following in the local server URL:
image

On the console:
Error: Index creation failed. at getStaticProps (webpack-internal:///./pages/index.tsx:118:11) at process._tickCallback (internal/process/next_tick.js:68:7)

I thought it might be that I don't have any content to feed to the front end, so in ".env.local" I changed the default URL and API key for the ones pointing to a custom integration to an existing Ghost cms instance running on Lightsail. Still, same problem.

Could anyone point me out to what am I missing? Thanks

Unhandled Runtime Error

This happens when you try to open the admin backend:

Unhandled Runtime Error
Error: Failed to load static props

../../../../next-server/lib/router/router.ts (341:12) @ eval

339 | throw new Error(SSG_DATA_NOT_FOUND_ERROR)
340 | }

341 | throw new Error(Failed to load static props)
| ^
342 | }
343 | return res.json()
344 | })

Navigation slow on development

It seems like the navigation is a bit slow when we're in development mode.

Why is it?

How to reproduce

  • Clone this repo
  • yarn dev
  • Try click one of the post. It will take a few seconds before new page loaded

MDX to posts

Awesome work with this theme. Pretty new på Next.js but this was fairly easy to deploy :)

Are there any plans to let you add markdown files as a source for blog posts instead of sourcing from Ghost CMS?

Feature: Support next export

Currently, when you run next export in this repository, you'll get the following error message:

Error: Image Optimization using Next.js' default loader is not compatible with `next export`.
Possible solutions:
  - Use `next start`, which starts the Image Optimization API.
  - Use Vercel to deploy, which supports Image Optimization.
  - Configure a third-party loader in `next.config.js`.

Option 3 should be used to make next export available here. Some more investigation is needed on how to make this work.

basePath configuration does not work when deploying to Vercel

I tried using the basePath option in next.config.js, but deploying to Vercel fails with the error below.

How to reproduce

  1. git clone a fresh copy of this repository
  2. update next.config.js and add basePath: '/pages', (I added mine right after reactStrictMode: true,)
  3. Run vercel from the terminal and try deploying to a new project

Vercel will throw the following error:

Error! ENOENT: no such file or directory, open '/vercel/workpath0/.next/server/pages/pages/404.html'

Checking the logs sheds some more light:

$vercel logs [my project]



2021-04-03T07:05:04.325Z  ●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
2021-04-03T07:05:04.325Z     (ISR)     incremental static regeneration (uses revalidate in getStaticProps)
2021-04-03T07:05:04.325Z


2021-04-03T07:05:04.547Z  $ next-sitemap
2021-04-03T07:05:04.649Z  Done in 56.12s.
2021-04-03T07:05:21.917Z  Traced Next.js server files in: 17230.042ms
2021-04-03T07:05:23.957Z  [Error: ENOENT: no such file or directory, open '/vercel/workpath0/.next/server/pages/pages/404.html'] {
2021-04-03T07:05:23.957Z    errno: -2,
2021-04-03T07:05:23.957Z    code: 'ENOENT',
2021-04-03T07:05:23.958Z    syscall: 'open',
2021-04-03T07:05:23.958Z    path: '/vercel/workpath0/.next/server/pages/pages/404.html'
2021-04-03T07:05:23.958Z  } {
2021-04-03T07:05:23.958Z    file: FileFsRef {
2021-04-03T07:05:23.958Z      type: 'FileFsRef',
2021-04-03T07:05:23.958Z      mode: 33188,
2021-04-03T07:05:23.958Z      contentType: undefined,
2021-04-03T07:05:23.959Z      fsPath: '/vercel/workpath0/.next/server/pages/pages/404.html'
2021-04-03T07:05:23.959Z    },
2021-04-03T07:05:23.959Z    fileName: '.next/server/pages/pages/404.html'
2021-04-03T07:05:23.959Z  }
2021-04-03T07:05:23.960Z  [Error: ENOENT: no such file or directory, open '/vercel/workpath0/.next/server/pages/pages/404.html'] {
2021-04-03T07:05:23.960Z    errno: -2,
2021-04-03T07:05:23.960Z    code: 'ENOENT',
2021-04-03T07:05:23.960Z    syscall: 'open',
2021-04-03T07:05:23.960Z    path: '/vercel/workpath0/.next/server/pages/pages/404.html'
2021-04-03T07:05:23.960Z  }

Image optimization option causes ERR_TOO_MANY_REDIRECTS

Note: Moved this issue to a new thread. Originally posted by @simhol, quote;

Hey @styxlab,

thanks again for taking yourtime with me, much appreciated.

When I run the repo in demo mode, I immediately get

image

in my browser console and images don't show.

This is probably not related but an issue nonetheless :)

Unable to make changes to website using ghost

Hi ! I am to newbie but I spent countless hours to recreate THIS using VERCEL (netlify doesn't work for me) and NEXT.JS . I followed all the relevant steps but I am still unable to unable to make changes to the WEBSITE using ghost. I can see the changes I made on localhost:3000 but when I build and deploy it (yarn build & vercel --prod), everything remains same.

Error: Error: Validation (isSlug) failed for slug

I've received this error on a fresh new project. Just cloned the starter and provided a .env.local file with the API_URL and _KEY to my Ghost instance.

I get the following error in my terminal when running this in my dev environment:

Error: Error: Validation (isSlug) failed for slug
at getPostBySlug (F:\Projects\tsc-blog.next\server\pages\index.js:4018:134)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async getStaticProps (F:\Projects\tsc-blog.next\server\pages[...slug].js:10310:10)
at async renderToHTML (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\render.js:28:1737)
at async F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:112:97
at async __wrapper (F:\Projects\tsc-blog\node_modules\next\dist\lib\coalesced-function.js:1:330)
at async DevServer.renderToHTMLWithComponents (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:137:387)
at async DevServer.renderToHTML (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:138:923)
at async DevServer.renderToHTML (F:\Projects\tsc-blog\node_modules\next\dist\server\next-dev-server.js:35:578)
at async DevServer.render (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:75:236)
at async Object.fn (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:59:580)
at async Router.execute (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\router.js:25:67)
at async DevServer.run (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:69:1042)
at async DevServer.handleRequest (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:34:504)

I've changed nothing in the original repo.

How to modify taxonomy?

Question: how can I modify the taxonomy of my posts?

I'd like to change my routes to /news/[year]/[slug]

API keys exposed

export const ghostAPIUrl = process.env.CMS_GHOST_API_URL || 'https://cms.gotsby.org'
export const ghostAPIKey = process.env.CMS_GHOST_API_KEY || '387f956eaa95345f7bb484d0b8'

There is a reference to a Ghost instance keys in the code, not sure if this was intended behavior. To follow best-practices, personal instance keys should not be included in templates.

Running with Node 16 on ARM M1 causes SIGSEGV

Even after closely following the readme, I couldn't get the project to run in both the local environment as well as in a docker container.

The console output while running inside a container is below:

node ➜ /workspaces/ghost-blog (master ✗) $ yarn
yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 67.42s.

node ➜ /workspaces/ghost-blog (master ✗) $ yarn dev
yarn run v1.22.5
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Using webpack 5. Reason: future.webpack5 option enabled https://nextjs.org/docs/messages/webpack5
event - compiled successfully
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

event - build page: /
wait - compiling...
event - build page: /404
event - compiled successfully
Killed
error Command failed with exit code 137.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
node ➜ /workspaces/ghost-blog (master ✗) $

In local I also got this error:

error Command failed with signal "SIGSEGV".

how to change stiky logo url, and fix author missing profile image?

Hello, when i scroll screen and click the logo, it will redirct to vercel generated domain name from my own domain, click sticky logo then from mydomain.com redirect to example.vercel.app, where can i edit it?

Also, ive had image source url added in the next.config.js file, but my own prolife image won't load from vercel hosting site, it shows from my own instance ghsot cms.

How to add custom components to the Next js post template?

Hi, I'd like to add an accordion element (example from Semantic UI: https://react.semantic-ui.com/modules/accordion/) to have more information be shown in the post on click by the user.
How should I go about configuring the react components so that they point to the right variable coming from the Ghost content API (within the mobiledoc format)?
image

Should I add a tag to that text and assign it in the component class/find a way to pass it as props?
`
render() {
const { activeIndex } = this.state

return (
  <Accordion>
    <Accordion.Title
      active={activeIndex === 0}
      index={0}
      onClick={this.handleClick}
    >
      <Icon name='dropdown' />
      What is a dog?
    </Accordion.Title>
    <Accordion.Content active={activeIndex === 0}>
      <p class="tag-data-from-mobiledoc">
        A dog is a type of domesticated animal. Known for its loyalty and
        faithfulness, it can be found as a welcome guest in many households
        across the world.
      </p>
    </Accordion.Content>`

Thanks for any help!

Vercel hosting site couldn't catch seo meta from my own ghost installation

Hi, i have meet a tough problem with seo meta on my vercel ghost site.

I have my own ghost installation with seo meta & serp setup and it shows well on chrome tag, with title & description in home page, post, and page. however in the vercel side, every page it only shows the title (My site name, no description), and in post, it shows the title and no description neither.

How do i make a change?

Error: ENAMETOOLONG: name too long when deploying to Vercel

Apparently, some post images coming in via Unsplash generate filenames that are too long. It doesn't happen with every image though, but for this specific one:

https://images.unsplash.com/flagged/photo-1563536314719-2e812e896f50?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80

Error message from Vercel:
Could not write to file cache. This is expected during ISR, but not during deploy. Error: ENAMETOOLONG: name too long, open '/vercel/workpath0/.cache/https%3A%2F%2Fimages.unsplash.com%2Fflagged%2Fphoto-1563536310477-c7b4e3a800c2%3Fcrop%3Dentropy%26cs%3Dtinysrgb%26fit%3Dmax%26fm%3Djpg%26ixid%3DMnwxMTc3M3wwfDF8c2VhcmNofDQxfHxwcm9ncmFtbWVyfGVufDB8fHx8MTYxNzYwNTE4Mw%26ixlib%3Drb-1.2.1%26q%3D80%26w%3D2000.txt'

Migrate to CSS-in-JS

Any recommendation to migrate to CSS-inJS solutions like chakra-ui I'm currently using in the rest of my codebase?

Does it sound interesting to do this work for the community?

How to add Infinite Scroll?

It's me again :)

This time is not an issue, but a question.

After trying both next and gatsby version, my personal preference is next.js version. However, next.js version doesn't have 2 things: Infinite Scroll and lazy-loading images with blur-up effect.

Infinite Scroll would be really nice, because when 100+ posts are made, it can become a bit heavy page, like my current blog: blog(dot)vokabula(dot)com.

Or there is a way to integrate this?

Read-Only File System Error- Vercel

Hello,

I have this persistent issue where I keep getting an EROFS when in production on Vercel.

For the following paths:

'/var/task/.cache/%2Fvar%2Ftask%2Fpublic%2Fsite-meta.png.txt'
'./public/rss.xml'

This doesn't happen locally (production) only on Vercel - I haven't tried Netlify yet I will update once I do.

I have two pages which have been added by me:

  • 'About' /about
  • 'Contact' /contact

UPDATE:

By disabling rssFeed it removed the rss issue.
By disabling fileCache it removed the site-meta issue.

Log:

[GET] /_next/data/uga8odFSy2oeXWkkOstfj/tag/poems.json 13:01:17:07 EROFS: read-only file system, open '/var/task/.cache/%2Fvar%2Ftask%2Fpublic%2Fsite-meta.png.txt' at Object.openSync (fs.js:476:3) at Object.writeFileSync (fs.js:1467:35) at setCache (/var/task/.next/serverless/pages/tag/[...slug].js:7225:25) at imageDimensionsFromFile (/var/task/.next/serverless/pages/tag/[...slug].js:7324:3) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async seoImage (/var/task/.next/serverless/pages/tag/[...slug].js:6344:23) at async getStaticProps (/var/task/.next/serverless/pages/tag/[...slug].js:5075:19) at async renderToHTML (/var/task/node_modules/next/dist/next-server/server/render.js:28:109) at async renderReqToHTML (/var/task/.next/serverless/pages/tag/[...slug].js:1256:334) at async render (/var/task/.next/serverless/pages/tag/[...slug].js:1260:626) { errno: -30, syscall: 'open', code: 'EROFS', path: '/var/task/.cache/%2Fvar%2Ftask%2Fpublic%2Fsite-meta.png.txt' } 2021-02-26T13:01:20.587Z 209213c8-1b68-4f92-93f4-c01ce62c2bae ERROR Error: EROFS: read-only file system, open '/var/task/.cache/%2Fvar%2Ftask%2Fpublic%2Fsite-meta.png.txt' at Object.openSync (fs.js:476:3) at Object.writeFileSync (fs.js:1467:35) at setCache (/var/task/.next/serverless/pages/tag/[...slug].js:7225:25) at imageDimensionsFromFile (/var/task/.next/serverless/pages/tag/[...slug].js:7324:3) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async seoImage (/var/task/.next/serverless/pages/tag/[...slug].js:6344:23) at async getStaticProps (/var/task/.next/serverless/pages/tag/[...slug].js:5075:19) at async renderToHTML (/var/task/node_modules/next/dist/next-server/server/render.js:28:109) at async renderReqToHTML (/var/task/.next/serverless/pages/tag/[...slug].js:1256:334) at async render (/var/task/.next/serverless/pages/tag/[...slug].js:1260:626) { errno: -30, syscall: 'open', code: 'EROFS', path: '/var/task/.cache/%2Fvar%2Ftask%2Fpublic%2Fsite-meta.png.txt' } 2021-02-26T13:01:20.589Z 209213c8-1b68-4f92-93f4-c01ce62c2bae ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: EROFS: read-only file system, open '/var/task/.cache/%2Fvar%2Ftask%2Fpublic%2Fsite-meta.png.txt'","reason":{"errorType":"Error","errorMessage":"EROFS: read-only file system, open '/var/task/.cache/%2Fvar%2Ftask%2Fpublic%2Fsite-meta.png.txt'","code":"EROFS","errno":-30,"syscall":"open","path":"/var/task/.cache/%2Fvar%2Ftask%2Fpublic%2Fsite-meta.png.txt","stack":["Error: EROFS: read-only file system, open '/var/task/.cache/%2Fvar%2Ftask%2Fpublic%2Fsite-meta.png.txt'"," at Object.openSync (fs.js:476:3)"," at Object.writeFileSync (fs.js:1467:35)"," at setCache (/var/task/.next/serverless/pages/tag/[...slug].js:7225:25)"," at imageDimensionsFromFile (/var/task/.next/serverless/pages/tag/[...slug].js:7324:3)"," at processTicksAndRejections (internal/process/task_queues.js:93:5)"," at async seoImage (/var/task/.next/serverless/pages/tag/[...slug].js:6344:23)"," at async getStaticProps (/var/task/.next/serverless/pages/tag/[...slug].js:5075:19)"," at async renderToHTML (/var/task/node_modules/next/dist/next-server/server/render.js:28:109)"," at async renderReqToHTML (/var/task/.next/serverless/pages/tag/[...slug].js:1256:334)"," at async render (/var/task/.next/serverless/pages/tag/[...slug].js:1260:626)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: EROFS: read-only file system, open '/var/task/.cache/%2Fvar%2Ftask%2Fpublic%2Fsite-meta.png.txt'"," at process.<anonymous> (/var/runtime/index.js:35:15)"," at process.emit (events.js:327:22)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:94:32)"]} Unknown application error occurred

[GET] /_next/data/uga8odFSy2oeXWkkOstfj/about.json 13:01:17:00 Loaded env from .env.local 2021-02-26T13:01:20.205Z 56c324e7-9d34-4443-a79e-e1ef9a5c5c1a ERROR Unhandled error during request: Error: EROFS: read-only file system, open './public/rss.xml' at Object.openSync (fs.js:476:3) at Object.writeFileSync (fs.js:1467:35) at getStaticProps (/var/task/.next/serverless/pages/about.js:2730:27) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async renderToHTML (/var/task/node_modules/next/dist/next-server/server/render.js:28:109) at async renderReqToHTML (/var/task/.next/serverless/pages/about.js:1256:334) at async render (/var/task/.next/serverless/pages/about.js:1260:626) { errno: -30, syscall: 'open', code: 'EROFS', path: './public/rss.xml' } 2021-02-26T13:01:20.206Z 56c324e7-9d34-4443-a79e-e1ef9a5c5c1a ERROR Error: EROFS: read-only file system, open './public/rss.xml' at Object.openSync (fs.js:476:3) at Object.writeFileSync (fs.js:1467:35) at getStaticProps (/var/task/.next/serverless/pages/about.js:2730:27) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async renderToHTML (/var/task/node_modules/next/dist/next-server/server/render.js:28:109) at async renderReqToHTML (/var/task/.next/serverless/pages/about.js:1256:334) at async render (/var/task/.next/serverless/pages/about.js:1260:626) { errno: -30, syscall: 'open', code: 'EROFS', path: './public/rss.xml' } 2021-02-26T13:01:20.209Z 56c324e7-9d34-4443-a79e-e1ef9a5c5c1a ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: EROFS: read-only file system, open './public/rss.xml'","reason":{"errorType":"Error","errorMessage":"EROFS: read-only file system, open './public/rss.xml'","code":"EROFS","errno":-30,"syscall":"open","path":"./public/rss.xml","stack":["Error: EROFS: read-only file system, open './public/rss.xml'"," at Object.openSync (fs.js:476:3)"," at Object.writeFileSync (fs.js:1467:35)"," at getStaticProps (/var/task/.next/serverless/pages/about.js:2730:27)"," at processTicksAndRejections (internal/process/task_queues.js:93:5)"," at async renderToHTML (/var/task/node_modules/next/dist/next-server/server/render.js:28:109)"," at async renderReqToHTML (/var/task/.next/serverless/pages/about.js:1256:334)"," at async render (/var/task/.next/serverless/pages/about.js:1260:626)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: EROFS: read-only file system, open './public/rss.xml'"," at process.<anonymous> (/var/runtime/index.js:35:15)"," at process.emit (events.js:327:22)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:94:32)"]} Unknown application error occurred

Please let me know what I can do.

Thank you

Setting overrideOS value to false returns build error

Hello,

I attempted to change the overrideOS value to False using a fresh new install and I am getting an unexpected error.

Code changed:

export const overrideOS: boolean = true

This is my error output:


16:39:30.581 | Unhandled error during request: ReferenceError: window is not defined
-- | --
16:39:30.581 | at supportsDarkMode (/vercel/workpath0/.next/serverless/pages/404.js:3370:90)
16:39:30.581 | at getDefaultMode (/vercel/workpath0/.next/serverless/pages/404.js:3391:14)
16:39:30.581 | at getDark (/vercel/workpath0/.next/serverless/pages/404.js:3413:25)
16:39:30.581 | at DocumentHead (/vercel/workpath0/.next/serverless/pages/404.js:3499:16)


16:39:30.582 | ReferenceError: window is not defined
-- | --
16:39:30.582 | at supportsDarkMode (/vercel/workpath0/.next/serverless/pages/404.js:3370:90)
16:39:30.582 | at getDefaultMode (/vercel/workpath0/.next/serverless/pages/404.js:3391:14)
16:39:30.582 | at getDark (/vercel/workpath0/.next/serverless/pages/404.js:3413:25)
16:39:30.582 | at DocumentHead (/vercel/workpath0/.next/serverless/pages/404.js:3499:16)
16:39:30.583 | at d (/vercel/workpath0/node_modules/react-dom/cjs/react-dom-

I did some investigation and I believe the usage of window function on the server side is not supposed to work, as opposed to the client. I wanted to hear your thoughts before performing more investigation.

// Getting dark mode information from OS!
// You need macOS Mojave + Safari Technology Preview Release 68 to test this currently.
const supportsDarkMode = () => window.matchMedia(`(prefers-color-scheme: dark)`).matches === true
const supportsLightMode = () => window.matchMedia(`(prefers-color-scheme: light)`).matches === true

Support for Ghost v4?

Hello :) Just wondering if (and when) you're going to add support for latest version of Ghost? Thanks and keep up a good work!

How to add a new template to the Ghost CMS and reflect on front-end?

Hi,

I'm running an instance of Ghost on AWS Lightsail together with this repo deployed to Vercel. Connection between the two works fine with the instructions in the README and I added an additional webhook so that every update in the content (e.g. new post) gets a new build started on Vercel. Now, I would like to change my current template and install a new one. I can do that on the Ghost CMS and see the changes but not on the front-end. How should I do that?

Thank you very much!

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.