Git Product home page Git Product logo

Comments (5)

tomap avatar tomap commented on May 22, 2024

Are you looking for something like that:
https://github.com/tomap/hexo-theme-minidyne/blob/master/layout/archive.ejs#L30

from hexo-generator-feed.

brettz9 avatar brettz9 commented on May 22, 2024

No, I'm trying to understand what the allowable values are for order_by per https://github.com/hexojs/hexo-generator-feed#options and in source at

var posts = locals.posts.sort(feedConfig.order_by || '-date');
. There is a - at the beginning of date (and attached to it).

from hexo-generator-feed.

brettz9 avatar brettz9 commented on May 22, 2024

Looks like the API is https://hexojs.github.io/warehouse/Query.html#sort and - does mean reverse order. But I'm still looking for confirmation of the allowable values. Maybe it is for "Post" just under https://hexo.io/docs/variables#Page-Variables which suggests it inherits from Page too.

from hexo-generator-feed.

curbengh avatar curbengh commented on May 22, 2024

I believe allowable options are derived from the front-matter, e.g. title, date, updated, etc.

front-matter also allows custom value, this example has lastUpdated.

note that order_by value must exist in the front-matter of all posts, for example all posts should have title and date in the front-matter, so these values are safe to use; but values like updated or excerpt are optional and can be empty.

TL;DR date, -date, title, -title.

from hexo-generator-feed.

stevenjoezhang avatar stevenjoezhang commented on May 22, 2024

Closing due to inactivity, please re-open if it is still outstanding.

from hexo-generator-feed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.