Pārlūkot izejas kodu

feat(docs): Initial setup of Hugo docs website

Michael Bromley 7 gadi atpakaļ
vecāks
revīzija
0b00db96a1
47 mainītis faili ar 919 papildinājumiem un 0 dzēšanām
  1. 1 0
      .gitignore
  2. 6 0
      docs/archetypes/default.md
  3. 4 0
      docs/archetypes/docs.md
  4. 60 0
      docs/assets/_markdown.scss
  5. 49 0
      docs/assets/_utils.scss
  6. 43 0
      docs/assets/_variables.scss
  7. 205 0
      docs/assets/book.scss
  8. 12 0
      docs/config.toml
  9. 1 0
      docs/content/docs/_index.md
  10. 6 0
      docs/content/docs/config-asset-options.md
  11. 6 0
      docs/content/docs/config-auth-options.md
  12. 6 0
      docs/content/docs/config-custom-fields.md
  13. 6 0
      docs/content/docs/config-email-options.md
  14. 6 0
      docs/content/docs/config-order-process-options.md
  15. 5 0
      docs/content/docs/config-payment-options.md
  16. 6 0
      docs/content/docs/config-promotion-options.md
  17. 7 0
      docs/content/docs/config-shipping-options.md
  18. 5 0
      docs/content/docs/config-tax-options.md
  19. 147 0
      docs/content/docs/configuration.md
  20. 64 0
      docs/content/docs/getting-started.md
  21. 6 0
      docs/content/docs/plugins.md
  22. 17 0
      docs/content/menu/index.md
  23. 19 0
      docs/layouts/404.html
  24. 42 0
      docs/layouts/docs/baseof.html
  25. 9 0
      docs/layouts/docs/list.html
  26. 9 0
      docs/layouts/docs/single.html
  27. 10 0
      docs/layouts/index.en.html
  28. 3 0
      docs/layouts/partials/docs/brand.html
  29. 18 0
      docs/layouts/partials/docs/git-footer.html
  30. 8 0
      docs/layouts/partials/docs/html-head.html
  31. 0 0
      docs/layouts/partials/docs/inject/body.html
  32. 0 0
      docs/layouts/partials/docs/inject/head.html
  33. 0 0
      docs/layouts/partials/docs/inject/menu-after.html
  34. 0 0
      docs/layouts/partials/docs/inject/menu-before.html
  35. 3 0
      docs/layouts/partials/docs/menu-bundle.html
  36. 47 0
      docs/layouts/partials/docs/menu-filetree.html
  37. 6 0
      docs/layouts/partials/docs/mobile-header.html
  38. 11 0
      docs/layouts/partials/docs/shared.html
  39. 6 0
      docs/layouts/partials/docs/toc.html
  40. 19 0
      docs/layouts/posts/baseof.html
  41. 20 0
      docs/layouts/posts/list.html
  42. 11 0
      docs/layouts/posts/single.html
  43. 5 0
      docs/readme.md
  44. 2 0
      docs/static/normalize.min.css
  45. 1 0
      docs/static/svg/code-fork.svg
  46. 1 0
      docs/static/svg/code-merge.svg
  47. 1 0
      docs/static/svg/menu.svg

+ 1 - 0
.gitignore

@@ -393,3 +393,4 @@ server/dist
 !server/e2e/__data__/.gitkeep
 server/test-emails
 server/src/email/preview/output
