Where communities thrive


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

    denisdefreyne on main

    Restore compat with Ruby 3.1 T… (compare)

  • Nov 30 08:03
    denisdefreyne closed #1631
  • Nov 30 08:03
    denisdefreyne commented #1631
  • Nov 30 08:02

    denisdefreyne on main

    Update gems Fix Nokogiri incompatibility (compare)

  • Nov 30 08:00

    denisdefreyne on 4.12.13

    (compare)

  • Nov 30 08:00

    denisdefreyne on nanoc-cli-v4.12.13

    (compare)

  • Nov 30 08:00

    denisdefreyne on nanoc-core-v4.12.13

    (compare)

  • Nov 30 08:00

    denisdefreyne on main

    Set version to 4.12.13 Add release notes for 4.12.13 (compare)

  • Nov 29 21:26

    denisdefreyne on main

    Refactor: Remove ItemRepIgnorab… Refactor: Convert `prio_a` into… Add missing nil assertion in it… and 1 more (compare)

  • Nov 29 21:26

    denisdefreyne on prio-queue-cleanup

    (compare)

  • Nov 29 21:26
    denisdefreyne closed #1634
  • Nov 29 21:21
    denisdefreyne opened #1634
  • Nov 29 21:20

    denisdefreyne on prio-queue-cleanup

    Refactor: Remove ItemRepIgnorab… Refactor: Convert `prio_a` into… Add missing nil assertion in it… (compare)

  • Nov 29 21:18

    denisdefreyne on main

    Don’t let ItemRepPriorityQueue … Merge pull request #1633 from n… (compare)

  • Nov 29 21:18

    denisdefreyne on dont-yield-items-more-than-once

    (compare)

  • Nov 29 21:18
    denisdefreyne closed #1633
  • Nov 29 20:53
    sarahg commented #1631
  • Nov 29 19:35
    denisdefreyne commented #1631
  • Nov 29 19:29
    denisdefreyne synchronize #1633
  • Nov 29 19:29

    denisdefreyne on dont-yield-items-more-than-once

    Don’t let ItemRepPriorityQueue … (compare)

Christian Tietze
@DivineDominion
image.png
image.png
So maybe this will work:
/([0-9]+)\-([0-9]+)\-([0-9]+)\-([^\/]+)(\/index)?.md/
Christian Tietze
@DivineDominion
Achilleas Pipinellis
@axil_gitlab
@DivineDominion no, this is for local development. There's an an iframe in one of the pages and it only works with HTTPS, thus the need. I figured out how to do this using reverse proxy with NGINX, and mkcert providing the cert. There's probably an easier way with caddy, but I haven't tested.
Christian Tietze
@DivineDominion
Since I know how reverse proxying with nginx works, I also use that a lot for stuff like this :)
Beni Bilme
@benibilme_gitlab
I am a newbie. I am trying out nanoc. I have an asciidoctor file along with yaml file with the same name in the content directory called index.adoc and index.yml. index.yml consists of the metadata information of index.adoc. I receive following error while building the site. Nanoc::RuleDSL::Errors::NoMatchingCompilationRuleFound: No compilation rules were found for the “/index.yml” item.
yaml file is supposed to be processed by nanoc as far as I understand without needing a rule. What can I do for this?
Christian Tietze
@DivineDominion
@benibilme_gitlab nanoc has no trouble extracting YAML Frontmatter from files, i.e. YAML inside the same file at the beginning. So you have 1 file, index.adoc, with:
---
title: Your post title
more: [yaml, here]
---

