1.0.33 • Published 3 years ago

hexo-generator-restful-wx v1.0.33

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

hexo-generator-restful-wx

  • Based on hexo generator restfulModified to add a long list of specified articles (for the display of rotation chart)

Install

npm install hexo-generator-restful-wx --save

Representative project

Under the configuration hexo file _config.yml

  • Add the following as the default configuration. If the attribute value isfalse, it means that it will not be generated
restful:
  #Site can be configured to selectively grow some properties of the array
  # site: ['title','subtitle','description','author','since',email','favicon','avatar']
  # site: true # hexo.config mix theme.config
  posts_size: 10 # article list pagination, 0 means no Pagination
  posts_props: # article list item features to be generated
    title: true
    slug: true
    date: true
    updated: true
    comments: true
    path: true
    excerpt: false
    cover: true # cover picture, take the first picture of the article
    content: false
    keywords: false
    categories: true
    tags: true
  categories: true # classification data
  use_category_slug: false # use slug is filename of category data
  tags: true # tag data
  use_tag_slug: false # use slug is filename of tag data
  post: true # article data
  pages: false # additional hexo page data, such as about
  swipers_list: [] # generate the specified page information and fill in the name of your article folder, such as ['css','js'], without suffix. It is mainly used for the rotation map API

Document

*'domain 'is your deployed domain name address, eg: https://u.mr90.top Or https://u.mr90.top/blog

Request methodrequest addressrequest details
Getdomain + /api/site.jsonget all hexo configurations (station configuration and topic configuration)
Getdomain + /api/posts.jsonif configuredposts_Size: 0 does not page and gets all articles
Getdomain + /api/posts/:pagenum. jsonget paging data. After setting the list classification, :pagenum is a dynamic variable (number of pages), eg: /api/1.json .
Getdomain + /api/tags.jsonget all article tags. If there is no tag, it will not be generated
Getdomain + /api/tags/:tagName.jsonget the specified tag article list, :tagName is the custom tag name of your article, eg: /api/tags/Web.json .
Getdomain + /api/categories.jsonget the classification of all articles
Getdomain + /api/categories/:catename.jsonget the article list of the specified category
Getdomain + /api/articles/:slug.jsonobtain the detailed data of the article according to the other name of the article, ` : slug 'is the other name of the article
Getdomain + /api/swiper.jsonget the article list with the specified name. Eg: ['Web ',' hexo ',' Java '] the characters in the array are the different names of the specified articles. The function is mainly used for the specified dynamic configuration of wechat applet rotation map articles

Get Implecit Pages

Get the content of hexo implicit pages from the theme, such as about, etc. because implicit pages (except about and other navigation bar entry pages) generally do not provide direct access in hexo, developers calling this API need to know the full path, which is closed by default eg:

Request
GET /api/pages/about.json
1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago