Commit Graph

17 Commits

Author SHA1 Message Date
mtail a5b61d5754 Trivial script fixes. 2018-07-22 08:59:52 -07:00
Martin Taillefer 3d511f5a70
Various site fixes. (#1701)
- Prevent See Also sections from showing up on index pages.

- Clean up and simplify some JavaScript & CSS.

- Set a height for the idea and warning icons in order to prevent
screen flicker when loading pages with these icons.
2018-07-08 17:12:12 -07:00
Martin Taillefer 072abae8ce
Improve name selection process for the new PRE block download feature. (#1693)
- If an explicit downloadas filename is not supplied in markdown, it is
now derived from the document title, with a proper extension based on the
content syntax.

- Made things work correctly for PRE blocks introduced with normal markdown
``` instead of our magic {{< text >}} sequences.
2018-07-06 18:59:46 -07:00
Martin Taillefer 512fdb5b61
Add download & print buttons to all PRE blocks. (#1680)
Also, replaced the text in the Copy button with an icon instead.
2018-07-06 05:30:35 -07:00
Martin Taillefer 0541000be8
Switch from ``` to {{< text >}} to indicate text blocks. (#1644)
This fixes a number of cases of incorrect formatting of code blocks
throughout the site.
2018-06-30 07:11:21 -07:00
Martin Taillefer 5a1b090fbc
Improve handling for code blocks (#1580)
- Add the {{< text >}} shortcode as a way to declare code blocks. This shortcode
is intended to hide the subtleties around code blocks. More specifically, it
provides a transparent workaround for the Hugo bug around converting indented
code blocks with lines starting with dashes. It also deals with the special
formatting case we have around command-lines that start with `cat <<EOF`.

- Rename the {{< file_content >}} shortcode to {{< text_file >}} and the
{{< fetch_content >}} shortcode to {{< text_dynamic >}} for consistency in naming.
2018-06-28 06:29:27 -07:00
mtail 3e6baa1915 Save a magic Netlify cookie to indicate language selection.
The value of the nf_lang cookie overrides the browser's Accept-Language
setting.
2018-06-16 22:31:13 -07:00
mtail 5cf5c040b1 Experiment with Netlify language cookie override. 2018-06-16 21:59:12 -07:00
mtail 9e9bcb2d5d Make the infrastructure TOC stuff robust against incorrect HTML. 2018-06-11 14:59:05 -07:00
Martin Taillefer 1dcd301bd6
Introduce better linking support to github.com/istio/istio (#1443)
- Within a code block, you can now surround a relative file path with @@. This will
cause the path to be rendered as a link to raw.githubusercontent.com/istio/istio/<path>.
This lets the user click on the link to see the content of the file, which is mighty
handy.

- Updated all code blocks to take advantage of the above.

- Introduce support for {{< branch_name >}} which returns the source code branch
name associated with the current doc site.

- Use {{< branch_name >}} in all our references to content in istio/istio on GitHub. This thus
pins our references to the correct version of the content in GitHub. This prevents errors from
gradually appearing in our doc set as content in GitHub starts to diverge from the expectation
in the site content.
2018-06-06 08:21:18 -07:00
Martin Taillefer 9bd12eebd4
Fix a couple issues around code blocks. (#1440)
- Include JSON syntax coloring support in PrismJS. This prevents
JavaScript crashes when trying to format output that's marked as JSON.
This was happening on the tasks/traffic-management/mirroring.md page.

- Properly escape strings raw output strings before inserting them into the
document. This bug was causing strange things to happen if any of the content
contained stuff that looked like HTML, such as the word <none>.
2018-06-04 13:01:09 -07:00
mtail 33d2d38e77 Don't attach links to <h1> headers. 2018-06-03 05:39:26 -07:00
Martin Taillefer c389a3af38
Couple site fixes. (#1408)
- Get style switching working again.

- Don't show the Edit this Page option for the archived version of the site.
2018-06-01 06:16:21 -07:00
Martin Taillefer efce7c3a4e Workaround bug in Firefox causing bad formatting in some code blocks. (#1379)
- Fixed syntax highlighting of code blocks with multiple commands.
Each command is now run through the syntax highlighter separately, instead
of mushing all commands into one go. The leading $ is also excluded which
helps the highlighter.

- Fixed the CSS source maps which couldn't be found due to a path problem. Running with Firefox
alerted me to that.

- Add missing JS source maps while I was there.
2018-05-29 22:21:28 -07:00
Martin Taillefer ba0cf03b36 A number of visual improvements. (#1366)
- The privacy link in the footer is now actually visible and uses the same coloring as the rest of the
text in the footer.

- The gear menu in the top right now actually looks like a real menu instead of a panel of links. Highlights behave as expected and
visuals are cleaner.

- The :before hack to cause proper scrolling in the face of our header is now more selective. It's only applied to
header items instead of all items that have an id attribute. This is more surgical in nature and avoids
potential issues such as was worked around by a counter-hack for tables. The counter hack is no longer
needed.

- Don't show the Edit This Pages on GitHub menu items for pages that are generated outside of the main doc process
(reference pages mainly). This won't kick in until I regenerate the reference docs, at which point they'll
gain the 'generated' front-matter entry, which will trigger the removal of the menu item.

- Apply a number of script improvements suggested by my editor.
2018-05-29 21:07:13 -04:00
Martin Taillefer b7d8a08998
Workaround Hugo formatting bug with indented code blocks that have lines that start with - (#1372) 2018-05-28 09:14:31 -07:00
mtail 951a8ed9f4 Switch from Jekyll to Hugo. 2018-05-25 20:02:32 -07:00