Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Fixed landing page to use page names #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

j0yu
Copy link

@j0yu j0yu commented Jun 7, 2019

⚠️ Will probably break existing YAMLs using target: ⚠️

Changed to fetch URL based off page name (using similar code found in nav_entry.html)

This PR partly fixes the issue in tk-doc-generator landing page where clicking on the tiles will go to invalid pages.

The 'target: ./some-page' in the landing_page.yml do not point ot UID URLs, hence
shotgunsoftware/developer.shotgunsoftware.com#80

I replaced target: with page: to make the syntax more similar to toc.yml, but this will break any existing links (if it is not broken already)

j0yu pushed a commit to wwfxuk/just-the-docs that referenced this pull request Jun 7, 2019
@j0yu j0yu mentioned this pull request Jun 11, 2019
@manneohrstrom
Copy link

Hi Joe! I am looking at your PRs now. Looks like shotgunsoftware/developer.shotgunsoftware.com#80 already solves this in a reasonably pragmatic way. What added value (aside from readability when configuring index pages) does this change give? Given that you can already just grab a url link for a page and plug it into the config, i think we might hold off merging this for the time being.

@j0yu
Copy link
Author

j0yu commented Jun 26, 2019

@manneohrstrom Hello Manne!

What added value (aside from readability when configuring index pages) does this change give?

  1. Not having to pre-generate hashed URL for page before copying it back into page source
  2. Making learning how to write docs for tk-doc-generator easier with similar page: <pagename> keys/values

I added this to make page linking easier and uniform for both TOC and landing page.
We're testing it out for our tk-doc-generator docs in our own PR.

If I understand correctly, previously (like in shotgunsoftware/developer.shotgunsoftware.com#80) it seems like a 2 step process of:

  1. Generate the page to figure out the hashed URL
  2. Paste the hashed URL back in the page source, re-generate so the links work

I wondered if it can be simplified, i.e. just specify the page name like in TOC and generate once and have it linked correctly the first time.

Turns out, landing page was using a different href liquid template than TOC's href liquid template.

  • The landing page href uses tile.target as is
  • The TOC's href finds the pagename to then grab it's hashed url from site.pages

The TOC's logic seems to link it correctly right so this PR basically just copies over TOC's href liquid template.

Now. specifying pages in TOCs and landing pages are more similar, hopefully making learning how to write docs for tk-doc-generator easier:

  • TOC
- caption: authoring
  children:
  - page: authoring
  - page: authoring-markdown
  • Landing Page
tiles:
- name: integrating
  image: ./images/landing-page/dev_icon.png
  page: installation-integrating

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants