-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to generate ToC child links without the .html extension for servers like GitHub pages that automatically remove those extension #21
Comments
Hi @cirosantilli, 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 # 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? |
It does no redirectt, e.g.: https://cirosantilli.com/china-dictatorship/about.html
Sure, but haxx :-) |
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 However, it may be possible to implement this as follows:
|
May be it's related to jekyll and how jekyll treats files with underscore? There is here a similar issue in other project: 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, |
Sorry. I think you have a problem with underscore html files (I did), but I already saw what you think is uglier. |
Sed hack: https://github.com/cirosantilli/china-dictatorship/blob/0cfdaf75c5a6032c9ad4525e827e84b9d680b081/push#L25
Gemfile
tmp.adoc
Build:
Default outcome:
out/tmp/tmp.html
contains a link to_h2.html
, which works fine in the local filesystem.However, when pushing that output e.g. to GitHub pages, I would like the link instead to be just to
_h2
instead of_h2.html
.Both
_h2
and_h2.html
work on that server, but the.html
one is just uglier.Maybe we can have a:
to remove it.
The text was updated successfully, but these errors were encountered: