-
Notifications
You must be signed in to change notification settings - Fork 115
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
Taxonomy (second attempt) #481
Conversation
Some comments:
The links doesn't work for me i.e Adding, deleting tags seem to work for me ;) |
Thanks for the feedback!
The new templates show how one can do this (e.g.: https://github.com/tlienart/FranklinTemplates.jl/tree/tags/src/templates/basic/_layout), basically make the content of |
I see yeah I've changed my foot and head accordingly but your decision makes sense then I guess. |
Sorry the initial fix was something else, the actual fix will be in soon, thanks! |
Now in 😄 |
I've updated all templates, will play with this a bit more and merge tomorrow I think. |
Haha now the href is just |
oops |
fixed... dumb typo |
How to check if a page has a tag in templates? |
@newptcai please post in issues not in PR, tags will be advertised in the NEWS section soon. |
Alright folks, this brings tags (back) in. When I have gained more confidence that this works as expected I'll merge and it will be minor release
0.8
. This is one of the main missing feature that I really wanted to add in Franklin.I'd like some help to check it has the right behaviour. Basic stuff is unit-tested but the overall working of the tags is a bit subtle in terms of cleaning things up when tags are added/removed while the server is running.
To test this
Just add
@def tags = [...]
on meaningful pages. The first run will force-add a basic_layout/tag.html
page which will be the mould for all generate tag pages. You should tweak this so that it respects the style of the rest of your pages. In the future it will be part of templates.The function
{{taglist}}
could be replaced by your own function{{customTaglist}}
by adding ahfun_customTaglist
in yourutils.jl
but let's maybe not worry about that right now.The basic one
{{taglist}}
just adds the list of pages corresponding to the tag by reverse chronological order.The very important thing to note is that
_layout/tag.html
must not depend on local page variable. It can only:{{fill var path/to/page}}
The only exception is
fd_tag
which contains the tag name. This you can use in the title for instance. For convenience let's reproduce the default HTML with some comments:{{fill fd_tag}}
this will fill the tag name{{taglist}}
function which will generate something likeFinally you can still use
{{ispage /tag/tagname/}}...{{end}}
to change the style depending on which tag page you're on.