-
Notifications
You must be signed in to change notification settings - Fork 96
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
Similar or "You might be interested" posts #74
Comments
An automatic implementation could just be randomly selecting 0-2 posts from the tags that the post is made with. This option could be selected with a This could also be combined with zshamrock's idea where if you supply a vector of |
Having I'd like Cryogen to have an automated implementation of showing similar posts. Asking authors to determine similar posts could become a hassle for them. TF-IDF algorithm is one of our best options for determining similar blog posts. Similarities could be calculated and I'd like to work on this issue! |
I agree that an automated implementation would be best for this feature. My original concern with this was that user generated
@hantuzun please go ahead! And feel free to reach out to me if you have questions :) |
@lacarmen, with pleasure. Could we discuss how can we generate |
@hantuzun I don't think creation dates should be used since those may not necessarily be unique. Another way to generate |
Hello, I think a simple ":group" metadata would help already, that way I can define a group of posts manually. My idea would be to add it like tags, but while tags is a list of keywords, the group is just a link to one (maybe more) group. For example: I have written several tutorials about a specific topic: these I would like to group Unfortuantely, I did not fully understand the customization which are possible. for example I tried to add the "tags count". that worked, but as soon as I change something (i.e. add a space in tags.html), the count number disappeared again. |
@tjungbauer good thinking using the extension capabilities. What part did you get tripped up on? The two extension functions basically allow you to manipulate the post/site data (adding keys, changing values, etc. Anything you want really) before passing it to the render functions. Can you be more specific about the problem you ran into with the tags example? Adding a space to the HTML template should not break things. |
@lacarmen I try to follow this guide: http://cryogenweb.org/docs/customizing-cryogen.html#add_counts_of_tag_occurrences I created the file compiler.clj under src/cryogen and copied the code into it. I also changed the tags.html. Today nothing is shown, when I "ring" the server I have checked everything in at https://github.com/stderrat/blog-src maybe it is obvious what does not work. for me clojure is kinda new. :) |
@tjungbauer oh I see :) The example code should be placed here and here. The first is called when you run If you do not want the code duplicated then put the code into a function your new file, compiler.clj (which needs to be made into a proper namespace) and import that into server.clj and core.clj. Here's an example. |
ahhh, now I get it. sorry for that. I'll try to add this "group" metatag then. many thanks for your help. |
Excellent, hope it works! |
IMO introducing an extra :id just complicates the code. The filename is the id. And yes, you might decide to change that. Simple search & replace is a good enough solution for me. As suggested, you can use the |
This is a nice feature of the blog engine to provide set of articles in the end of the post linking to similar/"you might also like" posts.
One way to implement this might be to add 2 extra metadata into post header, in addition to :title, :layout and others:
:id
- an id/alias of the current post, like:id :clojure-intro
(so, easily memorizable for the blog owner, and used only internally instead of relying on the post file name or title, which might be changed separately from the:id
):similar-posts <vector of id-s>
, like:similar-posts [:clojure-intro :value-simplicity]
, etc. So, the author decides himself what other articles related to this one, and which might be interested for the reader as well.And then update the page template to iterate over
:similar-posts
if it is not empty, to put set of links on the bottom or somewhere else recommending further reading.The text was updated successfully, but these errors were encountered: