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

How can I get the default_category? #3266

Open
practicemp opened this Issue Sep 23, 2018 · 2 comments

Comments

2 participants
@practicemp

practicemp commented Sep 23, 2018

root _config.yml

default_category: uncategorized

A post without category:

---
title: Hello World
date: 2018-09-23 12:08:01
---

Add the following line to post.pug:

- console.log(page.categories)

terminal ouput:

Query { data: [], length: 0 }

Add the following line to index.pug:

- console.log(site.categories)

Output without uncategorized category.

How can I get the default_category?

@practicemp

This comment has been minimized.

Show comment
Hide comment
@practicemp

practicemp Sep 23, 2018

hexo server --debug

output:

➜  blog hexo server --debug
04:40:30.830 DEBUG Hexo version: 3.7.1
04:40:30.833 DEBUG Working directory: ~/blog/
04:40:30.930 DEBUG Config loaded: ~/blog/_config.yml
04:40:30.948 DEBUG Plugin loaded: hexo-generator-archive
04:40:30.949 DEBUG Plugin loaded: hexo-generator-category
04:40:30.951 DEBUG Plugin loaded: hexo-generator-index
04:40:30.953 DEBUG Plugin loaded: hexo-generator-tag
04:40:30.956 DEBUG Plugin loaded: hexo-renderer-ejs
04:40:31.336 DEBUG Plugin loaded: hexo-renderer-jade
04:40:31.344 DEBUG Plugin loaded: hexo-renderer-marked
04:40:31.371 DEBUG Plugin loaded: hexo-renderer-sass
04:40:31.373 DEBUG Plugin loaded: hexo-renderer-stylus
04:40:31.448 DEBUG Plugin loaded: hexo-server
04:40:31.459 DEBUG Loading database.
04:40:31.469 INFO  Start processing
04:40:31.494 DEBUG Processed: source/favicon.ico
04:40:31.499 DEBUG Theme config loaded.
04:40:31.499 DEBUG Processed: _config.yml
04:40:31.500 DEBUG Processed: source/css/peace.css
04:40:31.581 DEBUG Processed: layout/.DS_Store
04:40:31.581 DEBUG Processed: layout/index.pug
04:40:31.582 DEBUG Processed: layout/post.pug
04:40:31.591 DEBUG Processed: _posts/hello-world.md
04:40:31.745 DEBUG Generator: page
04:40:31.745 DEBUG Generator: post
04:40:31.746 DEBUG Generator: archive
04:40:31.746 DEBUG Generator: category
04:40:31.746 DEBUG Generator: index
04:40:31.746 DEBUG Generator: tag
04:40:31.747 DEBUG Generator: asset
04:40:31.751 INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
04:40:31.756 DEBUG Database saved

practicemp commented Sep 23, 2018

hexo server --debug

output:

➜  blog hexo server --debug
04:40:30.830 DEBUG Hexo version: 3.7.1
04:40:30.833 DEBUG Working directory: ~/blog/
04:40:30.930 DEBUG Config loaded: ~/blog/_config.yml
04:40:30.948 DEBUG Plugin loaded: hexo-generator-archive
04:40:30.949 DEBUG Plugin loaded: hexo-generator-category
04:40:30.951 DEBUG Plugin loaded: hexo-generator-index
04:40:30.953 DEBUG Plugin loaded: hexo-generator-tag
04:40:30.956 DEBUG Plugin loaded: hexo-renderer-ejs
04:40:31.336 DEBUG Plugin loaded: hexo-renderer-jade
04:40:31.344 DEBUG Plugin loaded: hexo-renderer-marked
04:40:31.371 DEBUG Plugin loaded: hexo-renderer-sass
04:40:31.373 DEBUG Plugin loaded: hexo-renderer-stylus
04:40:31.448 DEBUG Plugin loaded: hexo-server
04:40:31.459 DEBUG Loading database.
04:40:31.469 INFO  Start processing
04:40:31.494 DEBUG Processed: source/favicon.ico
04:40:31.499 DEBUG Theme config loaded.
04:40:31.499 DEBUG Processed: _config.yml
04:40:31.500 DEBUG Processed: source/css/peace.css
04:40:31.581 DEBUG Processed: layout/.DS_Store
04:40:31.581 DEBUG Processed: layout/index.pug
04:40:31.582 DEBUG Processed: layout/post.pug
04:40:31.591 DEBUG Processed: _posts/hello-world.md
04:40:31.745 DEBUG Generator: page
04:40:31.745 DEBUG Generator: post
04:40:31.746 DEBUG Generator: archive
04:40:31.746 DEBUG Generator: category
04:40:31.746 DEBUG Generator: index
04:40:31.746 DEBUG Generator: tag
04:40:31.747 DEBUG Generator: asset
04:40:31.751 INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
04:40:31.756 DEBUG Database saved

@tcrowe tcrowe added the question label Sep 24, 2018

@tcrowe

This comment has been minimized.

Show comment
Hide comment
@tcrowe

tcrowe Sep 24, 2018

Contributor

Good question @practicemp it's not showing up in the list. 🤔

Contributor

tcrowe commented Sep 24, 2018

Good question @practicemp it's not showing up in the list. 🤔

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