+docs/resources/_gen/*

+ 6 - 0
docs/archetypes/default.md

@@ -0,0 +1,6 @@
+---
+title: "{{ replace .Name "-" " " | title }}"
+date: {{ .Date }}
+draft: true
+---
+

+ 4 - 0
docs/archetypes/docs.md

@@ -0,0 +1,4 @@
+---
+title: "{{ .Name | humanize | title }}"
+weight: 1
+---

+ 60 - 0
docs/assets/_markdown.scss

@@ -0,0 +1,60 @@
+@import 'variables';
+
+$block-border-radius: 0.15rem;
+
+.markdown {
+  line-height: 1.7;
+
+  > :first-child {
+    margin-top: 0;
+    line-height: 1em;
+  }
+
+  h1, h2, h3, h4, h5 {
+    font-weight: 400;
+    line-height: 1.25;
+  }
+
+  b, optgroup, strong {
+    font-weight: 700;
+  }
+  
+  a {
+    text-decoration: none;
+
+    &:hover {
+      text-decoration: underline;
+    }
+  }
+
+  code {
+    font-family: 'Oxygen Mono', monospace;
+  }
+
+  p code {
+    padding: 0 $padding-4;
+    background: $gray-100;
+    border-radius: $block-border-radius;
+  }
+
+  pre {
+    padding: $padding-16;
+    background: $gray-100;
+    border-radius: $block-border-radius;
+    font-size: $font-size-14;
+    overflow-x: auto;
+  }
+
+  blockquote {
+    border-left: $padding-1*2 solid $gray-300;
+    margin: 0;
+    padding: $padding-1 $padding-16;
+
+    :first-child { margin-top: 0; }
+    :last-child { margin-bottom: 0; }
+  }
+
+  table tr td {
+    padding: $padding-8;
+  }
+}

+ 49 - 0
docs/assets/_utils.scss

@@ -0,0 +1,49 @@
+.flex {
+  display: flex;
+}
+
+.justify-start {
+  justify-content: flex-start;
+}
+
+.justify-end {
+  justify-content: flex-end;
+}
+
+.justify-center {
+  justify-content: center;
+}
+
+.justify-between {
+  justify-content: space-between;
+}
+
+.align-center {
+  align-items: center;
+}
+
+.mx-auto {
+  margin: 0 auto;
+}
+
+.hide {
+  display: none;
+}
+
+@mixin fixed {
+  position: fixed;
+  top: 0;
+  bottom: 0;
+  overflow-x: hidden;
+  overflow-y: auto;
+}
+
+@mixin dark-links {
+  a {
+    color: $nav-link-color;
+  }
+
+  a.active {
+    color: $color-link;
+  }
+}

+ 43 - 0
docs/assets/_variables.scss

@@ -0,0 +1,43 @@
+$padding-1: 1px;
+$padding-4: 0.25rem;
+$padding-8: 0.5rem;
+$padding-16: 1rem;
+
+$font-size-base: 16px;
+$font-size-12: 0.75rem;
+$font-size-14: 0.875rem;
+$font-size-16: 1rem;
+
+// Grayscale
+$white: #ffffff;
+$gray-100: #f8f9fa;
+$gray-200: #e9ecef;
+$gray-300: #dee2e6;
+$gray-400: #ced4da;
+$gray-500: #adb5bd;
+$gray-600: #868e96;
+$gray-700: #495057;
+$gray-800: #343a40;
+$gray-900: #212529;
+$black: #000;
+
+$color-link: #004ed0;
+$color-visited-link: #8440f1;
+
+$body-background: white;
+$body-font-color: $gray-800;
+$body-font-weight: 400;
+$body-min-width: 25rem;
+
+$nav-background: $body-background;
+$nav-link-color: $gray-800;
+
+$header-height: 3.5rem;
+$menu-width: 18rem;
+$toc-width: 14rem;
+
+$container-min-width: $body-min-width;
+$container-max-width: 80rem;
+
+$sm-breakpoint: $menu-width + $body-min-width;
+$md-breakpoint: $sm-breakpoint + $toc-width;

+ 205 - 0
docs/assets/book.scss

@@ -0,0 +1,205 @@
+@import "variables";
+@import "markdown";
+@import "utils";
+
+html {
+  font-size: $font-size-base;
+  letter-spacing: 0.33px;
+  scroll-behavior: smooth;
+}
+
+html,
+body {
+  min-width: $body-min-width;
+  overflow-x: hidden;
+}
+
+body {
+  color: $body-font-color;
+  background: $body-background;
+
+  font-family: "Oxygen", sans-serif;
+  font-weight: $body-font-weight;
+
+  text-rendering: optimizeLegibility;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+
+  box-sizing: border-box;
+  * {
+    box-sizing: inherit;
+  }
+}
+
+h1,
+h2,
+h3,
+h4,
+h5 {
+  font-weight: 400;
+}
+
+a {
+  text-decoration: none;
+  color: $color-link;
+
+  &:visited {
+    color: $color-visited-link;
+  }
+}
+
+img {
+  vertical-align: middle;
+}
+
+aside nav ul {
+  padding: 0;
+  margin: 0;
+  list-style: none;
+
+  li {
+    margin: 1em 0;
+  }
+
+  a {
+    display: block;
+  }
+
+  a:hover {
+    opacity: .5;
+  }
+
+  ul {
+    padding-left: $padding-16;
+  }
+}
+
+ul.pagination {
+  display: flex;
+  justify-content: center;
+
+  .page-item a {
+    padding: $padding-16;
+  }
+}
+
+.container {
+  min-width: $container-min-width;
+  max-width: $container-max-width;
+  margin: 0 auto;
+}
+
+.book-brand {
+  margin-top: 0;
+}
+
+.book-menu {
+  flex: 0 0 $menu-width;
+  font-size: $font-size-14;
+
+  nav {
+    width: $menu-width;
+    padding: $padding-16;
+
+    @include fixed;
+  }
+
+  @include dark-links;
+}
+
+.book-page {
+  min-width: $body-min-width;
+  padding: $padding-16;
+}
+
+.book-header {
+  margin-bottom: $padding-16;
+  display: none;
+}
+
+.book-toc {
+  flex: 0 0 $toc-width;
+  font-size: $font-size-12;
+
+  nav {
+    width: $toc-width;
+    padding: $padding-16;
+
+    @include fixed;
+  }
+
+  nav > ul > li {
+    margin: 0;
+  }
+}
+
+.book-git-footer {
+  display: flex;
+  margin-top: $padding-16;
+  font-size: $font-size-14;
+  align-items: baseline;
+
+  img {
+    width: $font-size-14;
+    vertical-align: bottom;
+  }
+}
+
+.book-posts {
+  min-width: $body-min-width;
+  max-width: $sm-breakpoint;
+  padding: $padding-16;
+
+  article {
+    padding-bottom: $padding-16;
+  }
+}
+
+// Responsive styles
+aside nav,
+.book-page,
+.markdown {
+  transition: 0.2s ease-in-out;
+  transition-property: transform, margin-left, opacity;
+  will-change: transform, margin-left;
+}
+
+@media screen and (max-width: $md-breakpoint) {
+  .book-toc {
+    display: none;
+  }
+}
+
+@media screen and (max-width: $sm-breakpoint) {
+  .book-menu {
+    margin-left: -$menu-width;
+  }
+
+  .book-header {
+    display: flex;
+  }
+
+  #menu-control:checked + main {
+    .book-menu nav,
+    .book-page {
+      transform: translateX($menu-width);
+    }
+
+    .book-header label {
+      transform: rotate(90deg);
+    }
+
+    .markdown {
+      opacity: 0.25;
+    }
+  }
+}
+
+// Extra space for big screens
+@media screen and (min-width: $container-max-width) {
+  .book-page,
+  .book-menu nav,
+  .book-toc nav {
+    padding: $padding-16 * 2 $padding-16;
+  }
+}

+ 12 - 0
docs/config.toml

@@ -0,0 +1,12 @@
+baseURL = "http://example.org/"
+languageCode = "en-us"
+title = "Vendure Documenation"
+pygmentsCodeFences = true
+disableKinds = [
+  "taxonomy",
+  "taxonomyTerm"
+]
+[params]
+    BookMenuBundle = "/menu"
+    BookSection = "docs"
+

+ 1 - 0
docs/content/docs/_index.md

@@ -0,0 +1 @@
+# Documentation Index

+ 6 - 0
docs/content/docs/config-asset-options.md

@@ -0,0 +1,6 @@
+---
+title: "assetOptions"
+weight: 1
+---
+
+# assetOptions

+ 6 - 0
docs/content/docs/config-auth-options.md

@@ -0,0 +1,6 @@
+---
+title: authOptions"
+weight: 1
+---
+
+# authOptions

+ 6 - 0
docs/content/docs/config-custom-fields.md

@@ -0,0 +1,6 @@
+---
+title: "customFields"
+weight: 1
+---
+
+# customFields

+ 6 - 0
docs/content/docs/config-email-options.md

@@ -0,0 +1,6 @@
+---
+title: "emailOptions"
+weight: 1
+---
+
+# emailOptions

+ 6 - 0
docs/content/docs/config-order-process-options.md

@@ -0,0 +1,6 @@
+---
+title: "orderProcessOptions"
+weight: 1
+---
+
+# orderProcessOptions

+ 5 - 0
docs/content/docs/config-payment-options.md

@@ -0,0 +1,5 @@
+---
+title: "paymentOptions"
+weight: 1
+---
+# paymentOptions

+ 6 - 0
docs/content/docs/config-promotion-options.md

@@ -0,0 +1,6 @@
+---
+title: "promotionOptions"
+weight: 1
+---
+
+# promotionOptions

+ 7 - 0
docs/content/docs/config-shipping-options.md

@@ -0,0 +1,7 @@
+---
+title: "shippingOptions"
+weight: 1
+---
+
+# shippingOptions
+ 

+ 5 - 0
docs/content/docs/config-tax-options.md

@@ -0,0 +1,5 @@
+---
+title: "taxOptions"
+weight: 1
+---
+# taxOptions

+ 147 - 0
docs/content/docs/configuration.md

@@ -0,0 +1,147 @@
+---
+title: "Configuration"
+weight: 1
+---
+
+# Configuration
+
+All configuration and customization of Vendure is done via the `VendureConfig` object which gets passed to the `bootstrap` function:
+
+## Example configuration
+
+```TypeScript
+bootstrap({
+    defaultChannelToken: 'default-channel',
+    authOptions: {
+        sessionSecret: 'xup1hki5zo',
+    },
+    port: 3000,
+    apiPath: 'api',
+    dbConnectionOptions: {
+        type: 'mysql',
+        database: 'vendure-dev',
+        host: '192.168.99.100',
+        port: 3306,
+        username: 'root',
+        password: '',
+    },
+    paymentOptions: {
+        paymentMethodHandlers: [examplePaymentHandler],
+    },
+    customFields: {},
+    importExportOptions: {
+        importAssetsDir: path.join(__dirname, 'vendure/import-assets'),
+    },
+    plugins: [
+        new DefaultAssetServerPlugin({
+            route: 'assets',
+            assetUploadDir: path.join(__dirname, 'vendure/assets'),
+            port: 4000,
+        }),
+        new DefaultEmailPlugin({
+            templatePath: path.join(__dirname, 'vendure/email/templates'),
+            devMode: true,
+        }),
+        new DefaultSearchPlugin(),
+    ],
+}).catch(err => {
+    console.log(err);
+});
+```
+
+## The `VendureConfig` interface
+
+All possible configuration options are defined by the [`VendureConfig`](https://github.com/vendure-ecommerce/vendure/blob/master/server/src/config/vendure-config.ts) interface.
+
+### apiPath
+
+The path to the GraphQL API.
+
+### assetOptions
+
+Configuration for the handling of Assets (images and other files). See [assetOptions](/docs/config-asset-options).
+
+### authOptions
+
+Configuration for authorization and authentication. See [authOptions](/docs/config-auth-options).
+
+### channelTokenKey
+
+The name of the property which contains the token of the active channel. This property can be included either in the request header or as a query string.
+
+### cors
+
+Set the CORS handling for the server. See [the Express cors docs](https://github.com/expressjs/cors#configuration-options)
+
+### customFields
+
+Defines custom fields which can be used to extend the built-in entities. See [customFields](/docs/config-custom-fields).
+
+### dbConnectionOptions
+
+The connection options used by TypeORM to connect to the database. See the [TypeORM connection options docs](http://typeorm.io/#/connection-options).
+
+### defaultChannelToken
+
+The token for the default channel. If not specified, a token will be randomly generated.
+
+### defaultLanguageCode
+
+The default ISO 639-1 language code of the server.
+
+### emailOptions
+
+Configures the handling of transactional emails. See [emailOptions](/docs/config-email-options).
+
+### entityIdStrategy
+
+Defines the strategy used for both storing the primary keys of entities in the database, and the encoding & decoding of those ids when exposing entities via the API. The default uses a simple auto-increment integer strategy.
+
+### hostname
+
+Set the hostname of the server.
+
+### importExportOptions
+
+Configuration settings for data import and export.
+
+### orderMergeOptions
+
+Define the strategies governing how Orders are merged when an existing Customer signs in.
+
+### orderProcessOptions
+
+Defines custom states in the order process finite state machine. See [orderProcessOptions](/docs/config-order-process-options).
+
+### middleware
+
+Defines custom Express middleware to use for incoming API requests.
+
+### paymentOptions
+
+Configures available payment processing methods. See [paymentOptions](/docs/config-payment-options).
+
+### plugins
+
+Configure the active Vendure plugins. See [plugins](/docs/plugins).
+
+### port
+
+Which port the Vendure server should listen on.
+
+### promotionOptions
+
+Configures the Conditions and Actions available when creating Promotions. See [promotionOptions](/docs/config-promotion-options).
+
+### shippingOptions
+
+Configures the available checkers and calculators for ShippingMethods. See [shippingOptions](/docs/config-shipping-options).
+
+### silent
+
+When set to true, no application logging will be output to the console.
+
+### taxOptions
+
+Configures how taxes are calculated on products. See [taxOptions](/docs/config-tax-options).
+

+ 64 - 0
docs/content/docs/getting-started.md

@@ -0,0 +1,64 @@
+---
+title: "Getting Started"
+weight: 1
+---
+
+# Getting Started
+
+## Requirements
+ 
+* [Node.js](https://nodejs.org/en/) v8 or above
+* An SQL database compatible with [TypeORM](http://typeorm.io/#/), i.e. MySQL, MariaDB, PostgreSQL, SQLite, Microsoft SQL Server, sql.js, Oracle.
+ 
+## Installation
+
+```
+$ npm install --save @vendure/core
+```
+
+Vendure includes a CLI program which can generate the initial configuration and entry file for your server:
+
+```
+$ npx vendure init
+```
+
+The init command will ask a series of questions which allow the CLI to generate a configuration and index file.
+
+```
+$ ts-node index
+```
+
+or if using JavaScript:
+```
+$ node index
+```
+
+## Making a request
+
+When making an API request, it must include a `vendure-token` header with the value being the channel token of the active channel. This value is set in the config by the `defaultChannelToken` property. If this is not set, or does not match a valid channel token, you will get the error `No valid channel was specified`.
+
+For example:
+```TypeScript
+// index.ts
+bootstrap({
+    port: 3000,
+    apiPath: 'api',
+    defaultChannelToken: 'default-channel'
+    // ...
+})
+```
+
+```TypeScript
+// API call
+fetch(
+    'http://localhost:3000/api',
+    {
+        headers: {
+            'content-type': 'application/json',
+            'vendure-token': 'default-channel',
+        },
+        body: '{"query":"mutation { login(username: \\"superadmin\\", password: \\"superadmin\\") { user { id } } }"}',
+        method: 'POST',
+    },
+)
+```

+ 6 - 0
docs/content/docs/plugins.md

@@ -0,0 +1,6 @@
+---
+title: "Plugins"
+weight: 1
+---
+ 
+# Plugins

+ 17 - 0
docs/content/menu/index.md

@@ -0,0 +1,17 @@
+---
+headless: true
+---
+
+* [Getting started](/docs/getting-started)
+* [Configuration](/docs/configuration)
+  * [assetOptions](/docs/config-asset-options)
+  * [authOptions](/docs/config-auth-options)
+  * [customFields](/docs/config-custom-fields)
+  * [emailOptions](/docs/config-email-options)
+  * [orderProcessOptions](/docs/config-order-process-options)
+  * [paymentOptions](/docs/config-payment-options)
+  * [promotionOptions](/docs/config-promotion-options)
+  * [shippingOptions](/docs/config-shipping-options)
+  * [taxOptions](/docs/config-tax-options)
+* [Plugins](/docs/plugins)
+* *Importing data*

+ 19 - 0
docs/layouts/404.html

@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+{{- partial "docs/shared" -}}
+<html>
+
+<head>
+  {{ partial "docs/html-head" . }}
+  {{ partial "docs/inject/head" . }}
+</head>
+
+<body>
+  <main class="flex justify-center">
+      <h1>404 Not Found</h1>
+  </main>
+
+  {{ partial "docs/inject/body" . }}
+  {{ template "_internal/google_analytics_async.html" . }}
+</body>
+
+</html>

+ 42 - 0
docs/layouts/docs/baseof.html

@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+{{- partial "docs/shared" -}}
+<html>
+
+<head>
+  {{ partial "docs/html-head" . }}
+  {{ partial "docs/inject/head" . }}
+</head>
+
+<body>
+  <input type="checkbox" style="display: none" id="menu-control" />
+  <main class="flex container">
+
+    <aside class="book-menu fixed">
+      <nav role="navigation">
+        {{ partial "docs/brand" . }}
+        {{ partial "docs/inject/menu-before" . }}
+
+        {{ if .Site.Params.BookMenuBundle }}
+          {{ partial "docs/menu-bundle" . }}
+        {{ else }}
+          {{ partial "docs/menu-filetree" . }}
+        {{ end }}
+
+        {{ partial "docs/inject/menu-after" . }}
+      </nav>
+    </aside>
+
+    <div class="book-page">
+      {{ partial "docs/mobile-header" . }}
+      {{ template "main" . }}
+      {{ partial "docs/git-footer" . }}
+    </div>
+
+    {{ template "toc" . }}
+  </main>
+
+  {{ partial "docs/inject/body" . }}
+  {{ template "_internal/google_analytics_async.html" . }}
+</body>
+
+</html>

+ 9 - 0
docs/layouts/docs/list.html

@@ -0,0 +1,9 @@
+{{ define "main" }}
+<article class="markdown">
+  {{- .Content -}}
+</article>
+{{ end }}
+
+{{ define "toc" }}
+  {{ partial "docs/toc" . }}
+{{ end }}

+ 9 - 0
docs/layouts/docs/single.html

@@ -0,0 +1,9 @@
+{{ define "main" }}
+<article class="markdown">
+  {{- .Content -}}
+</article>
+{{ end }}
+
+{{ define "toc" }}
+  {{ partial "docs/toc" . }}
+{{ end }}

+ 10 - 0
docs/layouts/index.en.html

@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Vendure</title>
+</head>
+<body>
+<h1>This is tha docs innit!?</h1>
+</body>
+</html>

+ 3 - 0
docs/layouts/partials/docs/brand.html

@@ -0,0 +1,3 @@
+<h2 class="book-brand">
+  <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
+</h2>

+ 18 - 0
docs/layouts/partials/docs/git-footer.html

@@ -0,0 +1,18 @@
+{{ if or .GitInfo .Site.Params.BookEditPath }}
+<div class="align-center book-git-footer {{ if not .GitInfo }}justify-end{{ else }}justify-between{{ end }}">
+  {{ with .GitInfo }}
+  <div>
+    <a href="{{ $.Site.Params.BookRepo }}/commit/{{ .Hash }}" title='Last modified {{ .AuthorDate.Local.Format "January 2, 2006 15:04 MST" }} by {{ .AuthorName }}' target="_blank" rel="noopener">
+      <img src="{{ "svg/code-merge.svg" | absURL }}" /> {{ .AuthorDate.Local.Format "Last Modified Jan 2, 2006" }}
+    </a>
+  </div>
+  {{ end }}
+  {{ with .Site.Params.BookEditPath }}
+  <div>
+    <a href="{{ $.Site.Params.BookRepo }}/{{ . }}/{{ $.File.Path }}" target="_blank" rel="noopener">
+      <img src="{{ "svg/code-fork.svg" | absURL }}" /> Edit this page
+    </a>
+  </div>
+  {{ end }}
+</div>
+{{ end }}

+ 8 - 0
docs/layouts/partials/docs/html-head.html

@@ -0,0 +1,8 @@
+<meta charset="UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<title>{{- template "title" . }} | {{ .Site.Title -}}</title>
+
+<link href="https://fonts.googleapis.com/css?family=Oxygen|Oxygen+Mono:300,400,700" rel="stylesheet">
+<link rel="stylesheet" href="{{ "normalize.min.css" | absURL }}">
+{{ $styles := resources.Get "book.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
+<link rel="stylesheet" href="{{ $styles.RelPermalink }}">

+ 0 - 0
docs/layouts/partials/docs/inject/body.html


+ 0 - 0
docs/layouts/partials/docs/inject/head.html


+ 0 - 0
docs/layouts/partials/docs/inject/menu-after.html


+ 0 - 0
docs/layouts/partials/docs/inject/menu-before.html


+ 3 - 0
docs/layouts/partials/docs/menu-bundle.html

@@ -0,0 +1,3 @@
+{{ with .Site.GetPage .Site.Params.BookMenuBundle }}
+  {{- .Content -}}
+{{ end }}

+ 47 - 0
docs/layouts/partials/docs/menu-filetree.html

@@ -0,0 +1,47 @@
+<!-- Put configured sections list to .Scratch -->
+{{ template "book-get-root-section" . }} 
+
+{{- range .Scratch.Get "BookSections" -}}
+  {{ template "book-section" (dict "Section" . "CurrentPage" $.Permalink) }}
+{{- end -}}
+
+{{ define "book-section" }} <!-- Single section of menu (recursive) -->
+  <ul>
+    {{ range .Section.Sections }}
+    <li {{- if .Params.bookflatsection}} class="flat-section" {{ end }}>
+      {{- if .Content -}}
+        {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
+      {{- else -}}
+        {{- template "title" . -}}
+      {{- end -}}
+
+      {{ template "book-section" (dict "Section" . "CurrentPage" $.CurrentPage) }}
+    </li>
+    {{ end }}
+
+    {{ range .Section.Pages }}
+    <li>
+      {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
+    </li>
+    {{ end }}
+  </ul>
+{{ end }}
+
+{{ define "book-page-link" }}
+{{- with .Page -}}
+<a href="{{ .RelPermalink }}" {{- if eq $.CurrentPage .Permalink }} class="active"{{ end }}>
+  {{- template "title" . -}}
+</a>
+{{- end -}}
+{{ end }}
+
+{{ define "book-get-root-section" }}
+<!-- Complex logic to guess page title without .Title specified -->
+  {{ $bookSection := default "docs" .Site.Params.BookSection  }}
+  {{ if eq $bookSection "*" }}
+    {{ .Scratch.Set "BookSections" .Site.Sections }}
+  {{ else }}
+    {{ $bookSections := where .Site.Sections "Section" $bookSection }}
+    {{ .Scratch.Set "BookSections" $bookSections }}
+  {{ end }}
+{{ end }}

+ 6 - 0
docs/layouts/partials/docs/mobile-header.html

@@ -0,0 +1,6 @@
+<header class="align-center justify-between book-header">
+  <label for="menu-control">
+    <img src="{{ "svg/menu.svg" | absURL }}" />
+  </label>
+  <strong>{{- template "title" . }}</strong>
+</header>

+ 11 - 0
docs/layouts/partials/docs/shared.html

@@ -0,0 +1,11 @@
+<!-- These templates contains some more complex logic and shared between partials-->
+{{ define "title" }}
+  {{- if .Pages -}}
+    {{ $sections := split (trim .Dir "/") "/" }}
+    {{ $title := index ($sections | last 1) 0 | humanize | title }}
+    {{- default $title .Title -}}
+  {{- else -}}
+    {{ $title :=  .File | humanize | title }}
+    {{- default $title .Title -}}
+  {{- end -}}
+{{ end }}

+ 6 - 0
docs/layouts/partials/docs/toc.html

@@ -0,0 +1,6 @@
+{{ $showToC := default (default true .Site.Params.BookShowToC) .Params.bookshowtoc }}
+  {{ if and ($showToC) (.Page.TableOfContents) }}
+  <aside class="book-toc fixed">
+    {{ .Page.TableOfContents }}
+  </aside>
+{{ end }}

+ 19 - 0
docs/layouts/posts/baseof.html

@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+{{- partial "docs/shared" -}}
+<html>
+
+<head>
+  {{ partial "docs/html-head" . }}
+  {{ partial "docs/inject/head" . }}
+</head>
+
+<body>
+  <main class="book-posts mx-auto">
+    {{ template "main" . }}
+  </main>
+
+  {{ partial "docs/inject/body" . }}
+  {{ template "_internal/google_analytics_async.html" . }}
+</body>
+
+</html>

+ 20 - 0
docs/layouts/posts/list.html

@@ -0,0 +1,20 @@
+{{ define "main" }}
+  {{ $paginator := .Paginate (where .Pages "Params.hidden" "ne" true) }}
+  {{ range sort .Paginator.Pages }}
+  <article>
+    <h2>
+      <a href="{{ .Permalink }}">{{ .Title }}</a>
+    </h2>
+    <h5>
+      <strong>{{ .Date.Format "January 2, 2006" }}</strong>
+    </h5>
+    <p>
+      {{- .Summary -}}
+      {{ if .Truncated }}
+        <a href="{{ .Permalink }}">...</a>
+      {{ end }}
+    </p>
+  </article>
+  {{ end }}
+  {{ template "_internal/pagination.html" . }}
+{{ end }}

+ 11 - 0
docs/layouts/posts/single.html

@@ -0,0 +1,11 @@
+{{ define "main" }}
+<header>
+  <h1>{{ .Title }}</h1>
+  <h5>
+    <strong>{{ .Date.Format "January 2, 2006" }}</strong>
+  </h5>
+</header>
+<article class="markdown">
+  {{- .Content -}}
+</article>
+{{ end }}

+ 5 - 0
docs/readme.md

@@ -0,0 +1,5 @@
+# Vendure Docs
+
+This is the source for the Vendure documentation website. Docs are written in markdown and the website is generated with [Hugo](https://gohugo.io).
+
+Currently requires the extended Hugo binary (for Sass support).

+ 2 - 0
docs/static/normalize.min.css

@@ -0,0 +1,2 @@
+/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}
+/*# sourceMappingURL=normalize.min.css.map */

