Comments (12)
So I've tried to get this to work on github pages and it's not been very successful. The main issue is because of this chart of supported subdomains/folders.
Essentially I haven't quite figured out how to get the rootUrl
stuff with Ember to play nicely with where the static JSON files end up in the deployment.
I have however had a lot more success using Netlify which essentially Just Worksβ’οΈ out of the box π Is there any particular reason why you would want to use github pages instead? Netlify is free btw π
from empress-blog.
This article talks about the rootURL
stuff if its helps https://www.emberjs.com/blog/2016/04/28/baseURL.html
from empress-blog.
So the problem isn't just the rootURL itself, it's a combination of some of the assumptions that are made with having static JSON "on disk" that is pretending to be an API.
Also if you look at that chart I sent you, the 2 options that require you to add projectname
at the end of the url would then require the use of hash based routing. For example one of my blogs that is built with this:
https://blog.stonecircle.io/broccoli-starting-the-build-and-eating-your-greens
would need to change to:
https://blog.stonecircle.io/blog#broccoli-starting-the-build-and-eating-your-greens
which doesn't work for SEO any more because everythign after the #
is strictly in the browser.
If you're using either of the 2 cases that doesn't require the trailing folder name then this shoudl Just Workβ’οΈ π
from empress-blog.
You can find my project here: https://gitlab.com/ishu3101/ember-ghost/. When I run the project on my local computer on http://localhost:4200 it works fine, but when deployed on gitlab pages I'm getting this error in the developer console.
Error while processing route: post Ember Data Request GET /content/ember-ghost.json returned a 404
from empress-blog.
@ishu3101 so as I said a few comments ago, it currently doesn't support Github Pages or gitlab pages that need a subdirectory in the URL. I have found this video that suggests a way to fix this on git lab where you can have it as a "user/group website".
Essentially you can rename the repo to ishu3101.gitlab.io
and then remove your routerRootURL
config here: https://gitlab.com/ishu3101/ember-ghost/blob/master/config/environment.js#L7 and it might work π
from empress-blog.
Changing the application.js
file in the ember-ghost/app/adapters/application.js
to below, causes the site to load as a subdirectory like /ember-ghost/ with all the css and js loading fine but it is still looking for the images in the root of the directory ie /images/
rather than /ember-ghost/images/
when rootURL
is set to /ember-ghost/
in the environment.js
file.
if (requestType === 'queryRecord') {
return `${config.rootURL}${prefix}/${modelName}/${query.path}.json`;
} else if (requestType === 'query') {
return `${config.rootURL}${prefix}/${modelName}/${query.path}.json`;
} else if (requestType === 'findRecord') {
return `${config.rootURL}${prefix}/${modelName}/${id}.json`;
}
However when I set rootURL back to /
, and try to load the site, it displays an error message saying Error: The adapter operation was aborted
from empress-blog.
There are a lot of reasons why this is currently not supported, some of which are related to the images. We would like to support it at some point in the future but it's unfortunately not quite as simple as fixing the rootUrl in the application adapter.
Did you see any of my messages about deploying this as a user or "group" website on gitlab? Also have you had a chance to try this on Netlify? It is literally a 5 mins process on Netlify and is 100% free π you can even set a custom domain for yourself
from empress-blog.
I already have a site as a user pages on gitlab. Yes I tried it on netlify as well but getting Assertion Failed: Path / does not start with the provided rootURL /ember-ghost/
from empress-blog.
that's because you would need to undo your changes to rootURL and routerRootURL or anything like that.
A basic out-of-the-box ember-ghost app works with no changes on Netlify
from empress-blog.
Yeah managed to get it working with Netlify. However I would appreciate if support for hosting on a subdirectory was added.
from empress-blog.
I have plans to support subdirectories but as you can see it's not a trivial change π’
If you are motivated to get it working maybe we could arrange a call sometime and figure out all the pain points together? Is that something that you would be interested in?
from empress-blog.
I dont have any experience with ember apart from setting up my blog using ember-ghost. However I would be interested in getting it to support subdirectories.
from empress-blog.
Related Issues (20)
- Embedded comment section? HOT 1
- ENOENT -4058
- Building via Github Action HOT 2
- Add ember-responsive-image documentation HOT 4
- Outdated images documentation HOT 2
- Extending the built-in routes...
- Error While Rendering Responsive Image HOT 18
- Big warning shown when starting ember s
- Not compatible with ember-data 3.28? HOT 3
- Can't configure low-quality-image-placeholder / lqip? HOT 1
- Default page-load performance is not great (it's not bad, but we want to be great!) HOT 2
- Not compatible with Embroider HOT 1
- ember-responsive-image fails to find image metadata HOT 5
- Unclear error regarding tags
- [BUG] the canonical url is not being built correctly HOT 2
- Support Responsive Images via Showdown Extension
- Not compatible with Ember Data 5.x HOT 2
- How do I use gjs highlighting?
- Why use ember-data at all? HOT 4
- `Site Not Found`: empress-blog.netlify.com HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from empress-blog.