octopusthink / ghost-ship

A Gatsby starter template for websites & blogs. Designed for accessibility and SEO-friendliness.
MIT License
2 stars 0 forks source link

Allow for easily disabling blog and portfolio #25

Open sarahmonster opened 4 years ago

sarahmonster commented 4 years ago

This was kind of addressed via #12, but I was definitely expecting to be able to do more configuration work (ie, stripping out the blog and portfolio) from the config file, which isn't the case.

So for instance, I can set authors and tags to false:

enableBlogAuthors: false,
enableBlogTags: false,

...but if I delete the authors or tags yaml files, I get a whole slew of errors, and there's no way to say I don't want or need a blog at all. (Or a portfolio!)

Looking in utils/settings.js (which I think is intending to act as a sort of automatic settings file, although that confused me too so it could use some commenting) it looks as though deleting the blog and portfolio directories will do the trick. When I tried this, I seemed to bork everything:

ERROR

UNHANDLED REJECTION Cannot read property 'resolve' of undefined
TypeError: Cannot read property 'resolve' of undefined

How does one remove the blog and portfolio features from a Ghost Ship site?

tofumatt commented 4 years ago

Yeah, this is a case where I shipped some features but I think things needed real-world testing to see about expectations and usage patterns.

There's an npm command used to remove the blog and portfolio, because doing it with config alone wasn't really possible (or at least elegant) the way Gatsby sources files and deals with GraphQL queries.

To remove the blog, you'd run npm run remove:blog. It's not great but it was the best way to get this working well and have only a single thing to do to remove the blog 😄

To remove all "non-optional" features (and just have a simple static site) you'd run npm remove:all. That'll get you all the fancy ghost-ship features without things like a blog or portfolio.

I'll leave this open until we add it to the README 😄

sarahmonster commented 4 years ago

I tried this, but I think we need to do a bit more yet to make it work properly—it's just removing all the files I tried to manually remove, which is a good start, but it still breaks the build:

ERROR

UNHANDLED REJECTION Cannot read property 'resolve' of undefined

TypeError: Cannot read property 'resolve' of undefined

I think this might be related to #30.