From 088c9787852740b4bb77afb170a5bc2330c0d052 Mon Sep 17 00:00:00 2001 From: Pomax Date: Fri, 18 Sep 2020 15:26:06 -0700 Subject: [PATCH] preamble locale fix --- docs/chapters/preface/content.en-GB.md | 4 ++-- docs/index.html | 10 +++++----- docs/ja-JP/index.html | 6 +++--- docs/news/2020-09-20.html | 2 +- docs/zh-CN/index.html | 6 +++--- src/build/create-index-pages.js | 3 +++ src/html/index.template.html | 4 ++-- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/docs/chapters/preface/content.en-GB.md b/docs/chapters/preface/content.en-GB.md index db8f7228..bcfde79c 100644 --- a/docs/chapters/preface/content.en-GB.md +++ b/docs/chapters/preface/content.en-GB.md @@ -8,7 +8,7 @@ They're named after [Pierre Bézier](https://en.wikipedia.org/wiki/Pierre_B%C3%A Anyway, that's mostly trivia, what you are more likely to care about is that these curves are handy: you can link up multiple Bézier curves so that the combination looks like a single curve. If you've ever drawn Photoshop "paths" or worked with vector drawing programs like Flash, Illustrator or Inkscape, those curves you've been drawing are Bézier curves. -But what if you need to program them yourself? What are the pitfalls? How do you draw them? What are the bounding boxes, how do you determine intersections, how can you extrude a curve, in short: how do you do everything that you might want when you do with these curves? That's what this page is for. Prepare to be mathed! +But what if you need to program them yourself? What are the pitfalls? How do you draw them? What are the bounding boxes, how do you determine intersections, how can you extrude a curve, in short: how do you do everything that you might want to do with these curves? That's what this page is for. Prepare to be mathed!
@@ -30,7 +30,7 @@ This page uses interactive examples, relying heavily on [Bezier.js](https://poma ## This book is open source. -This book is an open source software project, and lives on two github repositories. The first is [https://github.com/pomax/bezierinfo](https://github.com/pomax/bezierinfo) and is the purely-for-presentation version you are viewing right now. The other repository is [https://github.com/pomax/BezierInfo-2](https://github.com/pomax/BezierInfo-2), which is the development version, housing all the HTML, JavaScript, and CSS. You can fork either of these, and pretty much do with them as you please, except for passing it off as your own work wholesale, of course =) +This book is an open source software project, and lives on two github repositories. The first is [https://github.com/pomax/bezierinfo](https://github.com/pomax/bezierinfo) and is the purely-for-presentation version you are viewing right now. The other repository is [https://github.com/pomax/BezierInfo-2](https://github.com/pomax/BezierInfo-2), which is the development version, housing all the code that gets turned _into_ the web version, and is also where you should file issues if you find bugs or have ideas on what to change or add to the primer. ## How complicated is the maths going to be? diff --git a/docs/index.html b/docs/index.html index 9f5380e3..56cad609 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,7 +31,7 @@ - + @@ -241,8 +241,8 @@

But what if you need to program them yourself? What are the pitfalls? How do you draw them? What are the bounding boxes, how do you - determine intersections, how can you extrude a curve, in short: how do you do everything that you might want when you do with these curves? - That's what this page is for. Prepare to be mathed! + determine intersections, how can you extrude a curve, in short: how do you do everything that you might want to do with these curves? That's + what this page is for. Prepare to be mathed!

PS: buy me a coffee?

@@ -272,8 +272,8 @@ This book is an open source software project, and lives on two github repositories. The first is https://github.com/pomax/bezierinfo and is the purely-for-presentation version you are viewing right now. The other repository is https://github.com/pomax/BezierInfo-2, - which is the development version, housing all the HTML, JavaScript, and CSS. You can fork either of these, and pretty much do with them as - you please, except for passing it off as your own work wholesale, of course =) + which is the development version, housing all the code that gets turned into the web version, and is also where you should file + issues if you find bugs or have ideas on what to change or add to the primer.

How complicated is the maths going to be?

diff --git a/docs/ja-JP/index.html b/docs/ja-JP/index.html index 7791229c..07498a1d 100644 --- a/docs/ja-JP/index.html +++ b/docs/ja-JP/index.html @@ -32,7 +32,7 @@ - + @@ -155,8 +155,8 @@

目次

Preamble

    -
  1. まえがき
  2. -
  3. What's new
  4. +
  5. まえがき
  6. +
  7. What's new

Main content

    diff --git a/docs/news/2020-09-20.html b/docs/news/2020-09-20.html index 6af8b748..1bcf8836 100644 --- a/docs/news/2020-09-20.html +++ b/docs/news/2020-09-20.html @@ -26,7 +26,7 @@ - + diff --git a/docs/zh-CN/index.html b/docs/zh-CN/index.html index 50800f95..3b56d445 100644 --- a/docs/zh-CN/index.html +++ b/docs/zh-CN/index.html @@ -32,7 +32,7 @@ - + @@ -155,8 +155,8 @@

    目录

    Preamble

      -
    1. 序言
    2. -
    3. What's new
    4. +
    5. 序言
    6. +
    7. What's new

    Main content

      diff --git a/src/build/create-index-pages.js b/src/build/create-index-pages.js index 2fdafb3d..237d9cf2 100644 --- a/src/build/create-index-pages.js +++ b/src/build/create-index-pages.js @@ -17,13 +17,16 @@ async function createIndexPages(locale, localeStrings, chapters) { const langSwitcher = generateLangSwitcher(localeStrings); const toclist = {}; + const localePrefix = base ? `${locale}/` : ``; const preface = `
      ${chapters[sectionOrder[0]]}
      `; const sections = formSectionData(chapters, sectionOrder, toclist, locale, base); const sectionText = finaliseSections(sections); const changelog = formChangeLog(changelogData); + const renderContext = { base, locale, + localePrefix, langSwitcher, preface, toc: Object.values(toclist).join(`\n`), diff --git a/src/html/index.template.html b/src/html/index.template.html index 7d2772ef..1441e23e 100644 --- a/src/html/index.template.html +++ b/src/html/index.template.html @@ -56,8 +56,8 @@

      {{ tocLabel }}

      Preamble

        -
      1. {{ prefaceLabel }}
      2. -
      3. {{ changelogLabel }}
      4. +
      5. {{ prefaceLabel }}
      6. +
      7. {{ changelogLabel }}

      Main content