Skip to content
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

baseurl not prepended to links/resources for sites not deployed at root of a domain #73

Open
capsulecorplab opened this issue Aug 15, 2021 · 10 comments

Comments

@capsulecorplab
Copy link
Contributor

capsulecorplab commented Aug 15, 2021

I've tried running a local build of the asciidocsy theme via a docker image running ruby v2.6 & bundler v2.2.15, but can't seem to get it to properly render. (see option 1 on capsulecorplab/asciidoctor-docker#3 (comment))
Screenshot from 2021-08-15 07-56-15

Otherwise, the local Jekyll server seems to work fine

@capsulecorplab capsulecorplab changed the title local build not work local build not rendering properly Aug 15, 2021
@briandominick
Copy link
Contributor

Sean from what I can see you have not modified the baseurl property in _config.yml, though I thought you said you had? I'm looking at https://github.com/capsulecorplab/asciidocsy-jekyll-theme/blob/main/_config.yml -- I would expect to see baseurl: asciidocsy-jekyll-theme in the build, so the browser will know where to find assets.

I am able to reproduce and fix this locally as such, but it for some reasons requires a trailing slash on the base URL. I have sniffed around a little and not discovered a way to address this issue without controling your webserver (as you obviously don't with GH Pages).

I think this doesn't really resolve your main problem, though, which is that you want to skip the landing page. Unfortunately, the AsciiDocsy Docs/Demo site itself has URLs hard-coded all over the place that use the domain-root reference /some/path -- all the permalinks are written that way, so the docs site itself won't serve the way you want it to unless you rewrite those.

That said, if you make your own site with your own permalinks and xrefs, this will still work. You just have to include your baseurl in your paths.

@capsulecorplab
Copy link
Contributor Author

@briandominick Just pushed a commit with the baseurl set to asciidocsy-jekyll-theme, but it's still having issues properly rendering the page
Screenshot from 2021-08-15 16-00-47

I don't mind dealing with a landing page for now, just not sure how to debug this rendering issue.

@briandominick
Copy link
Contributor

Sorry I forgot to tell you to prepend the slash:

baseurl: /asciidocsy-jekyll-theme

@capsulecorplab
Copy link
Contributor Author

@capsulecorplab
Copy link
Contributor Author

Closing issue, since I'd consider this resolved!

@capsulecorplab
Copy link
Contributor Author

I spoke too soon. Some of the links and assets aren't recognizing the baseurl, s.a, the Documentation link

@briandominick
Copy link
Contributor

Yeah like I said those links are hard coded. The demo site is only supposed to serve at a domain root, but you can write your links differently.

Which assets are still broken. Images inside content?

@capsulecorplab
Copy link
Contributor Author

I haven't checked every page, but here are a few of the assets that were missing
Screenshot from 2021-08-16 15-21-10
Screenshot from 2021-08-16 15-20-57
Screenshot from 2021-08-16 15-19-28

@capsulecorplab
Copy link
Contributor Author

How should one go about writing the links differently, such that the baseurl becomes part of the links?

@briandominick
Copy link
Contributor

To resolve this you'd need to edit the value of site.asciidoctor.attributes.imagesdir and site.asciidoctor.attributes.includedir in the _config.yml file.

For links, I guess you'd need to replace every instance of <</some/path,...>> with <</asciidocsy-jekyll-theme/some/path,...>>. These (xrefs) are a pretty significant limit, but I have ways of making them far more powerful (see #66).

The manifest.yml file is the other place these are defined. I think this issue is the same across SSGs, including all AsciiDoc SSGs, as we don't have docinfo for all the other pages at the time of build. My framework coming out later this year addresses this, but for now, and as the lowest common denominator for this theme, I am relying on static xrefs and menus driven by static data.

@capsulecorplab capsulecorplab changed the title local build not rendering properly baseurl not appended to links/resources for sites not deployed at root of a domain Aug 30, 2021
@capsulecorplab capsulecorplab changed the title baseurl not appended to links/resources for sites not deployed at root of a domain baseurl not prepended to links/resources for sites not deployed at root of a domain Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants