Assets

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

On this page

  1. ..
  2. ├── fonts/
  3. ├── images/
  4. ├── js/
  5. ├── vendor/
  6. ├── app.js
  7. └── index.js
  8. ├── lambda/
  9. └── scss/
  10. ├── common/
  11. ├── components/
  12. ├── layouts/
  13. ├── vendor/
  14. └── app.scss

See also the Hugo docs: Hugo Pipes.

Customize Doks SCSS

👉

Set variables in `./assets/scss/common/_variables.scss`.

See also the Bootstrap code: Variables.

  1. ./assets/scss/app.scss

Customize Doks JS

  1. ./assets/js/app.js

Customize FlexSearch index

See also: FlexSearch

  1. ./assets/js/index.js
  1. var docs = [
  2. {{ range $index, $page := (where .Site.Pages "Section" "docs") -}}
  3. {
  4. id: {{ $index }},
  5. href: "{{ .RelPermalink | relURL }}",
  6. title: {{ .Title | jsonify }},
  7. description: {{ .Params.description | jsonify }},
  8. content: {{ .Content | jsonify }}
  9. },
  10. {{ end -}}
  11. ];

Add a Lambda function

See also: Functions

Example

  1. ./assets/lambda/hi-from-lambda.js
  1. exports.handler = (event, context, callback) => {
  2. callback (null, {
  3. statusCode: 200,
  4. headers: {
  5. 'Content-Type': 'application/json',
  6. },
  7. body: JSON.stringify({
  8. message: 'Hi from Lambda.',
  9. }),
  10. });
  11. }