+ 1 - 0
docs/static/svg/code-fork.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M21 3c0-1.657-1.343-3-3-3s-3 1.343-3 3c0 1.323.861 2.433 2.05 2.832.168 4.295-2.021 4.764-4.998 5.391-1.709.36-3.642.775-5.052 2.085v-7.492c1.163-.413 2-1.511 2-2.816 0-1.657-1.343-3-3-3s-3 1.343-3 3c0 1.305.837 2.403 2 2.816v12.367c-1.163.414-2 1.512-2 2.817 0 1.657 1.343 3 3 3s3-1.343 3-3c0-1.295-.824-2.388-1.973-2.808.27-3.922 2.57-4.408 5.437-5.012 3.038-.64 6.774-1.442 6.579-7.377 1.141-.425 1.957-1.514 1.957-2.803zm-16.8 0c0-.993.807-1.8 1.8-1.8s1.8.807 1.8 1.8-.807 1.8-1.8 1.8-1.8-.807-1.8-1.8zm3.6 18c0 .993-.807 1.8-1.8 1.8s-1.8-.807-1.8-1.8.807-1.8 1.8-1.8 1.8.807 1.8 1.8zm10.2-16.2c-.993 0-1.8-.807-1.8-1.8s.807-1.8 1.8-1.8 1.8.807 1.8 1.8-.807 1.8-1.8 1.8z"/></svg>

