186 Commits

Author SHA1 Message Date
Peter Mosses
7cabda2983
Restore simple configuration of favicon.ico (#1095)
Avoid the need to add a link to favicon,ico when editing `_includes/head_custom.html`, and avoid creating an invalid favicon link

- Remove the content of `_includes/head_custom.html`
- Add code to `_includes/head.html` to create a link to an existing favicon,ico
- Add an explanation of favicon_ico to docs/configuration.md
- Remove the example of `includes/head_custom.html` and add an explanation of what the `<head>` element automatically includes
2022-12-27 13:09:47 -08:00
Matt Wang
91449f1aee
docs: fix two bugs in "Customization" (custom favicon, new annotation) (#1090)
Fix two bugs in customization docs

- custom favicon docs were not wrapped in `{% raw %}` tags
- the "new" annotation for color schemes had an extra whitespace, and so the CSS class was not applied
2022-12-27 09:41:41 -08:00
Flo
0b44f5ba7f
docs(collections): Add warning about mandatory _-prefix (#1091)
* docs(collections): Add warning about mandatory `_`-prefix

* Apply recommended wording
2022-12-27 17:56:44 +01:00
Simone
ce3f34bbc7
Add copy code button to code snippets (#945)
Hello everyone, this is my implementation for the copy button on the snippet (requested in #924)

The implementation is made 100% javascript as with or without a jekyll template modification you still have to execute some javascript code, and I consider it the best choice.

the button only appears if the mouse is over it, to allow the entire line to be read

the important CSS changes were made to make the copy button work even in the long code situation:


![image](https://user-images.githubusercontent.com/26844016/187731472-d4bf7828-2356-4d94-9c2d-9db863228f5f.png)

to avoid this:

![image](https://user-images.githubusercontent.com/26844016/183292313-d7f73d7d-58c0-4c7b-b5ba-e08bd285514b.png)

Co-authored-by: Matt Wang <matt@matthewwang.me>
2022-12-26 16:45:37 -08:00
Michelle Blanchette
9bccf07faa
analytics: support multiple tracking IDs, document UA -> GA4 switch (#1029)
* Issue #1023 - note that GA4 properties are supported

* Issue #1023 - parameterize Google Analytics property script

* Issue #1023 - support a list of multiple Google Analytics tracking IDs in config

* Issue #1023 - update Google Analytics configuration doc

* Fix configuration of multiple Google Analytics properties and simplify type checking

* simplify unnecessary code repetition

* tweak Google Analytics config documentation wording
2022-12-17 23:43:55 -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
Matt Wang
845cd763f3
Removes favicon.html, shifts content to head_custom.html (#1027)
* Removes `favicon.html`, shifts content to `head_custom.html`
* explicit callout for custom favicon in customization docs
* Cleaner and more consistent documentation (review from @pdmosses)

Co-authored-by: Peter Mosses <18308236+pdmosses@users.noreply.github.com>
2022-12-13 11:21:20 -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
Peter Mosses
33a7b2ac28
Fix default highlighting in custom color schemes (#986)
* Fix default highlighting in custom schemes

Fix #982

The variable settings for highlighting in the default `light` scheme are currently (v0.4.0.rc2`) in `_sass/color_schemes/light.scss`.
This PR ensures that custom schemes are based on the `light` scheme.

It also adds a note explaining the default to the customization docs,
and gives an example of how to define a custom scheme based on the `dark` scheme

* Prettier

* Deleted test file

Co-authored-by: Matt Wang <matt@matthewwang.me>
2022-09-29 13:35:48 -07:00
Peter Mosses
93857587dd
Improve docs for code highlighting with line numbers (#974)
* Add toc heading custom include

Closes #961.

* Revert "Add toc heading custom include"

This reverts commit 49813c341973e313db0a21f075a60ebf2120989e.

* Update code highlighting with line numbers

- Add the example of code highlighting with line numbers explained in the [Jekyll docs](https://jekyllrb.com/docs/liquid/tags/#line-numbers).
- Fix the styling of narrow code with line numbers, which floats to the centre without this CSS adjustment. (The line numbers column expands as needed with larger numbers of lines, despite using `width`; using `min-width` doesn't work.)

To apply HTML compression, I removed `vendor` from `exclude`; that change is left to a different PR.
2022-09-27 09:53:57 -07:00
Peter Mosses
6061dd27e1
Add custom include for TOC heading (#980)
Closes #961. Replays a previous attempt.
2022-09-25 17:48:49 -07:00
Peter Mosses
bd2af37865
Clarify version docs (#955)
This PR updates the home page and the CHANGELOG to refer to  v0.4.0.rc1 as a pre-release or release candidate, rather than a release. See [this comment](https://github.com/just-the-docs/just-the-docs/pull/613#issuecomment-1240442518) for motivation.

It also adds the versioned docs issue (#728) to the roadmap in the CHANGELOG.

As the config for the theme docs now needs to declare callouts, the [callouts docs](https://just-the-docs.github.io/just-the-docs/docs/ui-components/callouts/) can now illustrate the rendered appearance. (These callouts are merely examples: the names and colors should eventually be replaced by a principled collection, taking account of WCAG.)
2022-09-10 16:44:27 -07:00
Matt Wang
91a894c0d4
Add docs for custom search placeholder (#939)
Follow-up to #613. Relatively self-explanatory!

Co-authored-by: Peter Mosses <18308236+pdmosses@users.noreply.github.com>
2022-09-07 10:04:25 -07:00
Olga Matoula
4bdec0bb3a
docs: fix broken link (custom footer) (#951) 2022-09-06 11:37:25 -07:00
Peter Mosses
adbc25dec5
Update customization.md
Added a missing `{: .no_toc }`, to avoid a 3rd-level item in the displayed TOC at the top of the page.
2022-08-26 09:36:44 +02:00
Robin Pokorny
977349ceb3
Fix table of contents on search docs (#940) 2022-08-26 00:17:00 -07:00
Matt Wang
011f783fc7
enables mermaid in docs (#935)
Short and sweet PR that addresses the follow-up in #909: enabling `mermaid` on our docs site, but making it clear that users still need to opt-in to use it. I've also added an example in-action.

To test: [see the Netlify deploy](https://deploy-preview-935--just-the-docs.netlify.app/docs/ui-components/code/#mermaid-diagram-code-blocks).
2022-08-21 16:32:27 -07:00
Matt Wang
e2f1546c61
mermaid: refactor config to use mermaid_config.js include, only require mermaid.version in _config.yml (#909)
This PR has a bit of scope creep! This PR now:

- changes the mermaid opt-in logic to only check for the existence of a `mermaid` key instead of `mermaid != false`: this resolves the follow-up in #857
- changes the behaviour of mermaid configuration
    - instead of using `mermaid_init.html` with default settings, makes the include `mermaid_config.js`
    - the include is loaded directly into the contents of `mermaid_initialize`
    - by default, it is an empty object (i.e. `{}`), triggering the defaults
- updates docs
- adds an example to the markdown kitchen sink  

It does significantly change the interface provided in #857, and I apologize for the confusion. However, given the discussion in this PR, I think it's the best move forward!
2022-08-11 19:34:15 -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
Peter Mosses
3c14eeef2e
Allow links to wrap (#905)
Fix #734.

- Remove `white-space: nowrap;` in `_sass/content.scss`.
- Add an example testing wrapping in`docs/index-test.md`.
2022-07-31 22:14:03 -07:00
Eisverygoodletter
b2581c19a6
Fix vertical alignment for consecutive labels (#893)
Fixes a problem where multiple labels right after a heading are vertically misaligned.

Closes #751.
2022-07-25 20:41:31 -07:00
SPGoding
009a0f9c5a
Support external navigation links (#876)
Based on #238, resolves #66.
2022-07-12 22:24:54 -07:00
nascosto
6907f06977
Add mermaid support (#857)
Closes #825


Co-authored-by: Matt Wang <matt@matthewwang.me>
2022-07-12 15:16:18 -07:00
Tyler
764dbb35a9
Document how to use custom_head to add a custom favicon (#814)
Co-authored-by: Matt Wang <matt@matthewwang.me>
2022-07-05 21:44:21 -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
Waldir Pimenta
26fad7dd0f
docs: Mention caveat about variable dependencies (#555)
Looking at how the variables are defined in _variables.scss, with various dependencies between them aimed at ensuring a consistent color scheme, one might expect that redefining a given variable would affect the remaining styles that depend on it.

This is not the case, however, due to the order in which the files are processed. This PR edits the documentation to mention the non-propagating behavior of redefined variables, to better guide users that wish to customize the site using custom themes, and call their attention to the need to redefine the dependency relations as well.

Co-authored-by: Matt Wang <matt@matthewwang.me>
Co-authored-by: Patrick Marsceill <pmarsceill@users.noreply.github.com>
2022-07-04 12:25:58 -07:00
Peter Mosses
d083aeb3fd
Fix nested task lists (#517) (#855)
Fix #517

Users expect nested task lists to have the same indentation as other lists.
Fix the styling in `_sass/content.scss` to do that.
Add examples in `docs/index-test.md` to test.
2022-07-04 12:24:31 -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
Nathan Jessen
5fd9c3b32c
Add docs for custom includes (#806)
These docs outline some of the custom includes that are provided by the theme and can be modified by the user.

Co-authored-by: Matt Wang <matt@matthewwang.me>
Co-authored-by: Patrick Marsceill <pmarsceill@users.noreply.github.com>
2022-07-04 12:22: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
Michelle Blanchette
260d98d825
remove extra spaces (#554)
Co-authored-by: Matt Wang <matt@matthewwang.me>
2022-03-09 10:36:09 -08:00
Doug Aitken
37e90d2676 change small-image
Changed small-image to match large image and fix reference
2022-03-06 12:20:58 +00:00
Doug Aitken
655335d552 Rename large file and fix reference
Renaming the large image and changed the index test references to display these images
2022-03-06 12:04:39 +00:00
Patrick Marsceill
79f30a22bc fix prettier bugs, remove prettier from MD formatting 2022-03-03 19:32:25 +00:00
Patrick Marsceill
13298d20c0 rename master -> main 2022-03-03 19:05:50 +00:00
Patrick Marsceill
2aa9815064 Update to new repo path 2022-03-03 18:50:33 +00:00
Peter Mosses
5665097fc2
Update configuration.md
2019 replaced by 2020 in line 94.
2020-10-13 09:40:33 +02:00
Patrick Marsceill
487a5a680a
Update configuration.md 2020-10-12 14:15:12 -04:00
Patrick Marsceill
bd1f741d6d
Merge pull request #334 from CodeSandwich/custom_header_footer
Add custom header and footer include files
2020-10-12 12:57:25 -04:00
Patrick Marsceill
fdb93755d1
Update configuration.md 2020-10-12 12:49:51 -04:00
Patrick Marsceill
58aea7a29b
Update configuration.md 2020-10-12 12:47:56 -04:00
Patrick Marsceill
863d13fc8e
Merge pull request #443 from pdmosses/nav-exclude
Limit the effect of `nav_exclude` to the main navigation
2020-10-12 12:41:33 -04:00
PLanCompS
59f757a790 Fix list alignment
Resolve #420

- Remove `margin-top` for the first child in various list items, to improve alignment.
- Add examples of lists to `docs/tests/styling`.
2020-09-29 17:13:13 +02:00
PLanCompS
641fa6ac5c Create excluded.md
Add a test for explicit exclusion of an untitled page.
2020-09-28 17:26:51 +02: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
682dcf4ec1 Folders renamed
Improve folder names.
Correct classification of excluded test pages.
2020-09-28 16:54:07 +02:00
PLanCompS
405180c863 Reorganise tests
Make the titles of test pages more suggestive.
Refactor the documentation of the tests.
2020-09-28 16:37:42 +02:00
PLanCompS
aa247408e4 Tests updated 2020-09-28 12:08:27 +02:00
Igor Żuk
b89ab93a88
Merge branch 'master' into custom_header_footer 2020-09-15 00:09:50 +02:00