Jekyll

Jekyll paginate

夙愿已清 提交于 2019-12-23 12:20:44
问题 I am trying to paginate a list of blog posts in jekyll, but cant seem to get it working. Here's my setup I have a blog directory under my root directory which has a index.md. I have used the following code from the jekyll website <ul> {% for post in paginator.posts %} <li><h1><a href="{{ post.url }}">{{ post.title }}</a></h1></li> {% endfor %} </ul> I have the following in my _config.yml paginate: 10 nothing get's displayed. Any suggestions as to where I am messing up? Update - Dir structure

Return list of files in directory from Jekyll plugin?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 07:45:53
问题 I can't figure out how to create a filter or tag in a jekyll plugin, so that I can return a directory and loop over its contents. I found these: http://pastebin.com/LRfMVN5Y http://snippets.dzone.com/posts/show/302 So far I have: module Jekyll class FilesTag < Liquid::Tag def initialize(tag_name, text, tokens) super @text = text end def render(context) #"#{@text} #{Time.now}" Dir.glob("images/*").each { |i| "#{i}" } #Dir.glob("images/*") #Hash[*Dir.glob("images/*").collect { |v| [v, v*2] }

Using liquid tags in YAML Front Matter variables

时光总嘲笑我的痴心妄想 提交于 2019-12-23 07:19:25
问题 Is it possible to use Liquid tags in YAML Front Matter variables? For example if test.html contains: --- variable: "Date: {% date: '%D' %}" --- {{ page.variable }} then Jekyll will generate the following HTML: Date: {% date: '%D' %} instead of something like: Date: 03/13/14 Basically I'd like the Liquid tags in the YAML Front Matter variables to be processed. 回答1: It sounds like you're trying to store a formatted date in a variable so you don't need to re-format the date each time you use it.

Jekyll extension-less permalinks with markdown

白昼怎懂夜的黑 提交于 2019-12-23 05:05:18
问题 From the Jekyll docs it says (using .md format): Clean URLs can also be achieved using the permalink front matter variable. In the example above, using the first method, you can get URL http://example.com/other for the file other.md by setting this at the top of the file: permalink: /other Here is an example my page front matter: --- layout: page title: Contact permalink: /contact --- Everything works fine when I'm using jekyll serve but when I build and upload to my static host it doesn't

Jekyll LF/CRLF issue with git

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 05:01:52
问题 I have a Jekyll folder in which only the production part ( _site ) is tracked with git. When I run the command to serve the local site with jekyll serve -w , the files will be changed to LF or CRLF depending on the machine I'm working on: CRLF for Windows, LF for Mac. This is really annoying because all my files inside _site will be commited everytime I switch my OS. I've tried to fix this in the git config file with autocrlf = false , but since the files are generated at a higher level by

Trailing slashes in Jekyll + GitHub Pages site cause 404

被刻印的时光 ゝ 提交于 2019-12-23 04:11:57
问题 I would like all of the following URLs to resolve on my website, which is built with Jekyll and hosted on GitHub Pages: https://michaeledelstone.com/about https://michaeledelstone.com/about/ https://michaeledelstone.com/about.html Locally they all work correctly, but right now on the live site, the first and third option resolve, but the middle one with the trailing slash causes a 404 error. I am not using permalinks at the moment. When I do add permalink: /about/ to the front matter in my

Jekyll - How do I create pages in the root directory?

☆樱花仙子☆ 提交于 2019-12-23 04:03:35
问题 I'm using Jekyll to create a page and the docs suggest that Jekyll has the option to create pages in the root directory, or to create new directories for new pages. From http://jekyllrb.com/docs/pages/ Where you put HTML files for pages depends on how you want the pages to work. There are two main ways of creating pages: Place named HTML files for each page in your site’s root folder. Create a folder in the site’s root for each page, and place an index.html file in each page folder. project -

Can Jekyll omit index.html from folder URLs?

百般思念 提交于 2019-12-23 03:23:19
问题 The Jekyll docs on creating pages include this example of folders containing index.html files: To achieve clean URLs for pages using Jekyll, you simply need to create a folder for each top-level page you want, and then place an index.html file in each page’s folder. This way the page URL ends up being the folder name, and the web server will serve up the respective index.html file. Here’s an example of what this structure might look like: . ├── _config.yml ├── _includes/ ├── _layouts/ ├──

Can Jekyll omit index.html from folder URLs?

[亡魂溺海] 提交于 2019-12-23 03:23:06
问题 The Jekyll docs on creating pages include this example of folders containing index.html files: To achieve clean URLs for pages using Jekyll, you simply need to create a folder for each top-level page you want, and then place an index.html file in each page’s folder. This way the page URL ends up being the folder name, and the web server will serve up the respective index.html file. Here’s an example of what this structure might look like: . ├── _config.yml ├── _includes/ ├── _layouts/ ├──

Fenced codeblocks in Jekyll

这一生的挚爱 提交于 2019-12-23 02:34:23
问题 I have just upgraded my local Jekyll installation to Jekyll 3.0.2. I was looking forward to use fenced (backticks) code blocks when posting source code. This however doesn't work, and I still have to use Liquid tags to specify codeblocks My build settings in _config.yml: baseurl: / destination: _site permalink: pretty markdown: kramdown kramdown: input: GFM syntax_highlighter: rouge List of Ruby gems installed activesupport (4.2.5.1) addressable (2.3.8) bigdecimal (1.2.6) bundler (1.11.2)