Unexpected urls in my Jekyll website sitemap - github

I'm creating my personal blog (davioooh.com) using Jekyll and hosting it on GitHub pages.
But I recently discovered a strange thing...
When pushed/deployed to my repository, the blog sitemap.xml includes two extra urls:
<url>
<loc>
http://davioooh.com/assets/javascript/anchor-js/docs/grunticon/preview.html
</loc>
<lastmod>2017-08-11T16:40:49+00:00</lastmod>
</url>
<url>
<loc>
http://davioooh.com/assets/javascript/anchor-js/docs/index.html
</loc>
<lastmod>2017-08-11T16:40:49+00:00</lastmod>
</url>
I can't understand why... I'm not using any anchor-js gem or plug-in...
The only gems declared in my _config.yml and Gemfile are:
gems:
- jekyll-feed
- jekyll-seo-tag
- jekyll-paginate
- jekyll-sitemap
So why I'm getthing that urls?
NOTE: the sitemap is correct when I test the site locally on my dev machine.
NOTE: I'm using a custom theme (regular theme, not gem-based). No theme declared in my _config.yml. Here you find my blog repository: https://github.com/davioooh/davioooh.github.io
UPDATE Tried to replace jekyll gem with github-pages in my Gemfile as suggested by marcanuy. It works locally, but after a new push sitemap still includes the extra urls...
UPDATE Found GitHub pages reference listing default params for Jekyll websites. Default theme is, as expected, jekyll-theme-primer. How can I override this setting if I'm not using gem-based theme?

It comes from your theme: jekyll-theme-primer
Primer is what powers GitHub's frontend. If you're not using this theme explicitly, it probably comes from GitHub Pages' own usage of the Primer framework

Why it works fine locally?
Because you are not using the same dependencies Github Pages uses. To replicate the environment used by Github, you need to use the gem: github-pages.
Why sitemap.xml includes two extra urls?
As #ashmaroli said, these files comes from jekyll-theme-primer which is used by Github Pages, if you are using your own theme files, then just make sure there are no theme: key in your _config.yml and run bundle update. Using the right github-pages gem will fix it and those files won't be included in your final site.

It seems that updating to github-pages v157 the sitemap is generated correctly.
The new version of gh-pages supports the last version of jekyll-theme-primer (v0.5.2).
This solves my issue.

1. Apparently, the jekyll-theme-primer (which usually comes with group: :jekyll_plugins in your Gemfile) is to blame. I.e. theme: minima avoids the creation of anchor-js (but you probably want to run your own theme, and not having minima hang around…)
2. A verified simple fix (giving a warning upon build) is to write
theme: false
in your _config.yml
3. The issue is a known issue and has been fixed 3 days before me writing this. Might day some days (or weeks) until it gets shipped though. If you read this some time from now, probably all you need to is update your gems.

Related

Jekyll architect theme not working on GitHub page

I created a GitHub page with a repository called myusername.github.io
I cloned that (empty) repo to my PC and using jekyll command line I created a new blog inside of this folder. It was building correctly on my PC and on GitHub with the standard theme 'minima'.
However, I wanted to use the 'architect' theme and followed their instructions (just add theme: jekyll-theme-architect on the _config.yml) to use it but got a messed up page as a result. What is going on? How can I fix that?
I am totally pissed off by this. The instruction is so simple, but does not work!!!
This is due to not having the proper gem locally, so you can install the gem explicitely or add the github-pages gem that contains that theme as it is supported by Github pages.
Add the following to your site's Gemfile:
gem "github-pages", group: :jekyll_plugins
then run bundle install.
Edit index.md and change the layout to the default one: layout: default.
Remove the lines that contains an include tag in about.md for example: {% include icon-github.html username="jekyll" %}.
and you will be able to use the new theme.

Github pages cannot display markdown correctly

I am using github pages + jekyll to establish my blog.
It worked properly before pushed my latest commit. This commit adds a cname file and just edits some words without any alterations over the architecture of my site.
- <h3 class="description">aaaaaaaaaa</h3>
+ <h3 class="description">bbbbbbbbbb</h3>
After that markdown does not appear properly.
When I write #head1. It does not appear title head1, it just appears #head1 directly.
However, if I use jekyll serve build in localhost:4000, it appears correctly.
This is my _config.yml:
markdown: kramdown
markdown_ext: markdown,mkd,mkdn,md
textile_ext: textile
highlighter: pygments
Any ideas what has been causing this error?
UPDATED!
This is most likely due to Jekyll 3 upgrade on GitHub Pages.
From May 1st 2016 on, GitHub will not support rdiscount nor redcarpet anymore. Also, since February 1st, GitHub Pages only supports rouge:
Starting May 1st, 2016, GitHub Pages will only support kramdown,
Jekyll's default Markdown engine.
GitHub Pages now only supports
Rouge.
You can check this out here.
In order to deal with it, proceed as the following:
First, try as explained on this answer. Instead of #Heading you'll write # Heading.
Second, adjust your _config.yml: change highlighter and markdown for
highlighter: rouge
markdown: kramdown
kramdown:
input: GFM
Third, to build your site locally, use Bundler, the method recommended by GitHub:
Install Bundler:
gem install bundler
Then run bundle update - this will update all your gems, including github-pages, if you already have this gem installed locally.
Then, create a Gemfile (leave it without any file extension) with the following content:
source 'https://rubygems.org'
gem 'github-pages'
Save it to your project's root.
Then, run bundle install on your project. This will create a file called Gemfile.lock and will install all required gems and their dependencies.
Finally, run bundle exec jekyll serve --watch and you'll be able to view your website locally exactly as you'll view online (when hosting on GitHub).
You should be OK by then!
PS. If your project needs more gems, as jekyll-paginate or jekyll-mentions, you'll need to add them to the Gemfile, for example:
source 'https://rubygems.org'
gem 'github-pages'
gem 'jekyll-paginate'
Also, add them to your project's _config.yml:
gems:
- jekyll-paginate
- jekyll-mentions
Here you'll see a list of gem versions currently supported by GitHub Pages. Here you read about Upgrading Jekyll 2 to 3.
Hope to have helped!
A slight observation running my own Jekyll powered github pages blog,
A space between the # representing the heading size, and the heading text is important otherwise the markdown will not display as intended. Therefore with your example, I would display my markdown heading as,
# Zookeeper Atomic Broadcast for heading 1
## Zookeeper Atomic Broadcast for heading 2
### Zookeeper Atomic Broadcast for heading 3
#### Zookeeper Atomic Broadcast for heading 4
##### Zookeeper Atomic Broadcast for heading 5
GitHub support markdown as well jekyll.
First of all rename your file with the .md extension
If you have .nojekyll in your folder it will disable njekyll.
Verify that you don't have this is your folder.
Read the docs && GitHub relevant doc on how to prepare and deploy
Running Jekyll
Use the command git checkout to switch to the default branch that the GitHub Pages build server uses to generate your site. The default branch you switch to depends on the type of GitHub Pages site you're building.
For Project Pages sites, switch to gh-pages.
For User Pages or Organization Pages sites, switch to master. For more information, see "User, Organization, and Project Pages".
Use the command bundle exec jekyll serve in the root of your repository to run the GitHub Pages build server with Bundler.
bundle exec jekyll serve
Navigate to http://localhost:4000 to see your local site.

Emoji for jekyll

I've built a site on Github pages with Jekyll. Recently I tried running an emoji_for_jekyll plugin. When I build and run the site locally, it seems to work. However, when I commit and view it online the emoji disappear and all that's left is the syntax (:smile:)
Here is a page on my site http://joshuahouston.github.io/code/2014/12/10/the-emoji-test.html
This is the resource I've followed. The 3 steps seem easy enough.
Install the emoji_for_jekyll gem:
gem install emoji_for_jekyll
Add emoji_for_jekyll to the list of gems in config.yml:
gems: ["emoji_for_jekyll"]
See beautiful emoji!
or
Copy emoji_for_jekll.rb and emoji.json into the _plugins directory
And you can view my site's pages on Github and they're even working there! https://github.com/joshuahouston/joshuahouston.github.io/blob/master/_posts/2014-12-10-the-emoji-test.markdown
Do you know what I'm missing? Why aren't the pages being generated correctly for the site but correctly elsewhere? Thank you.
Not all plugins can be run on Gitub pages (see documentation here).
If you want to use emojies on your gh-pages, you'll have to use parkr jemoji.
gem install jemoji
remove your _plugins folder content
change gems in _config.yml to gems: ["jemoji"]
test with a jekyll serve
push to Github
be happy ;-)
In my case, I test directly on Github. I did two changes:
Step 1: add gem 'jemoji' to Gemfile
Step 2: add - jemoji to _config.yml

Simplest way to get (jekyll-scholar) plugins on gh-pages

GitHub pages does not support plugins, but plugins are clearly very useful (e.g. jekyll-scholar).
Nitrous.io supports adding plugins to your GH pages site, but this seems a little involved. Is there any simply way to get plugins working on my github site, or should I just make _site/ the root, as the jekyll-scholar dev. recommends?
The method described in the Nitrous.io blog post can actually be used with a local Ruby/Rails environment, which removes some of the complexity. There's an even more convenient Rakefile setup from David Ensinger that implements the deployment steps proposed by Randy Morris.
Essentially, these Rakefiles are just conveniences to batch the deployment of both your Jekyll source (with plugins) and compiled _site to GitHub Pages as the jekyll-scholar dev recommends. Since your site is a User Pages (username.github.io), then you'll want your compiled _site to end up in Master, and your Jekyll source with plugins in a separate Source branch. If you want to first experiment with a Project Page, then you'll want your _site to end up in the gh-pages branch (which can be accomplished with this Rakefile)

jekyll and github - how to update the blog post?

Good day.
Could you help me with a little problem I am experiencing.
I have a jekyll blog on the github. The problem is after I updated my old post, committed and pushed it, the blog post doesn't show any changes, but I see that the commit has been pushed successfully.
If I run jekyll --server locally, it shows updated blog post and it doesn't report any errors.
I have no jekyll plugins installed.
What am I doing wrong or misunderstanding? Thanks a lot.
Added by Nawaz:
I'm facing exactly same problem. My I pushed added one markdown post and few css, and modified layouts and includes, then I pushed them to github. It is done successfully. My github is showing all the changes in the repository, but the github blog (i.e the generated html posts out of markdown) are still same. No change to them at all. It is showing some posts which doesn't even exist in the repository. But when I do jekyll --server locally, then every update is being shown on my (local) blog hosted at http://localhost:4000.
Please help me!
If your Jekyll site is not rendering properly after you push it to GitHub, it's useful to run Jekyll locally so you can see any parsing errors. In order to do this, you'll want to use the same version that we use.
GitHub's Pages servers currently use Jekyll 0.11.0 with Liquid 2.2.2, and run it using this command:
$ jekyll --pygments --safe
More info
I'm now trying to solve the problems with my pygments highlighting (works locally, doesn't show on github at all, even though I'm receiving mails about succesful build). Findings so far:
Make sure that youre repository' default branch is 'master' (go to your repository Admin page).
Put your Jekyll source files in some other branch, and put the _site content to your master branch. There will be no _config.yml, no YAML front matter so github will render your stuff as is, and you would be building it locally on that other branch. This actually worked for me. It requires some manual labour when moving _site from that other branch to your master, but I'm fine with that - at least I do not have to rely on github build process which seems to be a bit buggy, plus, I can have whatever plugins I wish.
When ever you generate your jekyll site locally for testing, always run jekyll --no-auto --server. This would display if there were any errors encountered during the generation of your site. Also, before generating your site delete _site directory and then run the command as described above.
Let me know if you see any errors as such. We can debug further