theme-next / hexo-theme-next

Elegant and powerful theme for Hexo.
https://theme-next.org
Other
8.17k stars 2.05k forks source link

How can I create archive page in monthly? #856

Closed Cynthia0329 closed 5 years ago

Cynthia0329 commented 5 years ago

Expected behavior

I want to create an archive page in monthly the code what I tried:

archive_generator:
  per_page: 30
  yearly: true
  monthly: true 

Actual behavior

But it didn't work

Node.js and NPM Information

node:v11.13.0
npm:6.7.0

Package dependencies Information

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.8.0"
  },
  "dependencies": {
    "hexo": "^3.8.0",
    "hexo-browsersync": "^0.3.0",
    "hexo-deployer-git": "^1.0.0",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.1",
    "hexo-generator-searchdb": "^1.0.8",
    "hexo-generator-tag": "^0.2.0",
    "hexo-helper-live2d": "^3.1.1",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-marked": "^0.3.2",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-server": "^0.3.3"
  }
}

Hexo Information

Hexo version

hexo: 3.8.0
hexo-cli: 1.1.0
os: Windows_NT 10.0.17763 win32 x64
node: 11.13.0
v8: 7.0.276.38-node.18
uv: 1.27.0
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 67
nghttp2: 1.34.0
napi: 4
llhttp: 1.1.1
http_parser: 2.8.0
openssl: 1.1.1b
cldr: 34.0
icu: 63.1
tz: 2018e
unicode: 11.0

Hexo Configuration

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

# Site
title: Hexo
subtitle:
description:
keywords:
author: Cynthia
language: zh-CN
timezone:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://yoursite.com
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
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
future: true
# 代码高亮设置
highlight:
  enable: true
  line_number: true
  auto_detect: false  # 代码自动高亮
  tab_replace:

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# 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: YYYY-MM-DD
time_format: HH:mm:ss

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

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

# Deployment(站点配置)
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: git@github.com:Cynthia0329/Cynthia0329.github.io.git
  branch: master

# Live2D
## https://github.com/xiazeyu/live2d-widget.js
## https://l2dwidget.js.org/docs/class/src/index.js~L2Dwidget.html#instance-method-init
live2d:
  enable: true
  scriptFrom: local
  pluginRootPath: live2dw/
  pluginJsPath: lib/
  pluginModelPath: assets/
  tagMode: false
  debug: false
  model:
    use: live2d-widget-model-tororo
  display:
    position: left
    width: 240
    height: 300
  mobile:
    show: true
  react:
    opacity: 1

# 搜索
search:
  path: search.xml
  field: post
  format: html
  limit: 10000

NexT Information

NexT Version:

NexT Scheme:

NexT Configuration:

  # 归档页的分页设置
archive_generator: #归档页的配置
  per_page: 30 #归档页每页博客数
  yearly: true #按年归档
  monthly: true #按月归档

Other Information

welcome[bot] commented 5 years ago

Thanks for opening this issue, maintainers will get back to you as soon as possible!

stevenjoezhang commented 5 years ago

All the options are listed in the _config.yml file, so setting monthly: true has no effect

See also: https://github.com/theme-next/hexo-theme-next/issues/848 And https://github.com/iissnan/hexo-theme-next/issues/408

stevenjoezhang commented 5 years ago

@Cynthia0329 You can install this plugin: https://github.com/theme-next/theme-next-calendar