(real content here
Gregory Pakosz
@gpakosz
Hello. What do you use to minify HTML nowadays?
Christian Tietze
@DivineDominion
I personally gzip on the server instead of minifying the HTML
Gregory Pakosz
@gpakosz
I see
Denis Defreyne
@denisdefreyne

Hey all! I’ve not been very active on Gitter, but I do recommend checking out the new GitHub discussions: https://github.com/nanoc/nanoc/discussions

There is also the mailing list as well: https://groups.google.com/g/nanoc

Harald
@a4z

I try to update my environment, since I used the same ruby + gem version for some years

now

nanoc live
nanoc: unknown command 'live'

why , I have the nanoc-live gem installed, what is missing?

Harald
@a4z
ah, I seem to have a mix match and miss understanding of running in docker and using bundler and the general setup ...
Harald
@a4z
I struggle to get a Docker container setup done where I can reuse a container for multiple/different projects
if anyone has such a container, and it's public, I will happily copy from it :-)
Christian Tietze
@DivineDominion
If you find one, please do share. I am still managing my own machine's gems etc. outside of containers like a caveman from the early 2000s
Denis Defreyne
@denisdefreyne
I don’t use Docker for development, at least on macOS — Docker for Mac is frighteningly slow (I’ve seen slowdowns of 30x to 50x)
Ian Young
@iay
The main place you see slowness with Docker Desktop for Mac is if you mount a location in the host filesystem into a container. You're essentially setting up a remoted file system in that case (remote to the Linux VM that the Docker runtime executes in if you're on a Mac) and although the speed of that did get better earlier this year and there are some tricks to make it much better by setting options on the mount, it can be excruciatingly slow if you just do it blind. If you avoid that, it can actually be a very fruitful development environment and in general you hardly notice any performance degradation.
Ruby can be a bit of a beast, though, and you can expect pretty eyewatering container images. The project I'm hacking on today hardly has anything in it and it's 927MB...
Denis Defreyne
@denisdefreyne
At work, I have a tool called dev for setting up development environments, and it’s wonderful. I want to open source it at some point…

dev.yml file:

up:
  - postgres:
      version: 14
  - redis
  - ruby
  - bundler
  - rails_db
  - homebrew:
    - overmind
    - pandoc

serve: overmind start -N

test:
  - bundle exec rspec
  - bundle exec rubocop

When you run dev up, it reads the Ruby version from .ruby-version, installs Ruby if it isn’t installed yet, installs the gems, installs Postgres (multiple versions can run simultaneously), creates a default database if necessary, etc.

dev serve runs the serve command, and dev test runs whatever you defined in test. It gives an unified interface to running and testing all projects.

I should really open source it :D
Ian Young
@iay
You really should :)
Denis Defreyne
@denisdefreyne
Supports node, npm and yarn too (supporting multiple versions too)
And sets up environment variables like POSTGRES_HOST, POSTGRES_PORT automatically.
It’s so good.
And I’m not just saying that because I wrote it!
Harald
@a4z

I used docker on gitlab to generate / deploy some sites for quite a while
now I wanted to modernize and have also the development in a container
I don't care if that is 0.5 sec faster or slower than without docker.

I have a asciidoctor-reveal container with a rake file that starts adsf with adsf-live and some simple guard , and I can mount my project into the container, and map 2 ports, start rake and do my presentation writing in VS Code and everything works, save, page updates in the browser, nice. No local installation required.

Wanted the same for my nanoc pages now, but there are some troubles
Not sure if I am going to continue on that, not now.
I invested already in the whole topic more spare time than I actually have,
but if there is ever something I can copy from, please let me know.

Harald
@a4z

Question more related to Ruby, or bundler

For the live extension, docs say

