Giter Club home page Giter Club logo

Comments (6)

owenh000 avatar owenh000 commented on September 24, 2024

Hi @************, thanks for the suggestion. However, it seems like this is more a problem of URL rewriting than HTML generation (specific to GitHub Pages).

Will GitHub Pages will automatically redirect from /_h2.html to /_h2?

# Generate output
asciidoctor -r asciidoctor-multipage -b multipage_html5 -D out/tmp tmp.adoc

# Only needed if GitHub Pages does *not* redirect from `/_h2.html` to `/_h2`
sed -E -i 's/(<a href="[^"]+).html">/\1">/g' out/tmp/*.html

# Remove .html extensions
rename 's/\.html$//' out/tmp/*.html

Does that help?

from asciidoctor-multipage.

************ avatar ************ commented on September 24, 2024

Hi @************, thanks for the suggestion. However, it seems like this is more a problem of URL rewriting than HTML generation (specific to GitHub Pages).

Will GitHub Pages will automatically redirect from /_h2.html to /_h2?

It does no redirectt, e.g.: https://************.com/china-************/about.html

# Generate output
asciidoctor -r asciidoctor-multipage -b multipage_html5 -D out/tmp tmp.adoc

# Only needed if GitHub Pages does *not* redirect from `/_h2.html` to `/_h2`
sed -E -i 's/(<a href="[^"]+).html">/\1">/g' out/tmp/*.html

# Remove .html extensions
rename 's/\.html$//' out/tmp/*.html

Does that help?

Sure, but haxx :-)

from asciidoctor-multipage.

owenh000 avatar owenh000 commented on September 24, 2024

There is some related discussion about this in issue #26.

The asciidoctor-multipage extension handles writing of all files excluding the main root page, so it seems like it would be trivial to remove the .html extension from those output files. However, because Asciidoctor handles writing of the main output file it may not be possible to change the filename used for that file.

However, it may be possible to implement this as follows:

  1. Support use of the Asciidoctor --out-file option as discussed in issue #26.
  2. Add a multipage-omit-extensions document attribute for omitting the .html extension from non-root output files.
  3. Execute Asciidoctor with the --out-file option set to an output path with no .html extension.

from asciidoctor-multipage.

jesustorresdev avatar jesustorresdev commented on September 24, 2024

May be it's related to jekyll and how jekyll treats files with underscore?

There is here a similar issue in other project:

mpetrovich/stylemark#65

The suggested solution is to add .nojekyll to the root directory. It's what I did in my Github pages.

from asciidoctor-multipage.

************ avatar ************ commented on September 24, 2024

May be it's related to jekyll and how jekyll treats files with underscore?

There is here a similar issue in other project:

mpetrovich/stylemark#65

The suggested solution is to add .nojekyll to the root directory. It's what I did in my Github pages.

I don't think it has anything to do with Jekyll. Basically, asciidoctor-multipage produces <a href="child-id.html"> and I want it to produce <a href="child-id"> instead. Both child-id.html and child-id work, but I want the one without .html which looks nicer.

from asciidoctor-multipage.

jesustorresdev avatar jesustorresdev commented on September 24, 2024

Sorry. I think you have a problem with underscore html files (I did), but I already saw what you think is uglier.

from asciidoctor-multipage.

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.