0xdevalias / devalias.net

Source for devalias.net
http://www.devalias.net/
48 stars 10 forks source link

disable/remove jekyll related posts (--lsi) + related dependencies #114

Closed 0xdevalias closed 2 days ago

0xdevalias commented 2 days ago

This PR comments out the flags/dependencies related to Jekyll's 'related posts' feature, and specifically the --lsi 'Latent Semantic Indexing' feature for calculating related posts based on similarity.

It was pointed out that we're not even currently making uses of the related posts functionality, so the complexities of trying to get the dependencies to speed up --lsi aren't even relevant to us currently:

A few notes that you might find helpful:

  • You're not noticing any difference in build times with the --lsi option because your site (as it is today in this repo) doesn't use related posts (so the --lsi option does nothing). To use LSI, you need to call site.related_posts somewhere in a Liquid template. For example, you might add something like the following to _layouts/post.html:
    {% for post in site.related_posts limit:3 %}
    <p>{{ post.title }}</p>
    {% endfor %}
  • When you call site.related_posts, if you don't pass the --lsi option, it's just recent posts.
  • If you are using site.related_posts and you pass the --lsi option, You'll see Populating LSI... in your jekyll build --lsi output. The build will be slow unless you have the gsl gem and native gsl library installed. I haven't experimented with nmatrix or narray at all, but simply using the gsl gem results in a ~500x speed increase for my use.

Originally posted by @mkasberg in https://github.com/0xdevalias/devalias.net/issues/83#issuecomment-846468147

That said, it would be nice to bring back some kind of 'related posts' feature at some point.. and there are some further notes about that in the following comment (both with using --lsi + more updated dependencies, or by using OpenAI embeddings/similar):

See Also

This PR partially fixes/relates to the following:

And may have some impact on the following: