Github Page using Ruby on Rails - ruby-on-rails

I have created a static website using Rails (no models, only a view and its corresponding controller). I want it to be deployed on Github Pages, i.e., typing this link on the browser and hitting Enter must show my static website: https://my-username.github.io.
How do I do it?

If you wish to deploy a static website to GitHub Pages without using Jekyll, you'll need to build the static content locally, and then push it to your GitHub repository with a .nojekyll file in the root so GitHub Pages does not try to run Jekyll on it.
More info at the GitHub Pages docs.

Related

Links issue when I deploy my Hugo site as a Github Pages project

I created a Hugo site that working well locally. I deployed my Hugo site as a Github Pages project via a /docs folder on the master branch.
So now, I have my Github Page project and my URL looks like that:
https://myname.github.io/myrepository/myHugoSite.
I have a problem with my link. All my links redirect to https://myname.github.io/ but not https://myname.github.io/myrepository/ because my links are /next-page/. These links are working locally because I don't have a repository.
My question is: Do I have to add /myrepository/ to all my links or there is another solution?
You need to add your site prefix to the baseUrl parameter in the config file. In your case the prefix is myrepository/
If you are using TOML format in your config file it would look like this:
baseUrl = "https://myname.github.io/myrepository/"
Note that with Higo 0.62.1 (and more recent), you can have portable links.
See bep/portable-hugo-links as an example.
truly portable Markdown links and images. No shortcodes used.
This page includes the following links, which would be rendered correctly both on GitHub and Hugi generated pages:
* [Blog Link1](../blog/p1/index.md)
* [Blog Link2](../blog/p2.md)
* [Home Page](/README.md)
* [Local Anchor](#et-illis-ossaque-loqui-ille)

Github Pages return 404 error

I have several github repos that I'm trying to publish as github pages. I've created gh-pages branches for them and their repo's say that the pages exist, but when I go to the links they provide I find a 404 page.
I know that github pages are finicky and return this error if the home page isn't called "index.html" and I suspect that the problem is related to that, but I'm not sure how to fix it. All of the projects in question are rails apps with homepages in the views/home called "index.html.erb" and routes designating those pages as root. Do I need to rename those pages or there some other way to fix this?
Github pages is used only for static websites, you cannot host applications on it.
You wrote that you hosted *.html.erb files, which means you are trying to setup a rails application on it.
You can use static website builders to create Github sites, or code them on your own.
#bukk530 is absolutely correct.
Additionally, it would be worth noting that GitHub Pages does support hosting Jekyll sites, but nothing else. Static HTML/CSS/JavaScript and Jekyll.

Hosting a static ruby site on heroku, and adding pages

I have just finished following this tutorial on Heroku's website:
https://devcenter.heroku.com/articles/static-sites-ruby
Everything works fine and I can access my index.html file and all images, css and js when I run my local server.
The question I have is: How do I add another page? Right now, only the index.html page works as the root, but I have one other page called /faq.html (also in my public folder).
When I try and access it through the navbar on the website (on my running local server), it just reloads the root url again. How can I root to this page?
Thanks for the help

How to access the project documentation pages created using Gdoc in grails

I followed the tutorial on the grails documentation was successfully able to create project specific documentation pages by running the following command
grails doc
I was able to view the HTML pages from my desktop and I found them on the following directory:
..\target\docs\index.html
I was wondering how to access these generated HTML pages from the server. What is the URL to view them from the server?
I tried the following URL but did not work?
http://localhost:8080//docs/index.html
Also, the grails documentation states that the command will output an docs/manual/index.html
page. Rather I found the index.html page on the following directory:
..\target\docs\index.html
Can anyone help me in this?
Thanks
They're not built to be viewed from the running application, so they're not automatically exposed as a url. But you can move them to the web-app folder and they'll be accessible.
You can also configure the build location to be under web-app. Add this line to grails-app/conf/BuildConfig.groovy:
grails.project.docs.output.dir = 'web-app/docs'

How to create multiple wiki pages in Bitbucket and see/edit them later?

I could create multiple wiki with '+new' link, but after creating it, there is no easy way to see this new page from repository home page. Only 'home' (default) wiki is available. Am I missing something ?
In github, this feature intuitive and pretty straight forward. You can see all you wiki pages with the 'pages' link.
You can more or less reproduce the "pages" page from github by replacing the text in the root page by the following:
<<toc / >>
Though their does not appear to be a feature that lists all the created wiki pages on bitbucket, you could clone the wiki repository in order to view and edit each wiki page as a separate file. The command to clone a wiki is something like:
hg clone https://<user>#bitbucket.org/<user>/<project>/wiki
To create a wiki page- In your bit bucket account firstly create a repository , after that inside your repository click on wiki link. you will see + create page button. click on it. and start writing your wiki page.
To see your old wiki pages- firstly select your repository , go to wiki link. then you see your repository name / Home. click on this repository name which is hyperlink to list of all wiki pages. here you can view your old wiki pages.
This feature is currently broken. Follow Issue BB-6368 for the fix.
More information here

Resources