jekyll-paginate-v2 | Pagination Generator for Jekyll 3 (enhanced replacement for the old built-in jekyll-paginate gem) ⛺ | Plugin library
kandi X-RAY | jekyll-paginate-v2 Summary
kandi X-RAY | jekyll-paginate-v2 Summary
Pagination Generator for Jekyll 3 (enhanced replacement for the old built-in jekyll-paginate gem)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jekyll-paginate-v2
jekyll-paginate-v2 Key Features
jekyll-paginate-v2 Examples and Code Snippets
Community Discussions
Trending Discussions on jekyll-paginate-v2
QUESTION
I'm trying to build my blog on Github pages and I have to use Jekyll-paginate for obvious reasons. The problem is, I don't use the index.html page for anything other than a welcome page. I have a separate page called index.html in a folder called articles, thus the url for the blog should be xyz.github.io/articles/
.
However, this presents a major problem - apparently jekyll-paginate refuses to work without an explicit index.html in the root directory of the blog. So, I tried using jekyll-paginate-v2 which has no such restrictions, and it worked perfectly!
However, github pages don't support jekyll-paginate-v2, and thus, I'm back to square 1. What should I do?
NOTE : Here's my code:
index.md ...ANSWER
Answered 2018-Jun-29 at 13:22The documentation for Jekyll pagination says:
Pagination only works within HTML files
Pagination does not work from within Markdown or Textile files from your Jekyll site. Pagination works when called from within the HTML file, named
index.html
, which optionally may reside in and produce pagination from within a subdirectory, via thepaginate_path
configuration value.
So if you want your blog to be on URL /articles/
and /articles/N/
, specify this in your configuration:
QUESTION
I have a variables.scss
file that holds all of my sass variables in my root. I want to import it in my other scss files so that I can use these variables:
ANSWER
Answered 2019-Sep-10 at 18:05First of all, use only relative basenames to import:
QUESTION
I have installed the jekyll-compose gem to streamline creating pages, posts etc. In the documentation. I have it working (i.e using the CLI commands I am able to generate, drafts, posts and pages).
However when I generate a post for example, I want it to have certain variables in the front matter. There is functionality mentioned in the ReadMe of Jekyll Compose that says you can set front matter defaults for posts and for drafts.
I have followed the instructions by adding the required lines in the config.yaml of my site, however posts and drafts that I generate using jekyll-compose do not generate with the variables I want.
Jekyll-compose states that if you want default front matter variables you need add something like this to your _config.yaml:
...ANSWER
Answered 2019-Oct-09 at 11:10Ok I managed to fix this myself after seeing the syntax for the custom variables was different on GH compared to what I found when digging into the jekyll-compose post creation methods on rubydoc.info.
Basically there was PR that changed the syntax merged in to master but not yet released, hence why I was having difficulty getting it to work
The current syntax as of the latest release:
QUESTION
So i have this IPv6 thingy issue where i can't access rubygems and connection times out before it gets to use IPv4. One way or another i managed to install rubygems and when i type -v it all checks out. Now i need Jekyll and Jekyll-paginate-v2. I tried gem install jekyll
and it didn't work for reasons stated above. Strangely enough i was able to install Jekyll via sudo apt install jekyll
. Tried that with jekyll-paginate-v2 but there's no such option. So is there any way to install it without using gem
command?
ANSWER
Answered 2019-Sep-13 at 09:58ok so i found a way of solving this issue.
to install a gem you need a .gem file and since you can't access rubygems.org we will get it from github. just go to your gem's github page, download it and then open bash in that directory, type gem build gemname.gemspec
and it will create a .gem file in this directory. after that just use gem install --local gemname.gem
and that's it.
QUESTION
New to Jekyll converting a WordPress blog I'm trying to add pagination to my category layout. In _layouts
directory I've created a file named category.html. I can successfully render a particular category with:
category.html:
...ANSWER
Answered 2019-May-09 at 20:45Paginate only paginates all posts and not by category or tag.
Paginate V2 does this even for collections. But you cannot run this plugin on Github pages (allowed plugins).
Two solutions :
publish your code in a branch, generate your site locally (or with a service like Travis Continuous Integration that is free for open source projects) and publish (or let your CI publish) your generated code in another branch.
use a modern hosting provider like Netlify that allows you to use any plugin.
QUESTION
We know Jekyll can use front matter variables like tags
and categories
and access them with site.tags
and site.categories
to iterate over them using liquid.
Now my problem is that I can't do this with a custom front matter variable like author
(as in site.authors
) because Jekyll will not store it in a list format. This makes it very hard to paginate it.
Every solution I have looked at i.e.
requires me to hardcode a list of authors to _config.yml
or some other .yml
(i.e. in _data/authors.yml
).
The problem here is that I don't use a fixed list of authors. The authors list needs to get updated when I throw in another post with a front-matter tag author: exampleAuthor
or a list of authors (as in multiple authors per post, as currently only possible with categories
and tags
as well), while the server is running. It works with tags and categories splendidly, but not with custom tags like authors.
The easiest solution would be having a site.authors
list to iterate over and just extending it with a ruby plugin.
I haven't found a plugin that provides me with a solution and thinking this was a common problem that I'm probably not the first to have.
What I triedI then looked at writing my own ruby plugin (Which is hard on it's own because of the lack of documentation. Maybe I'm to dumb to google, but the resources I found where very limited and hardly enough to guide you through the process) but there has to be a reason why this is so hard to do that makes all the existing solutions require hard coding the author list in a .yml
(or .json
, but most people go with .yml
for some reason).
Doing this is out of the question for me, since I want to only throw in posts with author names in it later on and manipulating a .yml
(I am under the impression that yml
files don't get compiled once the server is started, like _config.yml
, correct me if I'm wrong) would be counterproductive because it requires you to restart the server to have them compiled.
Even very advanced plugins like jekyll-paginate-v2 (which I use successfully to paginate posts by tags and categories) don't have a solution to this as this issue portrays. He's getting recommended to abuse the category variable to paginate by author, which is kind of a desperate workaround.
I have found suggestions that it can be done with collections, however it does not seem feasible. Primarily due to the nature of their implementation:
They require hard-coding the author list (again, I don't want that. I don't have a fixed list of authors. All of the author information has to come from the front-matter in the /_posts
directory .md
files)
As of now I don't see how it can be done with collections.
However I'm open to suggestions.
Edit: I found this dated issue on Jekylls github page which highlights that people are trying to do the same but to no avail. Has this become viable in the last 4 years?
...ANSWER
Answered 2018-Aug-18 at 21:33Adding authors to Jekyll posts is easy with collections. Here's a proof of concept for you. Specifically, in this commit I add everything you need for it.
As for your question about pagination, will need to use a pagination plugin (paginate-v2 is good), as I believe the built in pagination only supports the posts collection.
QUESTION
I've run into an issue when using Jekyll (which uses the Liquid templating language), the plugin jekyll-paginate-v2
and offset
.
The problem: I have a featured section on my blog that always shows the most recent post. The other posts appear below, 10 per page using paginate.
I tried to simply show them using {% for post in paginator.posts offset:1 %}
, but this is flawed in two ways:
- it only shows 9 posts per page instead of 10
- it offsets the first post on each page, so that the 1st, 10th, 20th, etc. posts are hidden, which is not what I want
What I'm trying to achieve: a loop that always ignores the post at index 0 and shows everything else as it normally would.
Am I just using offset
wrong, or is this a bug in jekyll-paginate-v2
?
Right now I've "fixed" it by doing the following, but it's not ideal as the first page only shows 9 posts:
...ANSWER
Answered 2018-Jul-10 at 18:37I've hacked together a flawed solution that I'm using until something better comes along. I'll share it here for now:
QUESTION
I'm struggling to overcome a strange behavior with Jekyll-Assets when exporting all assets correctly on build command.
The configuration is set to use cachebusting with "file system" cache type. When building we get all images and fonts correctly. But on one of the scss
files it seems that fonts and images are exported randomly (sometimes yes, other times no). When files are not exported the path written in css is correct, containing the hash for the cachebust.
While trying to debug with deleting .assets-cache
and _site/
folder I've notice the random gets even much more frequent.
This is the configuration
Dev environment(Docker Container):
...ANSWER
Answered 2018-Aug-23 at 13:10TL;DR: Deleting _site
before build caused the problem. Also deleting .jekyll-cache
before build solved the problem for me.
I had a very similar experience with Jekyll-assets. During development it occurs that some images were missing in the _site/assets
folder. After a bit trying out I found a way to reproduce it.
- Checkout a clean version of the code
- Build with
bundle exec Jekyll build
- Run
bundle exec jekyll clean
(which deletes, among others, the _site folder) - Build with
bundle exec Jekyll build
again
After these steps I had missing files in the _site/assets
folder. What solved the problem for me was additional to using the jekyll clean
to delete the folder .jekyll-cache
. I quiet not deep enough into jekyll-assets to understand how the caching in this folder works, but at least it solves the problem. If the folder is excluded from version control, and in case it's a generated cache folder it should be, you can also use git clean -xdf
but be careful with this, it deletes any file, that is not under version control! I would be grateful if you could verify my solution according to your concrete case.
I'm sorry that I could not provide you a real explanation for why this happens, but I hope that my answer could help you anyway.
QUESTION
I've set up my site to build with Travis CI, and added a few plugins.
This is my Gemfile
:
ANSWER
Answered 2018-Apr-17 at 12:13You can force minification with octopress-minify-html
by setting minify_html: true
in your config file.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jekyll-paginate-v2
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page