Categories and DateFormat

21 views
Skip to first unread message

ry...@awsum.co

unread,
May 21, 2013, 8:12:47 AM5/21/13
to nikola-...@googlegroups.com
HI, all

New to the group, first off just want to say the work done on Nikola is fantastic, coming from Hyde it is a step in the right direction for me. Great work please keep it up. 

I have a few questions about templates, I have started migrating an existing wordpress template I like, however I am stuck on a few things. I have looked at the "The Handbook" and it has been useful thus far, however some things are unclear. 

* Does Nikola support post categories ?
* How do I change the date format in post ?

I have more questions , but these are the two that are bugging me right now. 

Thanks in advance.

R

Roberto Alsina

unread,
May 21, 2013, 8:29:59 AM5/21/13
to nikola-...@googlegroups.com
On 21/05/13 09:12, ry...@awsum.co wrote:
> HI, all
>
> New to the group, first off just want to say the work done on Nikola
> is fantastic, coming from Hyde it is a step in the right direction for
> me. Great work please keep it up.
>
> I have a few questions about templates, I have started migrating an
> existing wordpress template I like, however I am stuck on a few
> things. I have looked at the "The Handbook" and it has been useful
> thus far, however some things are unclear.
>
> * Does Nikola support post categories ?

The answer is "sort of".

It supports tags, which you could treat as categories. And it supports
putting the posts in a folder hierarchy, which you can also treat as
categories (but r doesn't give you per-category feeds, unless you *also*
tag those posts)

> * How do I change the date format in post ?
>

In the file you create? Just use your preferred format, it should just
work.
In the output? Use the DATE_FORMAT option, like this:

DATE_FORMAT = '%Y-%m-%d %H:%M'


> I have more questions , but these are the two that are bugging me
> right now.
>
> Thanks in advance.
>

Hope this helps!

Ryan

unread,
May 21, 2013, 9:02:17 AM5/21/13
to nikola-...@googlegroups.com
Hi

Thanks for the speedy reply.

On 21 May 2013, at 2:29 PM, Roberto Alsina <ral...@netmanagers.com.ar> wrote:

> On 21/05/13 09:12, ry...@awsum.co wrote:
>> HI, all
>>
>> New to the group, first off just want to say the work done on Nikola
>> is fantastic, coming from Hyde it is a step in the right direction for
>> me. Great work please keep it up.
>>
>> I have a few questions about templates, I have started migrating an
>> existing wordpress template I like, however I am stuck on a few
>> things. I have looked at the "The Handbook" and it has been useful
>> thus far, however some things are unclear.
>>
>> * Does Nikola support post categories ?
>
> The answer is "sort of".
>
> It supports tags, which you could treat as categories. And it supports
> putting the posts in a folder hierarchy, which you can also treat as
> categories (but r doesn't give you per-category feeds, unless you *also*
> tag those posts)

This is what I thought. Maybe it would be a cool feature request in the meta part of the part.

For now I will just use the first Tag as the "Sort of gallery".

Anyone made a Tag Cloud yet.

>
>> * How do I change the date format in post ?
>>
>
> In the file you create? Just use your preferred format, it should just
> work.
> In the output? Use the DATE_FORMAT option, like this:
>
> DATE_FORMAT = '%Y-%m-%d %H:%M'
>

Thanks for this, anyway to set this in the templates rather ?

>
>> I have more questions , but these are the two that are bugging me
>> right now.
>>
>> Thanks in advance.
>>
>
> Hope this helps!
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "nikola-discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/nikola-discuss/7SvJ_1oJl5M/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to nikola-discus...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Roberto Alsina

unread,
May 21, 2013, 9:18:18 AM5/21/13
to nikola-...@googlegroups.com
On 21/05/13 10:02, Ryan wrote:
Hi

Thanks for the speedy reply.

On 21 May 2013, at 2:29 PM, Roberto Alsina <ral...@netmanagers.com.ar> wrote:

On 21/05/13 09:12, ry...@awsum.co wrote:
HI, all

New to the group, first off just want to say the work done on Nikola
is fantastic, coming from Hyde it is a step in the right direction for
me. Great work please keep it up. 

I have a few questions about templates, I have started migrating an
existing wordpress template I like, however I am stuck on a few
things. I have looked at the "The Handbook" and it has been useful
thus far, however some things are unclear. 

* Does Nikola support post categories ?
The answer is "sort of".

It supports tags, which you could treat as categories. And it supports
putting the posts in a folder hierarchy, which you can also treat as
categories (but r doesn't give you per-category feeds, unless you *also*
tag those posts)
This is what I thought. Maybe it would be a cool feature request in the meta part of the part. 

For now I will just use the first Tag as the "Sort of gallery".

Anyone made a Tag Cloud yet.

Oh yes :-)

http://ralsina.com.ar/weblog/posts/nikola-feature-by-request-tag-cloud.html

Seems to be broken currently though, but Kay Hayen has a working version.



      

        
* How do I change the date format in post ?

In the file you create? Just use your preferred format, it should just
work.
In the output? Use the DATE_FORMAT option, like this:

DATE_FORMAT = '%Y-%m-%d %H:%M'

Thanks for this, anyway to set this in the templates rather ?

Well, yes, the templates say things like post.formatted_date(date_format) which you can change to use whatever date_format you want.


Ryan

unread,
May 21, 2013, 9:23:08 AM5/21/13
to nikola-...@googlegroups.com
I will look into this, thanks.



      

        
* How do I change the date format in post ?

In the file you create? Just use your preferred format, it should just
work.
In the output? Use the DATE_FORMAT option, like this:

DATE_FORMAT = '%Y-%m-%d %H:%M'

Thanks for this, anyway to set this in the templates rather ?

Well, yes, the templates say things like post.formatted_date(date_format) which you can change to use whatever date_format you want.



Just a stab in the dark here, would it look like something like this: post.formatted_date(' %Y-%m-%d ') or with out the ''

Last question for today, how do I set variables in conf.py to be used in the template ? 

Niko Wenselowski

unread,
May 26, 2013, 7:38:51 AM5/26/13
to nikola-...@googlegroups.com
Hello Ryan,

a string can be created with either single or double quotation marks.
So your post.formatted_date(' %Y-%m-%d ') will work.

Most of the stuff already defined in conf.py is accesible in a theme with the difference that you will have name of a variable written in uppercase in conf.py but access it in the theme with the name in lowercase.
You can set custom variables at the end of conf.py at GLOBAL_CONTEXT.

Is this what you meant?


Kind regards

Niko

ry...@awsum.co

unread,
May 27, 2013, 2:53:39 AM5/27/13
to nikola-...@googlegroups.com
HI

Yeah I figured out the date and the Context thingy after looking at some other themes.

Thanks for the reply. Nikola is an awesome piece of software, so simple to use. 

I have a template which I have converted, where is the  best place to put it for feedback ?

Anyone have any Tips on getting the Tag cloud working, the javascripts seems broken at the moment.

R
Reply all
Reply to author
Forward
0 new messages