131 Commits

Author SHA1 Message Date
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
Peter Mosses
29b5d14789
Fix external links for sites with no pages (#1021)
Fix #1020

- Move the display of nav external links from `_includes/nav.html` to `_layouts/default.html`.
- Replace ` unless include.key` by `if site.nav_external_links`.
- Wrap the body of `if site.nav_external_links` in `<ul class="nav-list">…</ul>`.

To test this PR:

1.  Add to `_config.yml`:
    ```yaml
    defaults:
      -
        scope: {path: ""}
        values: {nav_exclude: true}
    ```

2.  Check that the only link to appear in the nav panel is external.

Co-authored-by: Matt Wang <matt@matthewwang.me>
2022-11-05 00:35:37 -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
Matt Wang
855427186b
Fix HTML validation issues (W3C validator) (#964)
Closes #963.

- redundant `role="navigation"` on nav elements
- redundant `type="text/javascript"` on script tags
- misplaced mermaid script tag

Note that [running the validator on the deploy preview](https://validator.w3.org/nu/?doc=https%3A%2F%2Fdeploy-preview-964--just-the-docs.netlify.app%2F) has no errors now!
2022-09-15 12:24:26 -07:00
Henry Schreiner
1043a34104
fix: spacing issue when search is disabled (#960)
Fixes #396.
2022-09-14 16:52:39 -07:00
Jeremy Prevost
8333eceb0d
Provide ability to skip to main content (#949)
Why are these changes being introduced:

* The current tab order requires keyboard or screenreader users to tab
  though all of the navigation links before they get to the main content
  of the page

Relevant ticket(s):

* Discussed as part of larger WCAG ticket https://github.com/just-the-docs/just-the-docs/issues/566

How does this address that need:

* Introduces an off screen link as the first element in the tab order
  that will display when it has focus but remain off screen for users
  not using tab to navigate the document.
* Introduces a new scss file with the required style elements and uses
  colors variables to ensure both light and dark mode are respected.

Background information on this technique:

- https://www.w3.org/TR/WCAG20-TECHS/G1.html
- https://accessibility.oit.ncsu.edu/it-accessibility-at-nc-state/developers/accessibility-handbook/mouse-and-keyboard-events/skip-to-main-content/
2022-09-10 16:51:18 -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
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
Nathan Jessen
0ff0a4bbab
Create nav_footer_custom (#474)
**Rationale**
I would like to customize the site footer content without needing to override the entire default layout. Ideally, I'd like to shorten the attribution to something like "Built with Just the Docs"

**Implementation**
Create a new `site_footer.html` include that users can override.

**Possible changes**
I debated whether or not the `<footer class="site-footer">` should be in/out of the include. I opted for placing it inside the include so I have the option of disabling the footer entirely by creating an empty site_footer file in my site.

Co-authored-by: Matt Wang <matt@matthewwang.me>
Co-authored-by: Patrick Marsceill <pmarsceill@users.noreply.github.com>
2022-07-04 12:28:39 -07:00
Matt Wang
c980fd4a64
feat: adds search placeholder configuration (#613)
* implements search placeholder configuration

* changes implementation approach to use search_placeholder_custom

Thanks to @pdmosses for the suggestion!

* strips whitespace and HTML for both placeholder and aria-label
2022-07-04 12:25:21 -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
2692e6714c
Merge branch 'main' into fix-collections-dir 2022-03-03 15:22:17 -05:00
Patrick Marsceill
2aa9815064 Update to new repo path 2022-03-03 18:50:33 +00:00
Alexandre Segura
404059ab03 Prepend site.collections_dir if any. 2020-12-22 08:54:21 +01: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
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
Igor Żuk
b89ab93a88
Merge branch 'master' into custom_header_footer 2020-09-15 00:09:50 +02:00
Phillip Cutter
cdfad69c5b Migrated from site.source to site.gh_edit_source 2020-08-25 18:08:31 -07:00
Phillip Cutter
55f80acb4f Added site.source to GitHub edit link 2020-08-25 17:53:54 -07:00
Patrick Marsceill
101dd2efdc
Merge pull request #399 from pdmosses/anchor-headings-1.0.7
Update anchor_headings.html
2020-08-10 10:46:17 -04:00
PLanCompS
d4adef025e Update _layouts/default.html to preserve aria-labelledby in headings
Correction suggested by @allejo in comment https://github.com/pmarsceill/just-the-docs/pull/399#discussion_r464128713.
Also prevents losing the aria-labelledby attribute in future updates to this snippet.
2020-08-03 08:50:04 +02:00
CodeSandwich
cd192aa4e2 Add custom header and footer include files 2020-07-26 00:35:58 +02:00
Silvio Giebl
5dd6324f61 Fixed display of nav-category 2020-07-12 20:02:44 +02:00
Silvio Giebl
6b27beaf58 Added just-the-docs.collections nav_exclude and search_exclude
Renamed doc_collections to just-the-docs.collections
2020-07-10 19:07:01 +02:00
Silvio Giebl
9faba6cd91 Removed temporary changes 2020-07-10 17:26:23 +02:00
Silvio Giebl
d1c3e08337 Updated doc_collections format 2020-07-09 23:33:52 +02:00
Silvio Giebl
93f93f48a7 Added doc collections and categories 2020-07-09 21:07:24 +02:00
Patrick Marsceill
8715224655
Add IDs to target print styles 2020-06-26 15:33:03 -04:00
Silvio Giebl
597c534279 Replaced svgs with feathericons.com 2020-06-25 23:48:24 +02:00
Silvio Giebl
ed618caf70 Fixed table of children 2020-06-15 23:00:53 +02:00
Silvio Giebl
51f15965f2 Merge branch 'feature/search-sections' into improvement/navigation-new
# Conflicts:
#	_includes/nav.html
#	_layouts/default.html
#	assets/js/search-data.json
#	docs/configuration.md
#	lib/tasks/search.rake
2020-06-15 22:06:16 +02:00
Silvio Giebl
da9276121a Improved search input for mobile
- font size 16px to prevent zooming on iOS Safari
- search input is scrolled into view on iOS Safari
- box-shadow is displayed correctly
2020-06-15 21:57:54 +02:00
Silvio Giebl
18f3a41600 Merge branch 'bugfix/page-scrolling' into improvement/navigation-new
# Conflicts:
#	_layouts/default.html
#	assets/js/just-the-docs.js
2020-06-15 21:44:30 +02:00
Silvio Giebl
e216623ed3 Merge branch 'improvement/search-button' into improvement/navigation-new 2020-06-15 21:37:31 +02:00
Silvio Giebl
c7466e88a8 Merge branch 'improvement/navigation' into improvement/navigation-new
# Conflicts:
#	_includes/nav.html
#	_layouts/default.html
2020-06-15 21:23:03 +02:00
Patrick Marsceill
beb88adf5f
Typography fixes 2020-05-01 17:32:33 -04:00
Patrick Marsceill
f664d410d7
Add back to top link and format footer 2020-05-01 17:31:44 -04:00
Patrick Marsceill
484563b297
Merge pull request #239 from KasparEtter/fix-duplicates-in-nav
Fix duplicate entries in nav.html and default.html
2020-04-28 17:52:35 -04:00
Peter Mosses
30e1ddcdae
Update _layouts/default.html 2020-04-28 08:08:34 +02:00
Matt Wang
6d487845a4
Merge branch 'v0.2.9' into aux-links-new-tab 2020-04-27 13:00:42 -07:00
Patrick Marsceill
16e83704d0
Update default.html 2020-04-27 14:18:28 -04:00
Patrick Marsceill
b7fe6e0318
Merge branch 'v0.2.9' into fix-duplicates-in-nav 2020-04-27 13:29:52 -04:00
Patrick Marsceill
ee44f699ec
Update default.html 2020-04-27 13:13:22 -04:00
Patrick Marsceill
30b5da451c
Update default.html 2020-04-27 13:07:25 -04:00
Patrick Marsceill
fad434bc74
Merge branch 'v0.2.9' into default-nav-order 2020-04-27 11:05:46 -04:00
Patrick Marsceill
59d4802ce3
Merge branch 'improvement/custom-themes' of git://github.com/SgtSilvio/just-the-docs into SgtSilvio-improvement/custom-themes 2020-04-24 15:39:44 -04:00
Patrick Marsceill
2faa91f235
Update default.html 2020-04-23 22:42:00 -04:00
Patrick Marsceill
eecc51062b
Update default.html 2020-04-23 22:39:11 -04:00
Matthew Wang
da79e3e214 adds @bram1028's suggestion 2020-01-22 14:54:31 -08:00