Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:25

    ddfreyne on master

    Regenerate .rubocop_todo.yml (compare)

  • 08:19

    ddfreyne on master

    Refactor: Enable new Rubocop co… (compare)

  • 08:07

    ddfreyne on master

    Refactor: Replace deprecated mo… (compare)

  • 08:03

    ddfreyne on master

    Upgrade Rubocop and fix offenses Refactor: Replace deprecated Bu… (compare)

  • Mar 24 18:30
    ddfreyne labeled #1496
  • Mar 24 18:30
    ddfreyne closed #1496
  • Mar 24 18:30
    ddfreyne commented #1496
  • Mar 24 18:30

    ddfreyne on master

    Ignore redirects to self (misue… Style: Fix Rubocop whitespace o… Merge branch 'da2x-patch-8' (compare)

  • Mar 24 18:27

    ddfreyne on fix-more-keyword-arg-warnings

    (compare)

  • Mar 24 18:26

    ddfreyne on master

    Fix some more “Using the last a… Merge pull request #1498 from n… (compare)

  • Mar 24 18:26
    ddfreyne closed #1498
  • Mar 24 18:21
    ddfreyne commented #1479
  • Mar 24 18:20
    ddfreyne labeled #1498
  • Mar 24 18:20
    ddfreyne opened #1498
  • Mar 24 18:20

    ddfreyne on fix-more-keyword-arg-warnings

    Fix some more “Using the last a… (compare)

  • Mar 23 09:43
    iay commented #1479
  • Mar 23 01:56
    Ecco edited #1497
  • Mar 23 01:55
    Ecco edited #1497
  • Mar 23 01:54
    Ecco opened #1497
  • Mar 21 13:26
    da2x commented #1483
Gregory Pakosz
@gpakosz
yes sure but it still feels dirty to dump :last snapshot to a file, just for the sake of running Sprockets and loading it again
Denis Defreyne
@ddfreyne
Sprockets isn’t really maintained anymore anyway :(
Daniel Aleksandersen
@da2x
@gpakosz there’s nothing wrong with a bit of bodging every now and then to make stuff work.
Denis Defreyne
@ddfreyne
Lots of frontend dev has moved to the Node ecosystem, though over there it can also be a mess because it’s so fast-moving
Gregory Pakosz
@gpakosz
https://github.com/rails/sprockets doesn't look unmaintained
Denis Defreyne
@ddfreyne

@ddfreyne -VV didn’t help with this issue, though. this was all time spent before the stages it tracks.

@da2x Yep, it doesn’t track everything (yet). It’s something still to do

@gpakosz Hmm, I take back what I said
Gregory Pakosz
@gpakosz
@ddfreyne what's the idea behind extract-nanoc-sass?
Denis Defreyne
@ddfreyne
@gpakosz It’s an idea to extract the sass filter into a separate gem
(As well as the other filters, too.)
It makes development slightly easier and increases isolation between components
Gregory Pakosz
@gpakosz
how is it easier?
Denis Defreyne
@ddfreyne
Being able to release independently-versioned gems means uncoupled development cycle, and splitting out gems means they can be tested a bit more quickly.
But the main reason is the isolation for sure
Gregory Pakosz
@gpakosz
so many gems but a mono repo
Denis Defreyne
@ddfreyne
Indeed
Tim Hosgood
@thosgood
hi, hope this is the right place to ask this question: i have a menu/header that i include as a component, but i’d like for the link to the current page to be bold (or something like this). i’m guessing there’s maybe a way to pass an argument in the yaml data at the top of each page, but i’m not too sure on the best way to do it. was thinking that maybe somebody has already figured this out!
Denis Defreyne
@ddfreyne
@thosgood You can pass arguments to the render call, e.g. <%= render 'head', item: @item %>
@thosgood If you pass in item_rep: @item_rep, you will be able to use link_to_unless_current helper (see https://nanoc.ws/doc/reference/helpers/#linkto)
Daniel Aleksandersen
@da2x
I’ve got a file that needs to read the modified time of compiled items. There is item[:mtime]for getting the content file mtime. Is there a better way than
File.mtime(item.reps[:default].raw_path)? It’s timing sensitive and sporadically crashes with Errno::ENOENT: No such file or directory @ rb_file_s_mtime.
Denis Defreyne
@ddfreyne
Hmmmm, yeah… it is timing-sensitive because the writes happen asynchronously
Denis Defreyne
@ddfreyne
@da2x What are you using the modification time of the compiled items for?
Daniel Aleksandersen
@da2x
@ddfreyne sitemaps
the <lastmod> element tells search engines whether there’s any point in revisiting a given page. I use the content @item[:mtime] for content pages and the compiled mtime for indexes and other taxonomy pages that consists of multiple items.
setting lastmod in sitemaps results in noticeably faster reindexing (one week versus three months)
Daniel Aleksandersen
@da2x
I also have a sitemap index (a sitemap of other sitemaps) that contains the compilation mtime of the other sitemaps.
Denis Defreyne
@ddfreyne
@da2x I use the original source item’s modification timestamp and that works well
(it is slightly more reliable I find, since it doesn’t update when the layout updates, which I think is usually the more desirable behavior)
Daniel Aleksandersen
@da2x
But what do you do for items that doesn’t really have a single source item? Like the front page or a tag page.
Denis Defreyne
@ddfreyne
How about it being the max of the mtimes of the individual pages?
Daniel Aleksandersen
@da2x
feed_update_datetime = '' entries.each { | entry | feed_update_datetime = [ feed_update_datetime, entry[:created_at], entry[:updated_at] ].max }
that’s what I do for the //feed/updated element in Atom feeds
ah. now I remember. I wanted to avoid having the sitemap.xml depend on all items, so I made it only depend on **/*-sitemap.xml.
Denis Defreyne
@ddfreyne
I think the dependency-tracking shouldn’t cause too much recompilation though
(I hope)
Gregory Pakosz
@gpakosz
@ddfreyne hello 👋
@ddfreyne how would you add a cache to Nanoc::Filters::SassCommon#render()?
@ddfreyne to avoid calling into sass twice
@ddfreyne CACHE = {} in the module?
Denis Defreyne
@ddfreyne
@gpakosz That would work!
@gpakosz You can also use ddmemoize: https://github.com/ddfreyne/ddmemoize — it’s a memoization library I wrote
I claim that it’s the best memoization library in Ruby. ^^
Gregory Pakosz
@gpakosz
well to use ddmemoize I would have to define yet another method but why not
Gregory Pakosz
@gpakosz
A long time ago, for memoization there was Nanoc::Int::Memoization, now I should use the ddmemoize gem?
Denis Defreyne
@ddfreyne
@gpakosz Nanoc::Int::Memoization became ddmemoize — I extracted it
ddmemoize is the same but better
Nanoc also uses it internally
Gregory Pakosz
@gpakosz
k
thanks