43 Commits

Author SHA1 Message Date
Mitch Nemirovsky
8f0bcd6875
Add documentation to "Navigation Structure" on collections and grouping pages (#1390)
Added link and short blurb about document collections to the navigation structure page, for quicker reference and suggestion during reading documentation.

Allows easier reference when trying to create page groups / categories without using a blank Parent page. Avoids automatically folded Parent page when Child pages are the necessary ones.
2023-12-18 09:58:09 -08:00
Matt Wang
dfe751e45b
docs: fix navigation structure header hierarchy, uniqueness (#1363)
This PR touches the "Navigation Structure" docs page, by:

- fixing the header hierarchy; we no longer jump from `h2` -> `h4`
    - this does technically result in a styling change, which I'm personally fine with. However, if we want to keep the old one, I can also do that!
- makes each header text unique, by annotating the "Example" with what the example is for
- adding a "New" label for the feature introduced in #1360

The main goal of this PR is to improve the accessibility of this docs page: the current generated markup will cause minor problems for screenreader users. If we like this change, I can then roll this out to the rest of the docs pages.
2023-10-05 10:13:39 -07:00
CarbonNeuron
33ba8d8eaa
Add configuration options for opening external links in new tab (#1360)
I've whipped up a solution that solves #1103. I've added a config option `nav_external_links_new_tab`, which is off by default. When turned on, it'll pop external nav links into a new tab. The idea was borrowed from how [aux_nav.html](https://github.com/just-the-docs/just-the-docs/blob/main/_includes/components/aux_nav.html) does it with `aux_links_new_tab`.

---------

Co-authored-by: Matt Wang <matt@matthewwang.me>
2023-10-04 12:10:56 -07:00
omahs
281839fa32
Fix docs typos (#1341) 2023-09-03 00:00:25 -07:00
Matthew Wang
dd1e80ae1c
Prep for v0.4.0: changelog, docs, gemspec bump 2023-02-05 16:20:14 -08:00
Matt Wang
5f91e326c7
docs: label new features introduced in v0.4 (#1138)
In #1058, I noted:

> Tangentially related work:
> ...
> - better annotate new features (motivated by writing these docs)
>     - we should add "New" to new features :) 
>     - we should note when a feature was introduced (I think this is a core part of most software documentation)
>     - we should annotate things that are "Advanced" in so far as the average Just the Docs user will not use them / they require significant Jekyll knowledge
> 

This came up again in https://github.com/just-the-docs/just-the-docs/discussions/1136#discussioncomment-4716253, so I think it's best for us to resolve this sooner rather than later.

This PR is me doing that. I:

- have added a headings-level "New" label to every new heading introduced since `v0.3`
- added, when possible, inline YAML comments when new configuration options have been introduced

I did this by scanning through the CHANGELOG and selecting each feature that is either tagged with `Add` and has documentation.

I may have also missed any new features, so some double-checking would be helpful!
2023-01-29 17:48:22 -08:00
Matt Wang
a789198b20
docs: fix broken relative page links (#1106)
In touching up the migration guide, I noticed that many of our documentation site links are broken! For example, on the homepage, this link:

<img width="782" alt="screenshot of homepage; code snippet is in next block" src="https://user-images.githubusercontent.com/14893287/210462690-31aa7bf5-dd79-4e8f-a3c5-1213e73771c4.png">

which has the following href

```code
<a href="/just-the-docs/just-the-docs/CHANGELOG/">the CHANGELOG</a>
```

duplicates the `baseurl` twice. There are 14 such broken links across the site. Each link duplicates the `baseurl` and `link` tags, which has since been resolved with links being relative by default (there's a set of PRs that document this - I can't find the exact paper trail right now).

To resolve this, I:

- find and replace site-wide `{{ site.baseurl }}{% link` with `{% link`
- tested each link, which now works properly locally *and* on the deploy preview

I'm surprised we didn't catch this earlier! I also could be missing something else, in which case feedback on this PR is certainly welcome.
2023-01-13 15:56:05 -08:00
John Mertic
7c3936a55d
add reversed, deprecate desc for nav child_nav_order (#1061)
* Add 'reversed' as the preferred keyword, with 'desc' as a deprecated alternate

* Doc updates

* Add the test for 'reversed' to the toc_list

Add also a comment about this.

Co-authored-by: Peter Mosses <18308236+pdmosses@users.noreply.github.com>
2022-12-17 07:21:42 -08:00
Peter Mosses
6d9d41359c
Fix duplicated external links in collections (#1001)
Fix external links and collections

The navigation should only display the external links once, after the links to pages that are not in collections.

The test for PR #876 at https://just-the-docs.github.io/just-the-docs-tests/navigation/external-links fails with v0.4.0.rc3,
and succeeds when the updated `nav.html` is added locally.

The docs need updating to clarify how the interaction between the collections feature and the external links feature is resolved.
2022-10-14 13:08:42 -07:00
Matt Wang
b4b951fe5d
Experimental nav optimization for simple cases (#992)
* Optimize simple navigation cases

Fix inefficiency reported in feedback on v0.4.0.rc2 (see discussion #958).

This PR:

* essentially reverts `_includes/nav.html` to v0.4.0.rc1
* preserves the ARIA labels added by #950
* adds a test to optimize builds of sites that rely on `title` fields to order pages.

Building the `endoflife.date` site (130 pages) now takes only about 7 seconds.

Building the `machinetranslate.org` site ( 350 pages) takes about 7 minutes. (Without the added test, it takes just over 5 minutes: the condition of the test is merely to compare the size of two arrays, but that is apparently enough to prevent Jekyll from applying some optimization).

A warning is added to the docs about the need for numbers to be in quotes when used as title values.

* Update navigation-structure.md

A clarification is added to the docs about the need for numbers to be in quotes when used as title values.

* Simplify the control and data flow

- Defer concatenation of `string_order_pages` with `title_order_pages` until needed.
- Replace tests on size with tests for `empty`.
- Rename variables accordingly.

* Fix child nav order

This PR started from the navigation in RC1. Some cosmetic improvements had been made in RC2. This commit adds some of those changes to this PR.

It also fixes a bug (revealed by a new regression test) due to a reference to `node.child_nav_order` instead of `child.child_nav_order`, which prevented reversal of the order in children of children. Presumably a top-level reversal should apply only to direct children, and not to grandchildren. The latter interpretation would be very confusing in a deep multi-level hierarchy.

* Allow pages with numeric titles

An omitted `nav_order` value should default to the `title` value, regardless of its type. Jekyll 3 gives build errors when numbers and strings are sorted together. This commit drops the assumption that `title` values are always strings – a 404 page naturally has a numeric title. It updates the docs page accordingly.

The extra code does not affect the build time for the `endoflife.date` site (7 seconds). For the `machinetranslate` site, changing the title of the 404 page to a number increases the build time from 7 minutes to 9 minutes – the `nav_order` numbers on that site are program-generated in the range 1..1000, which might be atypical.

This commit has not yet been checked using the regression tests.

The gemspec used for testing specifies `spec.add_runtime_dependency "jekyll", "~> 3.8.5"`, and `Gemfile.lock` shows `jekyll (3.8.7)`.

* Update nav.html

Add comment about an optimization that will be possible in Jekyll 4.

* Update nav.html

- Update the comment about optimization possibility.
- TEMPORARILY add Jekyll 3 code for conditionally optimizing.

* Update nav.html

Minor improvements and cosmetic changes.

* Major revision

This update is based on extensive experimentation and profiling with alternative versions of the Liquid code used to build the main navigation panel.

Due to the fragility of Jekyll's optimizations, combining alternative approaches with conditionals turned out to be too expensive: merely adding a condition to check whether some array of pages is empty can add about 20% to the build time!

The current code avoids sorting pages on `nav_order` and `title` fields together. The standard way of doing that in Jekyll is to use the `group_by` filter; but extracting the sorted pages from the groups turned out to be too inefficient (as seen in RC1), as was generating links directly from the groups (in RC2).

Making all pages with `nav_order` values come before all those ordered by their `title` values is not ideal (it doesn't support tweaking the relative order of two pages in a list of pages ordered by their titles) but it appears to be necessary for efficient builds on large sites.

This version has not yet been fully tested for regression, but otherwise seems to give the expected navigation on the endoflife.date and machinetranslate websites. (I'm unable to install the Python-based how2data repository on my laptop, due to package version issues on Apple silicon).

Co-authored-by: Peter Mosses <18308236+pdmosses@users.noreply.github.com>
2022-10-09 17:48:06 -07:00
Matt Wang
b00867a831
Fixes missing code fence in navigation structure docs (#906)
Closes #899 (or at least, the immediate concern).
2022-08-01 11:13:51 -07:00
SPGoding
009a0f9c5a
Support external navigation links (#876)
Based on #238, resolves #66.
2022-07-12 22:24:54 -07:00
John Mertic
6287d8a6da
Add 'child_nav_order' front matter to be able to sort navigation pages in reverse (#726)
Set `child_nav_order` to `desc` to reverse the sort order for a child section.

Co-authored-by: Matt Wang <matt@matthewwang.me>
2022-07-04 12:27:20 -07:00
Henry Schreiner
c68a19b906
docs: fix spacing in toc example (#835)
As is, this is invalid and will not cause the TOC to be rendered. The collapsing example is fine.

Co-authored-by: Matt Wang <matt@matthewwang.me>
Co-authored-by: Peter Mosses <18308236+pdmosses@users.noreply.github.com>
2022-07-04 12:23:47 -07:00
Peter Mosses
70b34f01f7
Combination (#578)
This PR combines (and resolves conflicts between) #448, #463, #466, #494, #495, #496, #498, and #572. 

The main aim is to facilitate use of several of the implemented features _together_, when using the fork as a remote theme. It should also simplify merging the included PRs into a future release.

The branch [combination-rec-nav](https://github.com/pdmosses/just-the-docs/tree/combination-rec-nav) adds [multi-level navigation](https://github.com/pmarsceill/just-the-docs/pull/462) and (NEW:) [sibling links](https://github.com/pmarsceill/just-the-docs/pull/394) to the branch used for this PR. It includes updated [documentation for the navigation structure](https://pdmosses.github.io/just-the-docs/docs/navigation-structure/), and reorganised and extended [navigation tests](https://pdmosses.github.io/just-the-docs/tests/navigation/). The documentation and the tests can be browsed at the (temporary) [website published from the combination-rec-nav branch](https://pdmosses.github.io/just-the-docs/).

_Caveat:_ The changes to v0.3.3 in this PR and #462 have not yet been reviewed or approved, and may need updating before merging into a release of the theme. If you use a branch from a PR as a remote theme, there is a risk of such updates affecting your website. Moreover, these branches are likely to be deleted after they have been merged. To avoid  such problems, you could copy the branch that you want to use to your own fork of the theme.

Co-authored-by: Matt Wang <matt@matthewwang.me>
2022-07-04 12:15:10 -07:00
Patrick Marsceill
2aa9815064 Update to new repo path 2022-03-03 18:50:33 +00:00
PLanCompS
09ab1c3131 List children also when excluded from main navigation
- Limit the effect of `nav_exclude: true` to the main navigation.
- Include links to excluded pages in auto-generating lists of child pages
and in breadcrumbs.
- Refactor implementation by moving assignment of `first_level_url` and `second_level_url` from `_includes/nav.html` to `_layouts/default.html`.
- Clarify the effect of `nav_exclude` in the documentation.
2020-09-28 17:06:06 +02:00
PLanCompS
ddccec7bb7 Update navigation-structure.md
Reinstated the collapsible TOC at the top, to support the reference to it right at the end of the file. (The `TOC` feature can only be used once per page, so this is the only way of illustrating the rendering of the collapsible TOC in the docs.)
2020-09-11 18:57:57 +02:00
PLanCompS
591a3c2351 Update navigation-structure.md
Clarifications
2020-08-13 16:48:45 +02:00
PLanCompS
cff0254d93 Update navigation-structure.md
Adjusted the documentation to explain how mixtures of numbers and strings are treated by `nav_order`.
2020-08-11 20:47:22 +02:00
Patrick Marsceill
1bdd849d86
Update navigation-structure.md 2020-06-30 13:58:26 -04:00
Patrick Marsceill
845261205f
Make cursor pointer, update docs, and add heading 2020-06-30 13:03:17 -04:00
Patrick Marsceill
c8bbcc2d9b
Merge branch 'collapsible-toc' of git://github.com/pdmosses/just-the-docs into pdmosses-collapsible-toc 2020-06-30 12:54:51 -04:00
PLanCompS
e40ba9c6c5 Update documentation with collapsible TOC
Makes the TOC at the top of the page collapsible.
Adds an explanation of the markup used to produce a collapsible TOC.
Adds a comment about the possibility of using an unordered list for the TOC,
and about using TOC only once per page.
2020-05-02 14:39:31 +02:00
Patrick Marsceill
ff5047e523
Fix outdated docs
closes #266
2020-05-01 14:55:40 -04:00
Peter Mosses
561f930e83
Update navigation-structure.md
Deleted a spurious line from a previous version.
2020-04-28 17:33:59 +02:00
Patrick Marsceill
41a74d247d
Update docs/navigation-structure.md
Co-Authored-By: Peter Mosses <18308236+pdmosses@users.noreply.github.com>
2020-04-28 10:58:07 -04:00
PLanCompS
c46ccd3484 Made case-insenstive sorting the default
Added a configuration option to determine whether the sort order is case-sensitive.
The default is case-insensitive.

To test:
- open `/just-the-docs/docs/utilities/` in the browser,
  and check that the navigation links in `Utilities` are sorted alphabetically;
- in `docs/utilities/layout.md', change the preamble to `title: layout`,
  and check that the  links in `Utilities` are still sorted alphabetically;
- add `nav_sort: case_sensitive` in the configuration file,
  and check that the link to `layout` is now listed last under `Utilities`.
2020-04-25 14:53:45 +02:00
Peter Mosses
06853e895a Update navigation-structure.md
Added documentation of default nav order.
2019-10-11 23:02:19 +01:00
Manu
de37d60720 Recommend using index.md as parent page for sections
Using `index.md` as name for the parent page within a section allows lazy developers
to skip defining `permalink`. This is already working and this PR just updates the documentation.
2019-08-15 09:38:44 +08:00
EricFromCanada
71ba32e131 Additional text fixes 2019-01-15 20:48:48 -05:00
EricFromCanada
ae5bcfe361 Fix grammar and capitalization 2019-01-14 14:43:29 -05:00
EricFromCanada
ff49d02f83 Make spacing consistent 2019-01-14 14:43:16 -05:00
Patrick Marsceill
d5d1ddbd92
Docs update 2018-12-16 15:27:25 -05:00
Patrick Marsceill
555dfae410
Make TOC on parent pages optional 2018-12-16 14:27:44 -05:00
Patrick Marsceill
c20129c32c
update docs for nav / page strucutre 2018-11-19 16:26:22 -05:00
Patrick Marsceill
dac6e45451
Update docs 2018-11-19 13:50:54 -05:00
Patrick Marsceill
4814fbce64
Content cleanup 2018-11-16 14:55:20 -05:00
Patrick Marsceill
379a976387
Add docs for nav exclude 2018-11-16 13:57:49 -05:00
Patrick Marsceill
e41c1701a5
Bump nav order for new docs 2018-11-16 11:47:14 -05:00
Patrick Marsceill
f7da9a9dd9
final shit for release 2017-04-08 18:51:14 -04:00
Patrick Marsceill
e581397758
Initial commit 2017-03-26 21:09:19 -04:00
Patrick Marsceill
594385ae7b
initial commit 2017-03-24 09:47:37 -04:00