add the nanoc-live gem inside the nanoc group in your Gemfile:
(https://nanoc.app/doc/sites/#live-recompilation)

group 'nanoc' do
  gem 'nanoc-live'
end

Is this a different kind of group like such groups?
https://bundler.io/guides/groups.html

and could I have something like

group :nanoc, optional: true do
  gem 'nanoc', '~> 4.12'
end

group :nanoc-dev, optional: true do
  gem "webrick"
  group 'nanoc' do
      gem 'nanoc-live'
  end
end

in my Gemfile

Denis Defreyne
@denisdefreyne
@a4z The nanoc group is treated ever-so-slightly more special by Nanoc because the gems in there are auto-loaded by Nanoc. You can have other groups too, but those groups wouldn’t be auto-loaded.
Harald
@a4z
Could it be that this is the automagic that makes nanoc want to find a Gemfile when executed?
And that is what is not loading the dependencies when gems are installed into the system?
Harald
@a4z

And I wonder if nanoc does more than it should, given I have a group like

group :revealjs, optional: true do
  gem 'asciidoctor-revealjs'
  gem 'tilt', '~>2.0'
  gem 'slim', '~>4.0'
end

in the Gemfile, nanoc run live ends with asciidoctor-revealjs not installed error, which is true since it's not in the container

Harald
@a4z
ok, I have nanoc in the container running, and it detects changes and regenerates,
but I cant access is from the browser, I guess, that is because of View the site at http://127.0.0.1:3000/ , and I wonder how I can get View the site at http://0.0.0.0:3000/
I guess, live reload needs something similar
this is how I start adsf server via rake where it works to connect into the container (for the adoc revealjs site I have)
desc 'run ASDF to serve generated pages and Guard for auto generation
task :serve do
  # pid = fork do
  fork do
    options = {
      root: './public',
      live: true,
      index_filenames: %w[index.html],
      #host: '127.0.0.1',
      host: '0.0.0.0',
      port: 9090,
      handler: nil,
    }
    server = Adsf::Server.new(**options)

    %w[INT TERM].each do |s|
      Signal.trap(s) { server.stop }
    end

    server.run
  end
  Guard.start no_interactions: true
end
how can I have something similar for the nanoc live command?
Harald
@a4z

I found it, but it did not help ..

 # bundle exec nanoc live --host='0 0.0.0'
Listening for lib/ changes…
Compiling site…
View the site at http://0 0.0.0:3000/
[2022-11-13 22:07:57] INFO  WEBrick 1.7.0
[2022-11-13 22:07:57] INFO  ruby 3.1.2 (2022-04-12) [aarch64-linux-musl]
Site compiled in 0.54s.

Listening for site changes…

Captain! We’ve been hit!

SocketError: getaddrinfo: Try again

  0. /usr/local/lib/ruby/3.1.0/socket.rb:227:in `getaddrinfo'
  1. /usr/local/lib/ruby/3.1.0/socket.rb:227:in `foreach'
  2. /usr/local/lib/ruby/3.1.0/socket.rb:763:in `tcp_server_sockets'
  3. /usr/local/bundle/gems/webrick-1.7.0/lib/webrick/utils.rb:60:in `create_listeners'
  4. /usr/local/bundle/gems/webrick-1.7.0/lib/webrick/server.rb:130:in `listen'
  5. /usr/local/bundle/gems/webrick-1.7.0/lib/webrick/server.rb:111:in `initialize'
  6. /usr/local/bundle/gems/webrick-1.7.0/lib/webrick/httpserver.rb:47:in `initialize'
  7. /usr/local/bundle/gems/rack-2.2.4/lib/rack/handler/webrick.rb:38:in `new'
  8. /usr/local/bundle/gems/rack-2.2.4/lib/rack/handler/webrick.rb:38:in `run'
  9. /usr/local/bundle/gems/adsf-1.4.6/lib/adsf/server.rb:24:in `run'
  ... 2 lines omitted (see crash.log for details)

A detailed crash log has been written to ./crash.log.

:-(

Harald
@a4z
when I remove the Gemfile, nanoc view -L -o 0.0.0.0 works, to serve the page. But I lose the rebuild/reload ... so maybe something missign
Harald
@a4z
ok, up and running in container, via rake, guard-nanoc and adsf + adsf -livereload ,
setup by hand (not much handwork to do)
run my docker, mount some folder into it, start rake, edit and see the site .
now I can keep my envs even longer, as long as I can have my docker container, ruby and gems ... as long as it produces the HTML I need ...
Denis Defreyne
@denisdefreyne
Ah weird! I’m not sure what happened there but nanoc live should work just fine
@a4z In the original command you mentioned, you said bundle exec nanoc live --host='0 0.0.0' — the host is missing a . and has a (space) instead. Could that be the cause?
That would the SocketError: getaddrinfo error
Harald
@a4z
Oh, indeed, wow,
need to retry, guess that happens with working stressed in spare time
The no rebuild I reported earlier, can, btw, be caused by Rancher Desktop (which uses Moby for docker)
Found out that there seems to be some issue with Guard on it.
Not sure on wich box I was, I evaluate various environments, but with Moby it seems reproducible that Guard in not working on mounted volumes from the local filesystem (at least on a Mac)
Christian Tietze
@DivineDominion

FYI nanoc show-rules -h describes the command as:

nanoc show-rules [thing]

But when you pass any argument, you get an error that 0 args are expected

Denis Defreyne
@denisdefreyne
@a4z My personal recommendation is to use nanoc-live instead of guard-nanoc, and avoid using Docker if you can — I find that it avoids headaches!
@DivineDominion Will fix — there is not supposed to be an argument I believe
Christian Tietze
@DivineDominion
(would be nice if there were tbh)
Denis Defreyne
@denisdefreyne
I can’t disagree :D
Christian Tietze
@DivineDominion
Bookmarked this Webmentions tutorial for static sites. Has anyone integrated webmentions in their nanoc static site? https://mxb.dev/blog/using-webmentions-on-static-sites/