Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 24 09:26
    ddfreyne converted_to_draft #1385
  • Oct 24 08:37
    ddfreyne commented #1511
  • Oct 24 08:15
    ddfreyne synchronize #1511
  • Oct 24 08:15

    ddfreyne on clonefile

    Use clonefile for space efficie… (compare)

  • Oct 24 08:09
    ddfreyne edited #1511
  • Oct 24 08:07
    ddfreyne unlabeled #1511
  • Oct 24 08:07
    ddfreyne edited #1511
  • Oct 24 08:03
    ddfreyne synchronize #1511
  • Oct 24 08:03

    ddfreyne on clonefile

    Use clonefile for space efficie… (compare)

  • Oct 24 08:02

    ddfreyne on main

    Refactor: Extract ItemRepWriter… (compare)

  • Oct 24 07:58

    ddfreyne on avoid-git-initial-branch

    (compare)

  • Oct 24 07:58
    ddfreyne synchronize #1511
  • Oct 24 07:58

    ddfreyne on clonefile

    Refactor: Extract ItemRepWriter… Use clonefile for space efficie… (compare)

  • Oct 24 07:57

    ddfreyne on main

    Don’t use --initial-branch opti… Merge pull request #1512 from n… (compare)

  • Oct 24 07:57
    ddfreyne closed #1512
  • Oct 24 07:53
    ddfreyne opened #1512
  • Oct 24 07:51

    ddfreyne on upgrade-git-circleci

    (compare)

  • Oct 24 07:50

    ddfreyne on avoid-git-initial-branch

    Don’t use --initial-branch opti… (compare)

  • Oct 24 07:40

    ddfreyne on upgrade-git-circleci

    Use newer Git on CircleCI (compare)

  • Oct 24 07:36

    ddfreyne on upgrade-git-circleci

    Use newer Git on CircleCI (compare)

Denis Defreyne
@ddfreyne
I haven’t tried it and I think it might cause issues with cyclical dependencies
Daniel Aleksandersen
@da2x
I ended up cheating. I made a filter that removes the source map from the JS files, but writes it to a separate file, and then return the just the JS.
Gregory Pakosz
@gpakosz
I'm curious. What's your approach to JS source maps in the context of Nanoc?
Harald
@a4z
btw, I am deeply impressed by the live reload injection nanoc does, is this somewhere available as a stand alone thing?
( I have some slides with ascidoctor-revealjs and a rake file that rebulids on change, now I would like to have this live reload that nanoc has to reload the presentation in the browser)
Denis Defreyne
@ddfreyne
That is pretty much all done by https://github.com/johnbintz/rack-livereload!
@a4z You can also install the adsf and adsf-live gems, and then use the adsf --live-reload command to run a live-reloading web server, separately from Nanoc
Harald
@a4z
Thanks! will check adsf ,
want to put this into my rake file and replace my WEBrick call so the live reload script becomes injected,
do I understand that correct, just with using asdf-live + asdf I can remove my existing guard live reload rule ? An this becomes independent from the live reload browser extensions?
Daniel Aleksandersen
@da2x
@ddfreyne GitHub doesn’t let me open a pull request at the moment. do you want this patch? da2x/nanoc@7b81707 It implements copy-on-write reflink copying on Btrfs and XFS on Linux. Like a hardlink, except the files are dereferenced if either copies are modified. Requires my Linux-only reflink.gem, which is loaded optimistically. Falls back to old behaviour if the gem isn’t installed. It’s faster on Linux and mitigates the risky business of involving a hardlink. I’m not sure if this way of loading the gem makes it slower on other OSes, though.
Denis Defreyne
@ddfreyne
Ooh I love it — I will respond in the PR that you created on GitHub!
Denis Defreyne
@ddfreyne
I have no way of testing this out though… I used to have a BTRFS NAS, but it died (one of the hard drives made it crashloop, but no idea why)
Denis Defreyne
@ddfreyne
I fixed the tests on the main branch btw — a Rubocop upgrade broke it
Ian Young
@iay
If you have a way of running virtual machines, XFS is the default filesystem on RHEL/CentOS 7 and 8. If you get really stuck, I could give you an account on something here.
My upstream bandwidth is pretty sucky though (quite old domestic ADSL).
Denis Defreyne
@ddfreyne
Makes sense! I’ll give that a try
Denis Defreyne
@ddfreyne
I’m a bit short on time but going to try to get it up and running soon
Christian Tietze
@DivineDominion
Lovely to see that there's a gitter for nanoc, too 🎉
I'm starting with a question :) According to the docs, I'm under the impression that <%=link_to_unless_current("hello", "/.*")%> should link to the page root. I get <a href="/.*">, the literal link, instead. Am on the latest nanoc release and don't have legacy identifiers enabled 🤔
Christian Tietze
@DivineDominion
paths with trailing slashes work, e.g. <%=link_to_unless_current("hello", "/")%>, but only in the page content, not in the main menu partial (that itself invokes a ruby helper method to render the whole menu). I wonder if that's because @item is not available in the helper module to check the context?
Denis Defreyne
@ddfreyne

