Pagination works locally when i jekyll serve such that I get index.html with my first page of posts, but when i push and travis builds and then deploys the site, the home page lacks the first 10 posts. If I navigate to /page2 the 11-20 posts are there.
I noticed that the index.html in my source is not being rendered at all when i deploy. But it is being rendered when i serve locally.
What could cause the first page of posts to not render at all?
Here is my _config.yml setting
paginate: 10
paginate_path: "page:num"
here is my ci build script
#!/usr/bin/env bash
set -e # halt script on error
gem install jekyll-paginate
bundle update
bundle exec jekyll build
Here is what shows up on the index.html. Yet if i go to /page2 manually, the 11-20 posts show up. So its just something with the first page
UPDATE: I just checked on the server and the ./_site/index.html file is being generated properly. But the index.html that ends up in the root has no paging, no pages ... looks like the image above. I'm not sure why it is not being put in the root.
try this way:
change to paginate_path: "/page:num" , in _config.yml
and also add
<div class="pagination">
{% if paginator.previous_page %}<a class="new" href="{{ paginator.previous_page_path }}"></i> newst post </a>{% endif %}
{% if paginator.previous_page %} {%if paginator.next_page %} <span class="sep"></span> {% endif %}{% endif %}
{% if paginator.next_page %}<a class="olderpage" href="{{ paginator.next_page_path }}">oldest post</i> </a>{% endif %}
in last line of index.html
Related
I'm trying to build a site with jekyll. I managed to make math work and upload some files. Now the overall distribution of content is not optimal.
I get a link to "HEAD" that lists a series of updates of Jekyll. I would like to get rid of that.
The main url redirects to some blog entries while you have to click on "About" in order to go to some general information about me. I would like to do it in the opposite way, i.e. having the about section shown in the main url of the page https://rjraya.github.io/ and the blog in some derived url like https://rjraya.github.io/blog
Here are the sources of the page. How can I do this simple changes? I understand that I'm using the Minima template.
Re: HEAD
I think the "HEAD" is coming from the History.markdown file. It is strange that the "HEAD" does not show up in a local jekyll serve development environment. I suspect the code below is picking up History.markdown in jekyll, along with about.md when rendering header.html.
https://github.com/rjraya/rjraya.github.io/blob/ddc6a2f5c5804961da6ac79472b7f77052bef267/_includes/header.html#L20-L27
<div class="trigger">
{%- for path in page_paths -%}
{%- assign my_page = site.pages | where: "path", path | first -%}
{%- if my_page.title -%}
<a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
{%- endif -%}
{%- endfor -%}
</div>
RE: Page Title URL Computational reflections
Change the href from / to /blog in this line
https://github.com/rjraya/rjraya.github.io/blob/ddc6a2f5c5804961da6ac79472b7f77052bef267/_includes/header.html#L7
<a class="site-title" rel="author" href="{{ "/blog" | relative_url }}">{{ site.title | escape }}</a>
RE: About URL
Remove the permalink : /about/ from the about.md page. The about.md will be come the homepage (e.g. /) in the next step.
https://github.com/rjraya/rjraya.github.io/blob/gh-pages/about.md
RE: Show about.md information on homepage rjraya.github.io and show _posts markdown files under rjraya.github.io/blog
Let jekyll use the default behavior of assigning permalinks based on the markdown filename.
Rename index.md to blog.md. This will move the list of _posts files from / to /blog.
Rename about.md to index.md. This will move the content of about.md from /about to /.
As mentioned in the Jekyll docs here, I have the following in my _config.yml as:
collections:
sections:
order:
- introduction.md
- battery-state.md
- vibe.md
- references.md
To render the content of each file within the HTML, I have the following:
{% for section in site.sections %}
{{ section.content }}
{% endfor %}
However, the content order is not presented as what I defined in the config file. How do I display the content in the order I defined in the config file?
Manually ordering documents in a collection was introduced in Jekyll 4.0
To use this feature, make sure that you're using Jekyll 4.0
For a site deployed on GitHub Pages, that would mean having to build the site outside GitHub Pages environment and upload the contents of the destination directory (_site).
You can also choose to add the sections to the front matter of the page. This is useful when you are not using Jekyll v4 or you want the user to be able to edit the order in CloudCannon, Netlify CMS, Forestry or another CMS with front matter editor.
sections:
- introduction
- battery-state
- vibe
- references
And the use a layout like this:
{% for s in page.sections %}
{% for section in site.sections %}
{% if s == section.slug %}
...
{% endif %}
{% endfor %}
{% endfor %}
I have a Jekyll setup that looks like this:
_config.yml
_records
a.html
b.html
c.html
...
I want to create a home page that links to each record. However, I want to render a.html and b.html to /records/, but I don't want to render c.html to /records/, as that HTML will be provided to my server from a different process altogether.
I tried setting the following in _config.yml:
exclude:
_records/c.html
But this also removes c.html from site.records, which is not what I want. The best solution I have right now is to prevent my deploy script from deploying _site/records/c.html, but I'd much rather prevent _site/records/c.html from being generated in the first place.
Is it possible to include c.html in site.records to create the links on the home page but not render /records/c.html? Any help others can offer with this question would be greatly appreciated!
Here's how I did this. Inside _records/c.html, set in the front matter:
permalink: '_'
route: /records/c.html
That will make it so that we render the page's html content to _site/_.html, a route that won't ever get visited.
Then in index.html to create the link to the route attribute of this page, use:
{% for record in site.records %}
{% if record.route %}
{% assign url = record.route %}
{% else %}
{% assign url = record.url %}
{% endif %}
<a href='{{ url }}'>{{ record.title }}</a>
{% endfor %}
I'm not sure what I've done. I've added some new pages from my collections folders.
The folders and files are created in the site folder.
However I can iterate my collections and see the links, however the links provide 404 errors as the files aren't being created.
I've re-saved the files as utf8 but this didn't hel, mentioned in a related question.
I've even removed all the files and put back the original test files which did work previously.
Foolishly I didn't have the project under source control.
Obviously jekyll can see them and read their contents and the loops work...
But the files aren't being generated.
<h3>User Guides</h3>
{% for user in site.stt_userguides %}
{::nomarkdown}
<a href="{{ user.url }}">
<h3>{{ user.title }}</h3>
</a>
<p>{{ user.content | markdownify }}</p>
{:/}
{% endfor %}
<h3>Features</h3>
{% for user in site.stt_features %}
{::nomarkdown}
<a href="{{ user.url }}">
<h3>{{ user.title }}</h3>
</a>
<p>{{ user.content | markdownify }}</p>
{:/}
{% endfor %}
I'm using this command ...
bundle exec jekyll serve
It confirms the files aren't found.
Due to initial configuration issues implementing collections, I had inadvertently removed the output: true setting, also useful to add the permalink property under your collection in config.yml.
As shown in the collections section on this page https://jekyllrb.com/docs/permalinks/
I have a Jekyll website and everything works fine, just it doesn't parse <h2> tags in markdown (I also tried putting the actual HTML and still doesn't work. Example: here or here. When I test it with a local server everything works though.
Source code for the /apps page:
---
layout: page
title: My Apps
---
Here's a list of all my published apps, sorted by platform.
[If you need Support and would like to open a ticket, please go to the Support page.](/support)
Most applications are available in English, Italian and Polish so far.
[Click here to take a look at the Patch Notes](/apps/patchnotes)
{% for member in site.data.apps %}
{% if member.link %}
##{% if member.fontAwesome %}{% for image in member.fontAwesome %}<i class="fa fa-{{ image }}"></i> {% endfor %}{% endif %}{{ member.name }}
<br><br>
{{ member.description }}
{% if member.bundleName %}Included in [{{ member.bundleName }}]({{bundleLink }}) bundle.{% endif %}
{% endif %}
{% endfor %}
[Source for app/patchnotes - Page Layout]
Try this:
## {% if member.fontAwesome %}
I just added a whitespace between ## and {℅
Let me know if it works, yeah?
Your Gemfile includes some dependencies like bourbon or time-to-read. Those are not supported plugins/gems (list of gh-pages supported gems/plugins).
If you leave only github-pages gem in your Gemfile and build or serve locally, it fails.
I think that Github pages is also failing but more gracefully.
If you want to work with "exotics" gems, you will have to generate locally and push the generates site on github.