Github page using hexo, how to get my theme supported? - github

I want to host a simple blog on Github pages. Therefore I set up a repository and used Hexo as a compile and deployment tool.
After testing my site locally I run the following command:
hexo deploy --generate
Sadly I, just a few seconds later, get the following message from Github:
The page build failed with the following error:
The hacker theme is not currently supported on GitHub Pages. For more
information, see
https://help.github.com/articles/adding-a-jekyll-theme-to-your-github-pages-site.
For information on troubleshooting Jekyll see:
https://help.github.com/articles/troubleshooting-jekyll-builds
If you have any questions you can contact us by replying to this
email.
How can I publish my site using the hacker theme? If this is not possible which themes are supported by Github? How do I use them with Hexo?

Bypassing Jekyll on GitHub Pages
It is now possible to completely bypass Jekyll processing on GitHub
Pages by creating a file named .nojekyll in the root of your pages
repo and pushing it to GitHub. This should only be necessary if your
site uses files or directories that start with underscores since
Jekyll considers these to be special resources and does not copy them
to the final site.
Source: https://github.com/blog/572-bypassing-jekyll-on-github-pages

[..] I used the username.github.io repo and deployed directly to master
and it works!
https://github.com/CodeDaraW/Hacker/issues/9

Related

Error 404 when I tried to access my website

Recently I tried to make a website using HTML and CSS and then I tried to host it on GitHub by commit under a repository name myname_examp.github.io, but when I tried to access it through the web browser using myname_examp.github.io there was an error 404.
Is there some steps to do?
If your Github account is free tire, the Github pages repo must be public.
If you are using GitHub Enterprise Cloud and has access control, the site can only be accessed by people with read access to the repository where the site is published from.
You can use actions status to check whether your site ready:
See more on Github docs
BTW, if your site is project type (repo not named user/org.github.io), you shall go to repo setting enable pages.

How to display a VSTS Build Badge in a README.md file hosted on GitHub?

I have developed a tiny library that I chose to host on GitHub. The code is being built by a VSTS build and published as a NuGet package.
I have written a README.md file and I am trying to include a Build badge on it, as described in the Microsoft documentation. Consequently, I have added the following line in the MD file and replaced the placeholders accordindly:
![Build status](https://{my-organisation}.visualstudio.com/{my-project}/_apis/build/status/{my-build-definition-name}?branch=master)
The problem is that the link is not accessible to anyone that is not logged-in on VSTS and I end up with a 'broken' link on my readme page:
Question
What must be done to make the VSTS Build Badge available to a GitHub repo?
I suppose you must include an authentication token of sorts in order to have at least read-access to the VSTS build from your GitHub page.
Note that the documentation lists also multiple pending issues, including MicrosoftDocs/vsts-docs issue 1499:
Build status badge added to GitHub readme doesn't show up.
So this is still in progress.
On that last issue, it says:
This is due to public vs. private projects.
If you make your project public the image URL will render.
There are other potential workarounds we are looking at for the doc.
See "Change the project visibility, public or private".

How do i manage content workflow for hexo site?

I've used static site generators like jekyll and had it hosted through github pages just fine using prose.io as a content management system.
I decided I wanted to go with a site using Hexo static site generator, but I cannot seem to figure out a good workflow for publishing content.
To my understanding this is the following in how I'd have to do it:
write *.md text file
hexo generate
(optional) hexo serve (to see local content)
hexo deploy (to publish the public content to whatever site using config.yml). Can publish on amazon S3, github pages, etc
Is there another workflow other than this?
the way I've been doing it before with jekyll+github pages is simply
go to prose.io
Write content
save (which publishes ocntent)
Ideally I'd like to use hexo+github pages the same way I do with jekyll+github pages.
Basically, can github generate static files automatically like it does with jekyll / ruby packages?
I figured out my own answer and posted it on my blog
http://www.tangycode.com/Quick-Start-Guide-To-Hexo-Install/
It covers everything you need to know on how to set up a hexo blog site and manage content workflows
One approach I am trying myself:
prose.io or similar to write and save on github repository
travis-ci.org to build hexo site and deploy
This is how it works:
Edit document on your editor of love
Commit it to your repository
travis-ci.org detects the commit and start working
My .travis.yml do (among few other things) the follow:
npm install hexo-cli
npm install grunt-cli
npm install inside siteĀ“s repository (hexo plugins and dependecies)
hexo generate
grunt deploy-production
hexo deploy (I use this to have a historic of the site stored in the repo itself)
If your editor of choice can direct commit to github repository your have exact same experience you had with Jekyll on GH pages. The advantage here is that you can use third-part plugin what GH pages avoid.
Alternatively, you can use INSTANT, which is a content management tool that you can use on any static website. You just install their javascript and can directly edit content in your website (without any admin dashboard). It saves and serves the content from the client. Pretty neat.
The easiest way is to use a hosting provider like Netlify in combination with a headless CMS, for example Headless (full disclore: I created it).
Netlify can do the build process for you and during that build process, it can fetch content from a headless CMS. Whenever you update content in the CMS, then Netlify does a rebuild.
Then you have your website on the Netlify CDN, a real CMS for your content management and you never need to dive in your code or github files. And that's all for free.

Correctly hosting Jekyll website on Git Pages

I am desperate.My mission is to deploy a static website generated using Jekyll into GitHub Pages, using the "Project" option (instead of the user option).
Somehow, when I use Jekyll to check the website in my machine, everything works fine. But once I deploy it to Git Pages, all my CSS files stop working, and every link leads to a 404 not found error.
I have followed several guides and tutorials but they all fail:
Using Github Pages to host a website v2
Jekyll Documentation
Building Static Sites with Jekyll
building-a-docs-site-with-jekyll-github-pages
So far I always created the repositories, the branches and I always push everything. I do not believe the error is in the deployment, but in some place else.
My repo can be found here:
Fl4m3Ph03n1x web-tutorials repo
For those of you wondering, so far the repository is only the result of one tutorial:
- AndrewMunssel tutorial
I have also tested other tutorials, but I always end up with a problem. Is my code wrong? Are the tutorials I am following outdated and incorrect? What should I do?
Everything on your site is in a sub directory off of the domain so the main site is accessed here
http://fl4m3ph03n1x.github.io/web-tutorials/
The templates are pointing to directories on the root of the domain so it is trying to load your stylesheets from http://fl4m3ph03n1x.github.io/assets rather than where they are located http://fl4m3ph03n1x.github.io/web-tutorials/assets/ the same thing is happening for your posts.
What you need to do is set the baseurl in your _config.yml
baseurl: /web-tutorials
you then need to modify your templates so that the paths to CSS and JS use the following convention
{{ site.baseurl }}/path/to/css.css
and for post links
{{ site.baseurl }}{{ post.url }}
You also need to update the site setting in _config.yml

Update my website from a github repository

I use a website for testing purposes. Part of what I test is a public repository on GitHub. What I would like to do is have my site periodically check the repository and pull any changes to a folder in my site.
I'm using a LAMP server, is there some php and a cronjob that I can use to check and get the files from the repository?
I would use the webhooks Github allows. See here for a simple PHP example that executes a auto-pull if the Github repository gets updated.