Giter Site home page Giter Site logo

Comments (8)

peaceiris avatar peaceiris commented on May 18, 2024 2

I reopened this for updating the README.

@reitzig Could you review this pull-request? reitzig/today-i-learned#1

from actions-hugo.

peaceiris avatar peaceiris commented on May 18, 2024 1

Did you try the following?

- run: sudo gem install asciidoctor

Also we can use the apt or bundle to install asciidoctor.

from actions-hugo.

reitzig avatar reitzig commented on May 18, 2024 1

Heh, got it. For the benefit of googlers:

  - name: Setup asciidoctor
    run: |
      sudo gem update --system 3.0.6
      sudo gem install asciidoctor
      sudo .github/scripts/reroute_asciidoctor.sh
      ruby --version; gem --version; asciidoctor --version

With this as .github/scripts/reroute_asciidoctor.sh:

#!/bin/bash

set -eu

binary="$(which asciidoctor)"
binary_orig="${binary}"_orig

if [[ -L "${binary}" ]]; then
    echo "Can not handle links yet"
    exit 1
fi

mv "${binary}" "${binary_orig}"

cat > "${binary}" <<BASH
#!/bin/bash

"${binary_orig}" \
    --attribute=experimental=true \
    --attribute=icons=font \
    "\$@"
BASH
chmod +x "${binary}"

echo "Updated '${binary}' to call '${binary_orig}' with extra parameters."

I guess it's easy to pull out the extra parameters so they appear in the workflow YAML instead, but not tonight. :'D

from actions-hugo.

peaceiris avatar peaceiris commented on May 18, 2024 1

We are going to add a new section under Tips - README.md like the section for autoprefixer and postcss-cli. If you will work on this, I'll gladly merge it.

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'

      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.7

      - run: gem install asciidoctor
      - run: |
          alias asciidoctor="asciidoctor --attribute=experimental=true --attribute=icons=font"
          hugo --minify

from actions-hugo.

reitzig avatar reitzig commented on May 18, 2024 1

Just to point out the alternative here: https://github.com/reitzig/actions-asciidoctor

from actions-hugo.

reitzig avatar reitzig commented on May 18, 2024

Ah, now I understand the difference between a Docker-based action and one like yours a little bit better, I think. Thank you!

That seems to work -- basically. asciidoctor in the 18.04 repos is ancient, so gem it is, with a twist:

- name: Setup asciidoctor
        run: |
          sudo gem update --system 3.0.6 # cf. https://github.com/rubygems/rubygems/issues/3068#issuecomment-574775885
          ruby --version
          gem --version
          sudo gem install asciidoctor

This runs for a full minute... T_T

Unfortunately, my workaround for Hugo's ... clumsy handling of external tools doesn't seem to work on Github Actions. 🤔 Tinker tinker...

Update: Ah, I was being an idiot, I think. As my own README reminds me 🤦‍♂️ you have to add the working directory to PATH for that workaround to work.

from actions-hugo.

reitzig avatar reitzig commented on May 18, 2024

Very cool, thanks for your efforts!

Which change of the README do you have an in mind? Do you need me to do something?

I feel like doing this -- adding asciidoctor to a hugo setup, specifically, with workarounds -- could be a dedicated action. I'd be happy to collaborate!

from actions-hugo.

github-actions avatar github-actions commented on May 18, 2024

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

from actions-hugo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.