I have a Docusuarus sample site that renders from my account on GitHub. I would like to add a Netlify preview, but the path the the preview is not the same baseurl that the gh-pages site is. Is there a way to do two base URLs or is there a better way to handle a different base URL for deployment?
Repo: https://github.com/brianjo/pydocsite
Rendered GH site: https://brianjo.github.io/pydocsite
PR with Netlify preview: https://github.com/brianjo/pydocsite/pull/23
Netlify Preview: https://deploy-preview-23--pydocsite.netlify.app/
I can think of some complex things to try, but I'm hoping there is a simple solution I'm missing.
Thanks!
Related
Disclaimer: I would ask this using either a.) some sort of support system on Netlify, b.) on a Netlify live chat session or c.) via their support community but a.) they don't let you, b.) they don't have one and c.) you can't currently create accounts or authorize from Netlify itself. (Seems like as an organisation, they don't really understand what would really nudge you into making you pay for a service).
Anyways, I am having an issue with deploying an Vue.js SPA with VueRouter via a netlify.toml configuration. The issue is, all internal routing is not being handled by the SPA. My solution has always been to stick a netlify.toml config file in the root of the repository that I am deploying from, with the following:
# The following redirect is intended for use with most SPAs that handle routing internally.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
Yet, every internal route I visit gives me:
The exact same repo, but deployed on my personal plan 4 months ago (which has the same netlify.toml config in the same location) works fine. The application is also working on the current deployment branch locally. The routing is not broken. Has anyone else suffered with this inconsistent approach to redirects with Netlify?
So, my specific fix was to do the following:
Add a _redirects file to the public directory of my Vue application, then:
# The following redirect is intended for use with most SPAs that handle routing internally.
/* /index.html 200
Inside that file.
So for me, netlify.toml configuration for redirects is stil broken.
I am seeing exactly this behaviour as well. The netlify.toml contains:
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
But doesn't work. The deployment summary even shows that netlify didn't pick up the redirect config at all:
No redirect rules processed
This deploy did not include any redirect rules. Learn more about redirects.
I just faced this issue like 2hrs ago from now, but the netlify.toml is working fine for me. Make sure you have set the public directory in your netlify setting to '/' (exactly where your netlifly.toml resides) instead of blank or anything else.
I am using netlify and would like to build 2 apps, which basically create static /dist folders.
Now I would like netlify to manage routing for example app.com/app1 and app.com/app2 to point to the two various builds.
Is this possible via the .toml file?
I've already answered a question about an identical use case here: Reverse proxy same naked domain to different hosts
While that answer refers to cloudflare because the question did, the answer is how to do it using just Netlify. I use the _redirects syntax in the answer instead, but the workflow is the same:
deploy two Netlify sites to make two builds. One will be app.com and one will be your subsite. The multiple build commands, you will only be able to control with two toml files assuming that you have two repos. If they are subdirs in the same repo, the config will have to be in netlify's UI (also possible via API) instead.
(reverse) proxy from the main site to the subsite for the subdirectory
using toml syntax like the below on the main site (app.com):
[[redirects]]
from = "/subsite/*"
to = "https://other-netlify-site.netlify.com/subsite/:splat"
status = 200
force = true
I tried to set up Gitlab Pages, until now I finished uploading my static website files👇
Uploading artifacts...
coverage/lcov-report: found 77 matching files
Uploading artifacts to coordinator... ok id=1038 responseStatus=201 Created token=QXJjgkf2
But I got no idea where my page hosted.
I took a glance at this documentation but it was still vague to me.
I have a private Gitlab instance.
My Gitlab entry is under http://abc.def.com (I configured a type A DNS to my host IP 111.111.111.111, a reverse proxy pointing at localhost:9000).
My project project1 is under my team team1.
I have also configured DNS http://team1.abc.def.com to 111.111.111.111 , and there is a nginx reverse proxy on my server which http://team1.abc.def.com -> localhost:9000.
I assume I should see my static page available on http://team1.abc.def.com/project1 , but nothing was there. Where exactly are my pages hosted?
You have to activate the pages feature. In your gitlab.rb:
pages_external_url "IP_OF_YOUR_GITLAB"
gitlab_pages['enable'] = true
There is a tutorial: https://www.youtube.com/watch?v=dD8c7WNcc6s&feature=youtu.be
And the complete documentation: https://docs.gitlab.com/ce/administration/pages/index.html
You'll need to ask your sysadmin under which wildcard domain Pages is served: https://docs.gitlab.com/ce/user/project/pages/getting_started_part_one.html#gitlab-pages-domain
Then you'll know where your site was deployed to.
Example: on GitLab.com, all Pages domains are served under *.gitlab.io, therefore, your website will be deployed to username.gitlab.io (user/group site) or to username.gitlab.io/project-name (project website).
You need to find out the wildcard domain of your GitLab instance and replace gitlab.io with it.
See also: Pages' limitations: https://docs.gitlab.com/ce/user/project/pages/introduction.html#limitations
pages_external_url is the url of your website
You can set up a git-runner to pick the work for publishing your website. In this part you need to deal with .gitlab-ci.yml file
For the gitpage URL, you can find it under setting -> pages, there should be a URL for the website. Usually is under namespace.example.com/projectname.
If you didn't see the page under the setting, it is usually a configuration issue. You just need to enable it, and re-congiure the gitlab.
For gitlab pages to work, you need to put your website files (html, CSS etc.) in a folder named public.
Update your .gitlab-ci.yml file with something like the following
pages:
script:
- mv coverage/lcov-report public
artifacts:
paths:
- public
Also, remember to name the job in question pages
Question
I would like to understand why my CSS resources are not loaded on my personal Github IO page tobias-schmidt.site.
Issue
When I acess my page via the custom dns tobias-schmidt.site or via the direct github dns mrtobe.github.io the site correctly loads the index.html but not the referenced CSS files. When I click on the blog post it does correctly load the CSS. Then for this surfing session the CSS is also available on the index.html.
Setup
dns from GoDaddy with A-Record setup for tobias-schmidt.site - this dns was added in the settings of the github repo
Website is generated with hugo - full project is hosted under https://github.com/mrtobe/mrtobe-hugo - ./deloy.sh is used to deploy the page
Hugo generates a static website that is hosted here https://github.com/mrtobe/mrtobe.github.io
Best guess
I checked different posts and found that it might be mixed content, but I have no idea on how to solve this with github pages.
You have a SSL certificate problem.
tobias-schmidt.site uses an invalid security certificate.
The certificate is only valid for the following names: *.github.com, github.com, *.github.io
Error code: SSL_ERROR_BAD_CERT_DOMAIN
Github pages doesn't provide HTTPS for custom domains.
When you access https://tobias-schmidt.site github pages server is sending his certificate which is not valid for your domain and browser are blocking request until you agree using this certificate.
For now, in conf.toml, you have to set baseurl = "http://tobias-schmidt.site". This in order to have hugo craft http urls.
In a second time, you can try to secure you site with services like cloudflare or have a look at Netlify.
I'm using GitHub pages to host my blog. I've set up a CNAME record in the repository and added an A record and CNAME record to my domain registrar (123-reg). This is working fine so now my personal page donskifarrell.github.com -> donalfarrell.com.
This also makes all my project pages map to the same new domain, eg. donskifarrell.github.com/calex -> donalfarrell.com/calex.
While this is quite nice to have, it is proving to be troublesome for one of my projects.
Is there any way to modify my setup so that certain project pages do not use my own custom domain and instead retain the github url?
Thanks
There isn't really a way to prevent the redirect from happening.
However, if it will help to have that project at a different domain or a subdomain, you can use a CNAME file in the project's gh-pages branch to override your user redirect with a project-specific one.
See more info at the bottom of: https://help.github.com/articles/user-organization-and-project-pages