Assets

Customize Doks SCSS, Doks JS, or the FlexSearch index. Add a Lambda function.

..
├── fonts/
├── images/
├── js/
│   ├── vendor/
│   ├── app.js
│   └── index.js
├── lambda/
└── scss/
    ├── common/
    ├── components/
    ├── layouts/
    ├── vendor/
    └── app.scss

See also the Hugo docs: Hugo Pipes.

Customize Doks SCSS

See also the Bootstrap code: Variables.

./assets/scss/app.scss

Customize Doks JS

./assets/js/app.js

Customize FlexSearch index

See also: FlexSearch

./assets/js/index.js
var docs = [
{{ range $index, $page := (where .Site.Pages "Section" "docs") -}}
  {
    id: {{ $index }},
    href: "{{ .RelPermalink | relURL }}",
    title: {{ .Title | jsonify }},
    description: {{ .Params.description | jsonify }},
    content: {{ .Content | jsonify }}
  },
{{ end -}}
];

Add a Lambda function

See also: Functions

Example

./assets/lambda/hi-from-lambda.js
exports.handler = (event, context, callback) => {
  callback (null, {
    statusCode: 200,
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      message: 'Hi from Lambda.',
    }),
  });
}

Edit this page on GitHub