+ 1 - 0
docs/static/svg/code-merge.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M5 18.184v-11.368c1.163-.413 2-1.511 2-2.816 0-1.657-1.343-3-3-3s-3 1.343-3 3c0 1.305.837 2.403 2 2.816v11.367c-1.163.414-2 1.512-2 2.817 0 1.657 1.343 3 3 3s3-1.343 3-3c0-1.305-.837-2.403-2-2.816zm-2.8-14.184c0-.993.807-1.8 1.8-1.8s1.8.807 1.8 1.8-.807 1.8-1.8 1.8-1.8-.807-1.8-1.8zm1.8 18.8c-.993 0-1.8-.807-1.8-1.8s.807-1.8 1.8-1.8 1.8.807 1.8 1.8-.807 1.8-1.8 1.8zm17-4.616v-11.184c0-2.206-1.794-4-4-4h-3v-3l-4 4 4 4v-3h3c1.103 0 2 .897 2 2v11.184c-1.163.413-2 1.512-2 2.816 0 1.657 1.343 3 3 3s3-1.343 3-3c0-1.305-.837-2.403-2-2.816zm-1 4.616c-.993 0-1.8-.807-1.8-1.8s.807-1.8 1.8-1.8 1.8.807 1.8 1.8-.807 1.8-1.8 1.8z"/></svg>

+ 1 - 0
docs/static/svg/menu.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>