1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-15 06:20:32 +02:00
Commit Graph

15 Commits

Author SHA1 Message Date
Hatim Nalawala
cc0a78ed9a
Move CSS files into theme/ folder (#1229)
Hi all,
This PR fixes https://github.com/google/comprehensive-rust/issues/1226:

* Moved CSS files to `theme/css`
* Moved speaker-notes.js to `theme/`
* Updated paths in book.toml
2023-09-21 11:00:27 +02:00
Martin Geisler
0d566ce042
Move JavaScript code to head template (#1210)
This will simplify our mdbook updates since there will be fewer
customizations to copy over when a new mdbook version has changes to the
`index.hbs` template.
2023-09-15 09:52:22 +00:00
Henri Fontana
19f679f8a7
Standardize language menu format and adds Spanish (#1196)
Spanish translation #284
2023-09-11 09:45:20 -04:00
Martin Geisler
09d1265cbb
Add support for right-to-left languages (#1165)
This updates our `mdbook` version to the latest version in Git. I copied
the `index.hbs` file from that version and back-ported our changes into
it. I checked English and Danish locally and they both look fine.

The new version has support for right-to-left languages:
https://github.com/rust-lang/mdBook/pull/1641.

We have an in-progress Persian translation. Download the `fa.zip`
artifact after building the PR to check how it looks. I checked Persian
locally and it looks mirrored like I expect (but we will need someone
who can read Persian to actually verify this).

Fixes #1164.
2023-09-07 09:50:44 +02:00
Martin Geisler
8b1bed7db9
Insert <link rel="canonical"> elements (#1140)
This prevents duplicate search results in case copies of the material is
being left visible on the web. See the Search Central
documentation[1] for details.

The implementation here should mostly go away when
https://github.com/google/mdbook-i18n-helpers/issues/70 is implemented.

[1]: https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
2023-08-30 22:28:34 +02:00
Martin Geisler
2e92da7acd
Update mdbook to 0.4.34 (#1066)
I also updated `book.js` and `index.hbs` to the latest versions while
keeping our local modifications.

I tested this locally with `mdbook serve` for both English and
Brazilian Portuguese and everything seems to work fine.
2023-08-11 15:40:01 +02:00
Martin Geisler
5d71f8a326
Open GitHub edit links in new tabs (#856)
I find this nicer since you don't lose your location in the book then.
2023-06-22 09:50:20 -04:00
Martin Geisler
66247b698e
Fix language selector on unpublished languages (#695)
The Danish translation is not yet linked in the language selector
since it is very incomplete. This means that `selectedLang` is `null`
in this case and thus we should not call any methods on it.
2023-05-26 16:23:57 +02:00
Martin Geisler
2a2f8ec94e Add book.js generated with mdbook init --theme
This allows us to customize the JavaScript used on the page.
2023-03-01 13:14:42 +01:00
Jiyong Park
eb57ba9e51
Publish Korean translation (#428)
* Publish Korean translation

* 한국어 -> 한국어 (Korean)

* Add translator names for the Korean translation
2023-02-17 17:58:33 +09:00
Martin Geisler
14b5e86579
Fix links in language picker (#417)
When the current page is not `en`, we need to add an additional `../`
to the path to reach the top of the site.
2023-02-15 18:59:58 +01:00
Martin Geisler
3b7123d21a
Add language picker menu (#411)
The picker is a drop-down menu using the same design as the theme
picker in the top-left.

There doesn’t seem to be an easy way to pass in a list of languages
and descriptions, so for now we’ll have to expand the menu by hand as
we add new languages. A comment has been added to `publish.yml` to
remind us of this.
2023-02-15 15:10:16 +01:00
Martin Geisler
be5263010a
Use .po file as target for edit link on translations (#394) 2023-02-13 17:42:45 +01:00
Martin Geisler
4409f330c5
Move GA code directly into main page (#289)
This replaces a bit of code with the equivalent HTML code.

We also load the script async, which means that the browser won’t
block rendering while waiting for the scripts.
2023-01-27 14:37:17 +01:00
Martin Geisler
438c16607d
Add theme generated with mdbook init --theme (#189)
This will allow us to customize the appearance more easily: we can
move the GA logic into the theme (to reduce load times and to simplify
the JS injection logic). We can also add new elements, which is what I
will do next.

The mdbook theme can be added incrementally: if we don’t add a file to
our theme folder, we will get the corresponding file from mdbook.
2023-01-25 21:31:22 +01:00