Skip to content

Markdown toc for style guide #849

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

Merged
merged 2 commits into from
Aug 8, 2017
Merged

Markdown toc for style guide #849

merged 2 commits into from
Aug 8, 2017

Conversation

ashawley
Copy link
Member

@ashawley ashawley commented Aug 7, 2017

Doesn't look like there was a reason for the table of contents to be in HTML, so simplify? It renders the same.

@heathermiller
Copy link
Member

Can we please keep the {{ site.baseurl }}? Since this is not on GitHub pages, relative linking is sometimes broken.

Plus, if we ever want to post a version of the site for people to comment on ever again (like I did here: http://lampwww.epfl.ch/~hmiller/new-docsite) we need the absolute paths so the site can be placed in a subdirectory and for links to still work.

(Not having {{ site.baseurl }} all over the place was the reason so many links were broken in the above temp site)

@ashawley
Copy link
Member Author

ashawley commented Aug 7, 2017

Ah, ok, that's good to know. I noticed a lot of the site was using relative linking, so I assumed it was ok. I'm surprised Jekyll doesn't DTRT with links in markdown here by inserting site.baseurl in relative links... :-P

@heathermiller
Copy link
Member

Yeah, it's a super confusing situation.

In the _data files (.yml), we can't use site variables, so we've got to use relative linking, which usually works (but not always). So that's where you might be seeing a bunch of relative links when you look around.

Anywhere else though, such as in markdown files or CSS/JS (with empty --- --- as their frontmatter), we can and should do the {{ site.baseurl }} thing. ...Hopefully Jekyll will one day get a bit smarter about linking.

I actually looked around for a link analyzing plugin for Jekyll to insert the stupid {{ site.baseurl }} thing but couldn't find anything that worked. (I almost wrote a plugin myself, but stopped myself...)

@ashawley
Copy link
Member Author

ashawley commented Aug 7, 2017

I'm so confused. I'm looking at the links on this page http://lampwww.epfl.ch/~hmiller/new-docsite/tour/tour-of-scala.html

When I click on the first link, I got to http://lampwww.epfl.ch/~hmiller/new-docsite/unified-types.html

That's totally broken. I can confirm that. The /tour part of the URL was dropped. However, it should have worked. The markup was:

<a href="unified-types.html">every value is an object</a>

Is there some Javascript on the site interacting with links? When I disable Javascript, the link works. What???

@heathermiller
Copy link
Member

Yeah, on that site there's JavaScript fixing relative linking problems. ...In that case, the JavaScript broke things more than it fixed them.

Though most other links wouldn't work w/out the JS futzing.

@ashawley
Copy link
Member Author

ashawley commented Aug 7, 2017

Ah, ok. That makes me feel a little more sane.

So, without the JS futzing, won't the links on this page work fine then?

@heathermiller
Copy link
Member

heathermiller commented Aug 7, 2017

Yep, they should. (This is one case where relative linking actually works 🙄)

@heathermiller
Copy link
Member

Merci! ❤️

@heathermiller heathermiller merged commit d8be0f4 into scala:master Aug 8, 2017
@ashawley ashawley deleted the style-toc-markdown branch August 8, 2017 12:59
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

Successfully merging this pull request may close these issues.

2 participants