I'm following this tutorial github pages as is.
_layouts/
|
-- default.html
-- post.html
_posts/
|
-- 2015-09-29-example-site-launched.md
But the post.html doesn't seem to be using the default.html layout.
This is what i get:
What might i be doing wrong?
It appears that the problem was with visual studio as this SO answer solves my problem.
Related
I'm trying to use Github pages with Jekyll. Most of my pages are displayed as expected, but others (that I can see in the local build) do not show on the Github pages build.
The pages that do work are in the _pages folder with their permalinks set in the front matter. Like this
---
type: page
permalink: /about/
layout: default
---
The pages that don't work are in a folder _projects with similar, but slightly different front matters
---
permalink: /projects/foo
layout: post
---
When I try to access foo.com/projects/foo/ it gives me error 404, but foo.com/about/ works as expected. There are no front matter defaults, so what you see is what is there.
I found my solution in the similar questions as I was writing this, but couldn't with a google search.
Github Pages didn't like having the permalinks for _projects in the format /projects/foo/, but /projects/foo.html works like a charm.
I'm trying to make a GitHub page. At the beginning, I use GitHub generator. I included Gemfile and _config.yml to generate SEO tag and it works as expected. The generated site will include the following section.
<!-- Begin Jekyll SEO tag v2.6.1 -->
<meta ...
<!-- End Jekyll SEO tag -->
Now, I've just updated my site to the new one using HTML template from HTML5 UP. It's up and run normally, however, I cannot find a way to make Jekyll generate SEO tag for my index.html file. I've tried to add triple dashes (front matter) to my index.html on the first line.
---
---
<!DOCTYPE HTML>
<!-- Other code below -->
The thing is, it partially break the site (page isn't rendered properly). Therefore, I've to copy/paste the generated tag and add them manually to my code. Is there a way to make Jekyll properly create SEO tags for my site? Or did my misunderstand something very basic here?
To be clear, I've very limited knowledge in web development, that's why I use a template in the first place. Here is my page in case it helps clarify the question https://hunghvu.github.io/ and here is its GitHub repository incase you want to know the file structure.
Update
(09/30)
I attempted to turn the index.html file into index.md while still keeping all the code (plus the tripled dashes). In a sense, it works. The page is generated, but still, it's not rendered properly as when I use html format. I'm aware that the way to actually build site using Jekyll is much different, but that does not answer my question.
In case it is necessary to show what I mean by saying "not properly rendered", I will update this question later on.
(09/31)
The picture below is how my page looks like when I add front matter and {% seo %}. Notice that when I first go to the page, the side bar is already in SOME OTHER WORK, or last section. It should be on the WELCOME. The WELCOME section is not rendered and sidebar functionality is broken.
Problem
GitHub pages gem is not included in your project, therefore GitHub is not running Jekyll build. Furthermore, you have nothing specified in your front matter. You also have no layout.
Solution
Include gem "github-pages", "~> VERSION", group: :jekyll_plugins in your Gemfile.
Notes
Consider using front matter and creating a layout file _layouts/default.html and moving everything except what’s in body (including SEO)to the layout file. The index.html should extend the layout by specifying layout property in front matter.
References
Front Matter: https://jekyllrb.com/docs/front-matter/
GitHub (step 9): https://docs.github.com/en/free-pro-team#latest/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll
So I faced a problem while trying to add some SEO optimization for my simple static website served via Github Pages.
As the documentation says: https://help.github.com/articles/search-engine-optimization-for-github-pages/
I created the _config.yml file which includes next lines of code:
plugins:
- jekyll-seo-tag
and pushed this file along with my website files, so the structure looks like this
The problem is that after linking to my website I see the
output
And the head tag includes following content
I need help in understanding why the SEO plugin doesn't work. Thanks for all your replies and have a nice day!
If you want any file to be processed you must add a front matter to it.
Your index.html must be like :
---
# even an empty front matter is ok
---
<!DOCTYPE html>
...
David Jacquel's answer helped so much and I managed to resolve a problem. More about that:
I had to inject a valid front matter to resolve a problem e.g.
---
layout: main
title: Cheaterino
---
After that I still didn't manage to deal with the problem since my index.html was minified and so do the front matter.
After I disabled minification of the file everything worked!
head tag content after plugin worked
Thanks so much to David Jacquel!
I have just started trying to use jekyll for github pages.
I wished to use the theme leap-day.
Following the instructions, It just came up with some can not find post / can not find page errors, I followed the instruction ongithub to create _layouts/page.html and _layouts/post.html
Now I am finding it is complaining it can't find home layout.
Jekyll theme leap-day has just one layout: default.html while most of the times the first Jekyll version uses minima who has three: default, page and post.
To properly use leap-day make all your pages/posts and home page use layout: default.
I've been using Jekyll 2.0 directly from the command line for the last few days. I've put all my page files into a '/pages' folder so it looks like this:
/pages
- index.html
- about.html
- contact.html
In the front matter of each page I set the permalink like this:
permalink: /about/
So when Jekyll compiles the site, I'm able to navigate successfully to localhost:8888/about/ it's been working really well.
The Grunt/Yeoman problem:
I've picked up the generator-jekyllrb for Yeoman today because I want Grunt to manage everything (live reloading etc). I set it up, everything is working fine... but Jekyll is no longer generating the folders according to the permalink.
For example, my "about.html" page inside /pages, is not having an "/about" folder generated in the root like it did when using Jekyll directly. So I can only access the page through: localhost:8888/pages/about/. Which is strange.
Here's my Gruntfile.js generated from Yeoman
I don't know a whole great deal about this stuff. I'm very new to Grunt and the CL, but this has really stumped me. If anyone could offer any advice or point me in the right direction I'd really appreciate it.
I ended up adding the following to my _config.yml:
relative_permalinks: false
which fixed the problem. I think grunt-jekyllrb must be a version behind or something, because absolute permalinks are defaults now in the latest Jekyll.