Code Monkey home page Code Monkey logo

Comments (5)

derikb avatar derikb commented on July 22, 2024

Ok, looks like the alternative value in the list_ helpers for "style" is false.

from site.

tcrowe avatar tcrowe commented on July 22, 2024

Hey @derikb 👋

One option for advanced users and theme makers is to use those variables directly.

These will be the variables available by default:
https://hexo.io/docs/front-matter#Settings-amp-Their-Default-Values
https://hexo.io/docs/variables#Page-Variables

In the front matter at the top you can create your own too:

title: one two three
tags:
  - four
  - five
  - six
customThing: seven

In the template it should be available as page.tags or post.tags, depending on the context. If you want to get at customThing it would be like page.customThing or post.customThing.

Default use:
https://github.com/hexojs/hexo-theme-landscape/blob/master/layout/_partial/post/tag.ejs#L2

site.tags also:
https://github.com/theme-next/hexo-theme-next/blob/999f0f786f06f63493d117e413c8e7724bc66d80/layout/_partials/sidebar/site-overview.swig#L59


So, if you know how to edit the templates you can access and loop through each of these things.

The database it's using is called warehouse. It has a lot of nifty queries it can do. If you start using that in your theme and want some help just ping us back!


Was any of that of help?

from site.

derikb avatar derikb commented on July 22, 2024

Not really... @tcrowe but thanks for responding...

Does looping through post.tags just get me an array of strings? Was kind of hoping it gave me some other data (like the archive url for that tag, etc.)? (I wanted to further customize what list_tags() gives me by directly accessing the tag data, but I'm not clear what is in that data.

And post.next and post.prev... are they objects that have all the same vars I would have if I were in the template/layout for the individual post? If so, that would be a good thing to have in the docs to clarify that.

from site.

tcrowe avatar tcrowe commented on July 22, 2024

If you jump into your templates in ./theme/your-theme/... you can start outputting the data and you can see what's in it. It just takes a little time and effort.

from site.

noraj avatar noraj commented on July 22, 2024

@derikb I have made various PR on list_tags in 2020, look now there are plenty new options and the doc was updated.

from site.

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.