@DivineDominion Hey there! The second argument to link_to/link_to_unless_current is going to be exactly what ends up in the href attribute.

If you want to link to a specifc item, you can use e.g. <%= link_to 'Home', @items['/home.*'] %> — i.e. the second argument is the item you want to link to

Uh oh, I think the documentation might be wrong. Checking…
Yep, documentation is wrong — the docs say link_to_unless_current('Blog', '/blog.*') but that should be link_to_unless_current('Blog', @items['/blog.*'])
Denis Defreyne
@ddfreyne
Documentation updated!
Christian Tietze
@DivineDominion
ah I thought the documentation was more up to date than I was :)
Denis Defreyne
@ddfreyne
My bad! Looks like the incorrect documentation has survived for a while :see_no_evil:
Christian Tietze
@DivineDominion
@ddfreyne I am still not certain why the link_to_unless_current helper produces a span when I use it in e.g. overview/index.md and it's part of the content, but the same call won't work in the nav bar (default calls _navigation.erb.html which uses lib/helpers/menu.rb's render_menu). The code to link_to_unless_current is rather simple, too. My best guess would be that the partial is cached, but using puts @item.path + " -- " + @items["/overview.*"].path reveals that this line is called for each item indeed, and that the == comparison inside link_to_unless_current should be true. :/
Denis Defreyne
@ddfreyne
@DivineDominion Could it be that you have multiple item representations? Linking from one item representation to another representation of the same item will make link_to_unless_current return a link rather than a <span>
Christian Tietze
@DivineDominion
Thanks for the hint! I think I created the problem by using Struct.new(...) to represent menu item configurations, and have a render method inside, and call link_to_unless_current from there. @item_rep is nil there. I think this is because of the way use_helper includes the module itself (works from there), but not the module's inner Struct definitions
Denis Defreyne
@ddfreyne
@DivineDominion You can also pass items to the rendered layout, e.g. <%= render 'head', item: @item %>
Christian Tietze
@DivineDominion
Passing a reference to the helper again works; maybe I should reconsider the approach and only create the data structures in my helper, and render partials like you suggest for each item instead
I know I'm not a great help to the nanoc community myself even though I use it for what now, 7, 8 years? But there aren't very many people writing about their setup
Denis Defreyne
@ddfreyne
hehe no worries :) Glad to have you around!
Christian Tietze
@DivineDominion
How do y'all deal with sensitive information by the way? I wonder if I should put my nanoc.yml with the deploy rsync paths onto GitHub, for example. Or the path to an htpasswd file in my htaccess source.
Denis Defreyne
@ddfreyne
Hmmm, this is a bit of a tricky one. I wouldn’t consider deploy rsync paths to be sensitive (since they’d be protected anyway), and in the past I’ve put those in nanoc.yaml.
I have, though, created aliases for some hosts that were in nanoc.yaml, to create some obscurity… but it generally isn’t that useful
You could also use dotenv (https://github.com/bkeepers/dotenv) to load sensitive information
Den Sig
@xdeoniss_gitlab
Hi!
Christian Tietze
@DivineDominion
:wave:
Christian Tietze
@DivineDominion
@ddfreyne Experimented with the ENV approach. During compilation, nanoc skips files that would change whent he ENV variable changes -- their modification date is the same, though. Is there a way to mark files as dirty? 🤔
I could touch each file that includes an "ENV" in it, but that's kinda weird
Denis Defreyne
@ddfreyne

@DivineDominion Are you using the ENV variable directly in code? (e.g. <%= ENV['SOMETHING'] %>) That’ll not work because Nanoc does not track changes to ENV.

What you can do, is copy stuff from ENV to @config in the preprocessor, and then only use the stuff that you copied to @config.

Alternatively, if all you need is to switch between different environments, you can use the built-in environments support: https://nanoc.ws/doc/sites/#environments
@DivineDominion Here’s how nanoc.ws does it:
https://github.com/nanoc/nanoc.ws/blob/main/Rules#L5-L11
Daniel Aleksandersen
@da2x
Is there a way to mark files as dirty?
That depends on what types of files you're modifying. Layouts? Auxiliary libs? Content?
Christian Tietze
@DivineDominion
@da2x Content files in this case
Is the environment stuff "new"? I'm positive I went with ENV some 6 years ago because I found no other way. The environment stuff looks way better than what I have, though!
Christian Tietze
@DivineDominion
Does using @config check for changes to the value between compilation runs?
Denis Defreyne
@ddfreyne
Changes to @config are tracked indeed
@DivineDominion The Environment support was added in Nanoc 4.4 which is 2016 ^^