Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Archive page generate #66

Closed
bbgky opened this issue Aug 17, 2016 · 12 comments
Closed

No Archive page generate #66

bbgky opened this issue Aug 17, 2016 · 12 comments

Comments

@bbgky
Copy link

bbgky commented Aug 17, 2016

Hi, here is my repo:
https://github.com/bbgky/bbgky.github.io
what i want is to generate archive pages. i did what the doc suggested:
1. in the Gemfile, i did

gem "github-pages", group: :jekyll_plugins

group :jekyll_plugins do
  gem 'jekyll-sitemap'
  gem 'jekyll-paginate'
  gem 'jekyll-archives'
end

2. in the _config.yml i add

gems:
  - jekyll-archives

jekyll-archives:
      enabled: all
      layout: archive
      permalinks:
        year: /:year/
        month: /:year/:month/
        day: /:year/:month/:day/
        tag: /tag/:name/
        category: /category/:name/

I add a archive.html in the _layouts folder, with the code(copy paste from configuration.md):

<h1>Archive of posts from {{ page.date | date: "%B %Y" }}</h1>

<ul class="posts">
{% for post in page.posts %}
  <li>
    <span class="post-date">{{ post.date | date: "%b %-d, %Y" }}</span>
    <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
  </li>
{% endfor %}
</ul>

I add a menu archive in the host with layout 'archive'. but it seems it is still not working?
It only shows 'Archive of posts from' without the files
screenshot2

What did i do wrong? and what am I missing to use jekyll-archives?

Thanks, I really appreciate your help

@bbgky
Copy link
Author

bbgky commented Aug 17, 2016

@alfredxing

@pathawks
Copy link
Member

You have specified layout: archive, have you provided an archive layout?

@bbgky
Copy link
Author

bbgky commented Aug 17, 2016

@pathawks Hi, thanks for the comment. i haven't provide an archive layout. because i don't know how to do it. i read the layout.md in the doc, but i don't know where shall i put the code. do you have to write your own layout file? where do you put them? can i have a look?

@bbgky
Copy link
Author

bbgky commented Aug 17, 2016

by the waylayout: archive is recommended in the config.md file, so i
thought it will be generated by the plugin.
or they should write the instruction more clear.

On Wed, Aug 17, 2016 at 3:34 PM, Pat Hawks notifications@github.com wrote:

You have specified layout: archive, have you provided an archive layout
https://github.com/jekyll/jekyll-archives/blob/master/docs/layouts.md?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#66 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARRWb6jWLBA2MqdPjzAH4oQQpmaeUikHks5qg4xcgaJpZM4Jm0e7
.

@pathawks
Copy link
Member

@bbgky You are right, the documentation needs to be more clear.

@bbgky
Copy link
Author

bbgky commented Aug 18, 2016

@pathawks Hi, i tried to create a archive.htmlin _layout folder, and i copy past the code from the configuration.md :

<h1>Archive of posts from {{ page.date | date: "%B %Y" }}</h1>

<ul class="posts">
{% for post in page.posts %}
  <li>
    <span class="post-date">{{ post.date | date: "%b %-d, %Y" }}</span>
    <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
  </li>
{% endfor %}
</ul>

I add a menu archive in the host with layout 'archive'. but it seems it is still not working?
It only shows 'Archive of posts from' without the files
screenshot2

@bbgky bbgky changed the title No Archive page generate and I got 'Build Warning: Layout 'archive' ...... does not exist.' No Archive page generate Aug 18, 2016
@tomasparks
Copy link

I am also getting a similar error message

     Build Warning: Layout '{"year"=>"year-archive", "month"=>"month-archive"}' requested in archive/2014/index.html does not exist.
     Build Warning: Layout '{"year"=>"year-archive", "month"=>"month-archive"}' requested in archive/2014/09/index.html does not exist.
     Build Warning: Layout '{"year"=>"year-archive", "month"=>"month-archive"}' requested in archive/2016/index.html does not exist.
     Build Warning: Layout '{"year"=>"year-archive", "month"=>"month-archive"}' requested in archive/2016/08/index.html does not exist.

@bbgky
Copy link
Author

bbgky commented Aug 19, 2016

It is just because of the poor instruction which is not for beginners.
what you need is create several *.html files yourself in the _layout
directory, which is not mentioned at all.
After I create those layout files, there is no building error, but i am
still struggling how to show the archive pages in the home page, which is
also not mentioned at all!

On Fri, Aug 19, 2016 at 7:42 AM, tomasparks notifications@github.com
wrote:

I am also getting a similar error message

 Build Warning: Layout '{"year"=>"year-archive", "month"=>"month-archive"}' requested in archive/2014/index.html does not exist.
 Build Warning: Layout '{"year"=>"year-archive", "month"=>"month-archive"}' requested in archive/2014/09/index.html does not exist.
 Build Warning: Layout '{"year"=>"year-archive", "month"=>"month-archive"}' requested in archive/2016/index.html does not exist.
 Build Warning: Layout '{"year"=>"year-archive", "month"=>"month-archive"}' requested in archive/2016/08/index.html does not exist.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#66 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARRWb6_Tg-TnOg-7ah3ZnV63UZtsyxpAks5qhcDDgaJpZM4Jm0e7
.

@tomasparks
Copy link

did that same error

cd _layouts
tom@tom-HP-Pavilion-10-TS-Notebook-PC:~/blog/_layouts$ ls
default.html  month-archive.html  page.html  post.html  search_post.html  tag-archive.html  year-archive.html

@bbgky I think your looking for this https://jekyllrb.com/docs/posts/#displaying-an-index-of-posts

@AdiThakker
Copy link

Is there any resolution to this? I am seeing a similar behavior where archives show up correctly in my local environment but not on the github hosted site.

@ashmaroli
Copy link
Member

@AdiThakker GitHub Pages doesn't support this plugin.
You'll have to resort to building locally (or elsewhere) and pushing the contents of _site to the
gh-pages branch.

@kannansuresh
Copy link

Check this out Automated Jekyll Archives for GitHub Pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants