eddiesigner / liebling

Beautiful and clean Ghost theme that is easy and comfortable to use. To get the latest version please head over the releases page 👉🏼
https://github.com/eddiesigner/liebling/releases
MIT License
1.27k stars 603 forks source link

Taglist #178

Closed andreasmaierhofer closed 4 years ago

andreasmaierhofer commented 4 years ago

Hello! First of all: I love your Theme, it's just great.

One thing I would really love is a Tag-Page like this: http://sinai.aspirethemes.com/tags/

Since I have more and more Content on my page, this would be great to increase the usability.

Just an input. Thank you for your work.

eddiesigner commented 4 years ago

That's a good idea, I guess in the near future I'll release a new version that includes this feature.

hiensarahly commented 4 years ago

Hi @eddiesigner & friends please see if this could work:

{{!-- The tag below means: insert everything in this file into the {body} of the default.hbs template --}} {{!< default}}

{{!-- Everything inside the #post tags pulls data from the post --}} {{#post}}

{{!-- Special header.hbs partial to generate the
tag --}} {{> header background=feature_image}} {{!-- Inject styles of the hero image to make it responsive --}} {{> hero background=feature_image}}

{{title}}

{{#if custom_excerpt}}

{{custom_excerpt}}

{{/if}}
{{content}}
{{#get 'tags' limit='1' include='count.posts' order='count.posts asc'}} {{#foreach tags}} {{/foreach}} {{/get}} {{#get 'tags' limit='1' include='count.posts' order='count.posts desc'}} {{#foreach tags}} {{/foreach}} {{/get}} {{#get 'tags' limit='all' include='count.posts' order='name ASC'}} {{#foreach tags}} {{ name }} {{/foreach}} {{/get}}

{{/post}}

{{!-- The #contentFor helper here will send everything inside it up to the matching #block helper found in default.hbs --}} {{#contentFor "scripts"}} <script defer src="{{asset "js/page.js"}}"> {{/contentFor}}


- Create a Tags page, e.g. https://YOUR_BLOG_URL/tags
- Choose tagsCloud template in the page settings
- Done!

I got it working on my blog with Liebling theme, very glad! ^^ 

Credits:
- https://forums.engineerworkshop.com/t/how-to-make-a-tags-page/93/2
- https://github.com/Torqu3Wr3nch/nightCasper/blob/master/custom-tagsCloud.hbs
eddiesigner commented 4 years ago

@hiensarahly Thanks for sharing! Would you mind to show us a live example just to see how it looks? 😄

Btw, I think you don't need to use {{#get}} twice in order to get the min and max values, I guess you can use it once and get those values by using @first and @last somehow, more info here: https://ghost.org/docs/api/v3/handlebars-themes/helpers/foreach/#first--last

hiensarahly commented 4 years ago

@eddiesigner The example tag page is here if you would like a look: https://zenyrgarden.com/tags/ I truly appreciate it!!

You know I didn't write that code piece :) but obviously the author is very open for improvement. It's great to tweak it to make it cleaner, I like that idea a lot!

eddiesigner commented 4 years ago

No problem ;) Thanks again for sharing!

eddiesigner commented 4 years ago

Hey everyone 👋🏻

I just released a new version that finally includes a Taglist page.

You can see a live demo here: https://liebling.eduardogomez.io/tags/

And you can see how to enable it here: https://github.com/eddiesigner/liebling/wiki/How-to-enable-Taglist-page

Please download the latest version to get it ;)

eddiesigner commented 4 years ago

I will close this issue since this feature is already implemented in the latest version ;)