xiangming / landscape-plus

针对中国大陆地区对hexo官方主题landscape进行优化。
http://xiangming.github.io/landscape-plus/
MIT License
508 stars 107 forks source link

archive归档页面问题 #12

Closed tudouya closed 10 years ago

tudouya commented 10 years ago

我想问下,我克隆了主题,主题也都正常,但是为什么点击archive链接的时候会提示404,是需要自己手动创建一个archive页面吗?我试了很多主题都有这个问题 菜鸟一个,求指教~~

xiangming commented 10 years ago

我估计是你hexo根目录的_config.yml没有开启archive,你粘贴一下你的_config.yml文件代码(hexo根目录,不是主题根目录。),我帮你看看。

tudouya commented 10 years ago

@xiangming 嗯,好的,麻烦您了~ 下面是代码: ==========================

# Hexo Configuration
## Docs: http://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: "    php101"
subtitle: ~if you fail to plan,you plan to fail~
description:
author: tudouya
email: 568865013@qq.com
language: zh-CN

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://www.php101.cn
root: /
permalink: :year/:month/:day/:title/
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
permalink_defaults:

# Directory
source_dir: source
public_dir: public

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
auto_spacing: false # Add spaces between asian characters and western characters
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
highlight:
  enable: true
  line_number: true
  tab_replace:

# Category & Tag
default_category: 默认分类
category_map:
tag_map:

# Archives
## 2: Enable pagination
## 1: Disable pagination
## 0: Fully Disable
archive: 2
category: 2
tag: 2

# Server
## Hexo uses Connect as a server
## You can customize the logger format as defined in
## http://www.senchalabs.org/connect/logger.html
port: 4000
server_ip: 0.0.0.0
logger: false
logger_format:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: MMM D YYYY
time_format: H:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Disqus
disqus_shortname:

# Extensions
## Plugins: https://github.com/hexojs/hexo/wiki/Plugins
## Themes: https://github.com/hexojs/hexo/wiki/Themes
theme: RagingCat
exclude_generator:

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
  type: github
  repo: git@github.com:tudouya/tudouya.github.io.git
  branch: master
tudouya commented 10 years ago

@xiangming 代码贴上去貌似自动解析了,您看这样看您方便不

xiangming commented 10 years ago

@tudouya 你需要修改这一部分的设置:

# Archives
## 2: Enable pagination
## 1: Disable pagination
## 0: Fully Disable
archive: 1
category: 1
tag: 1

这里的注释和实际效果其实不吻合,你必须设置为1,而不是2。

配置文件修改好以后,你可能还需要hexo clean一下,然后重新hexo g生成。

tudouya commented 10 years ago

@xiangming 行了,谢谢~~

xiangming commented 10 years ago

一起学习,多交流~