kubes 0.7.4 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +7 -5
  4. data/docs/_docs/config/reference.md +1 -0
  5. data/docs/_docs/dsl/resources.md +1 -1
  6. data/docs/_docs/dsl.md +3 -3
  7. data/docs/_docs/intro/how-kubes-works.md +2 -0
  8. data/docs/_docs/intro/structure.md +2 -2
  9. data/docs/_docs/layering/{merge.md → merge-dsl.md} +0 -0
  10. data/docs/_docs/layering/merge-options.md +76 -0
  11. data/docs/_docs/layering.md +1 -1
  12. data/docs/_docs/vs/helm.md +3 -3
  13. data/docs/_includes/header.html +7 -0
  14. data/docs/_includes/layering/layers.md +12 -10
  15. data/docs/_includes/reference.md +1 -1
  16. data/docs/_includes/sidebar.html +2 -1
  17. data/docs/_sass/theme.scss +92 -0
  18. data/docs/index.html +2 -2
  19. data/docs/search/data.json +44 -0
  20. data/docs/search/index.html +30 -0
  21. data/docs/search/lunr.js +3475 -0
  22. data/docs/search/search.js +247 -0
  23. data/docs/search/tips.md +48 -0
  24. data/lib/kubes/cli/init.rb +2 -1
  25. data/lib/kubes/compiler/decorator/hashable/field.rb +41 -21
  26. data/lib/kubes/compiler/decorator/post.rb +12 -12
  27. data/lib/kubes/compiler/dsl/core/fields.rb +1 -1
  28. data/lib/kubes/compiler/dsl/syntax/resource.rb +2 -2
  29. data/lib/kubes/compiler/layering.rb +17 -15
  30. data/lib/kubes/compiler/strategy/dispatcher.rb +2 -2
  31. data/lib/kubes/compiler.rb +2 -1
  32. data/lib/kubes/config.rb +3 -0
  33. data/lib/kubes/core.rb +6 -0
  34. data/lib/kubes/docker/args/default.rb +0 -4
  35. data/lib/kubes/util/consider.rb +2 -2
  36. data/lib/kubes/version.rb +1 -1
  37. data/lib/templates/yaml/.kubes/resources/base/deployment.yaml.tt +0 -3
  38. data/lib/templates/yaml/.kubes/resources/shared/namespace.yaml.tt +0 -2
  39. data/spec/fixtures/decorators/deployment/configMap/volumes-name-first.yaml +14 -0
  40. data/spec/fixtures/decorators/deployment/configMap/volumes-name-second.yaml +14 -0
  41. data/spec/fixtures/decorators/ingress/tls.yaml +12 -0
  42. data/spec/kubes/compiler/decorator/post/deployment_spec.rb +25 -0
  43. data/spec/kubes/compiler/decorator/post/ingress_spec.rb +22 -0
  44. metadata +18 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4af2cf517b3700069f8a144a3f5baf8daa06622b2eb01233010e7bb5c767d9f5
4
- data.tar.gz: 42db274bfee2d38aa21487f2ffec104496174f7bbaff124437e2dd0807493708
3
+ metadata.gz: 55d217f4b05371a806a18151034bf36ff420fbc6724f1367c441d337a3ed71ad
4
+ data.tar.gz: 31912f0fb17ac8bb91acbc03cbb3cbbcd5f769170535ca7a48ea5dfe61aa0e40
5
5
  SHA512:
6
- metadata.gz: d7a6237881ee0e3bf0e87eb71badacb44be99b57f422a8ee703f475a5dc433c13b4ec4425018a40fbf869dca72253d32211edc7f04cf90d78496422370a9e81f
7
- data.tar.gz: dbea974415833b5d340ca6f02dfc2b6d9557eb7b461f33ac6775cafcec7b9a05523a7944df54b53ed3a05aba31bb9c67520c3a887bb3aac1273051e59977b902
6
+ metadata.gz: da80f1de9af4f31ae3b449261591979e499a70f29c85bea4aa2e87d2c4efba8c63ef6c09cd71a423e5164ed5f8598062d3ffbcb6cc5fb01855484a29794026d8
7
+ data.tar.gz: 926c67bb5cdef8be996b8ded90a251f4ef6643ea40aaa1a817ed596d6482dc1cfcecd6f99322730c0a68df5c113e7708b0c1222abdea2e299bcc79779cda2916
data/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.7.8] - 2021-10-29
7
+ - [#54](https://github.com/boltops-tools/kubes/pull/54) fix configMap and secret hash when not first element in Array
8
+
9
+ ## [0.7.7] - 2021-10-21
10
+ - [#51](https://github.com/boltops-tools/kubes/pull/51) add hash checksum for tls secretName
11
+ - [#52](https://github.com/boltops-tools/kubes/pull/52) add role all layer to pre_layers
12
+ - [#53](https://github.com/boltops-tools/kubes/pull/53) Merger options
13
+
14
+ ## [0.7.6] - 2021-10-12
15
+ - remove init yaml templates, removed duplication
16
+ - write full.yaml to .kubes/tmp instead
17
+
18
+ ## [0.7.5] - 2021-06-03
19
+ - [#47](https://github.com/boltops-tools/kubes/pull/47) add search
20
+ - [#48](https://github.com/boltops-tools/kubes/pull/48) use deep_merge overwrite_arrays option fixes #45
21
+
6
22
  ## [0.7.4] - 2021-03-02
7
23
  - [#46](https://github.com/boltops-tools/kubes/pull/46) call run method to respect config.suffix_hash
8
24
 
data/README.md CHANGED
@@ -8,15 +8,17 @@
8
8
 
9
9
  [![BoltOps Badge](https://img.boltops.com/boltops/badges/boltops-badge.png)](https://www.boltops.com)
10
10
 
11
- Kubernetes Deployment Tool: build docker image, compile Kubernetes YAML files, and apply them.
11
+ Kubernetes App Deploy Tool: build docker image, compile Kubernetes YAML files, and apply them.
12
+
13
+ Please **watch/star** this repo to help grow and support the project.
12
14
 
13
15
  Official Docs Site: [kubes.guru](https://kubes.guru)
14
16
 
15
17
  Kubes will:
16
18
 
17
19
  1. Build the docker image and push it to repo
18
- 2. Compile Kubernetes YAML files from YAML/ERB or a DSL and adjusts the Docker build image
19
- 3. Deploy via kubectl apply on the compiled Kubernetes YAML files
20
+ 2. Compile Kubernetes YAML files from YAML/ERB or a DSL with built Docker image
21
+ 3. Deploy via `kubectl apply` on the compiled Kubernetes YAML files
20
22
 
21
23
  ## Usage
22
24
 
@@ -40,7 +42,7 @@ Now, use `kubectl` directly in the proper order:
40
42
  kubectl apply -f .kubes/output/web/service.yaml
41
43
  kubectl apply -f .kubes/output/web/deployment.yaml
42
44
 
43
- You can also apply with kubes. This will compile the automatically files also.
45
+ You can also apply with kubes. This will automatically compile the files also.
44
46
 
45
47
  kubes apply
46
48
 
@@ -48,7 +50,7 @@ The deploy command, does all 3 steps: builds the docker image, compiles the `.ku
48
50
 
49
51
  kubes deploy
50
52
 
51
- ## Multiple Enviroments
53
+ ## Multiple Environments
52
54
 
53
55
  You can easily create multiple environments with the same YAML configs. Example:
54
56
 
@@ -20,3 +20,4 @@ repo_auto_auth | Whether or not to try to auth authorize docker repo registry if
20
20
  skip | List of resources to skip. Can also be set with the `KUBES_SKIP` env var. `KUBES_SKIP` should be a list of strings separated by spaces. It adds onto the `config.skip` option. | []
21
21
  state.path | Where to store the state file with the last build Docker image. | .kubes/state/KUBES_ENV/data.json
22
22
  suffix_hash | Whether or not to append suffix hash to ConfigMap and Secret | true
23
+ merger.options | Merger options that control how Hashes are merged. More info: [Merger Options]({% link _docs/layering/merge-options.md %}) | `{overwrite_arrays: true}`
@@ -6,7 +6,7 @@ Here's a list of the resources supported by the Kubes DSL.
6
6
 
7
7
  {% assign docs = site.docs | where: "categories","dsl" %}
8
8
  {% for doc in docs -%}
9
- * [{{ doc.nav_text }}]({{ doc.url }})
9
+ * [{{ doc.title }}]({{ doc.url }})
10
10
  {% endfor %}
11
11
 
12
12
  For resources, that are not supported, you can use the [Generic resource]({% link _docs/dsl/resources/generic.md %}) or use [YAML]({% link _docs/yaml.md %}) instead. You can use a mix of DSL and YAML definitions in the `.kubes/resources` folder.
data/docs/_docs/dsl.md CHANGED
@@ -58,9 +58,9 @@ Notice how `port` and `targetPort` correspond to `spec.ports.port` and `spec.por
58
58
 
59
59
  In general:
60
60
 
61
- * The DSL methods behave as reader methods when no arguments are passed to it. IE: `name "demo-web"` sets the value.
62
- * The DSL methods behave as writer methods when arguments are passed to it. IE: `name` returns the value.
61
+ * The DSL methods behave as reader methods when no arguments are passed to it. IE: `name` returns the value.
62
+ * The DSL methods behave as writer methods when arguments are passed to it. IE: `name "demo-web"` sets the value.
63
63
 
64
64
  ## Merge Behavior
65
65
 
66
- Generally, the merge should behave as expected. For example, map or Hash fields are merged together from multiple layers. Strings are simply replaced. See more details at [Layering Merge Behavior]({% link _docs/layering/merge.md %})
66
+ Generally, the merge should behave as expected. For example, map or Hash fields are merged together from multiple layers. Strings are simply replaced. See more details at [Layering Merge Behavior]({% link _docs/layering/merge-dsl.md %})
@@ -20,6 +20,8 @@ The deploy command simpifily does all 3 steps: build, compile, and apply.
20
20
 
21
21
  kubes deploy
22
22
 
23
+ Kubes is very transparent about it does. It prints out the `kubectl` commands as they are being called.
24
+
23
25
  You can also run the `kubectl apply` only. The `kube apply` command compiles but will skip the docker build stage if it's already been built.
24
26
 
25
27
  kubes apply
@@ -34,10 +34,10 @@ Here's what a .kubes folder structure can look like this:
34
34
 
35
35
  Name | Description
36
36
  --- | ---
37
- base | The base folder is processed first and can be used to define common fields and resources. Learn more on the [Layering Docs]({% link _docs/layering.md %}).
38
37
  config | The config folder can be used to configure behavior of Kubes. The [docker]({% link _docs/config/docker.md %}) config is used to customize the docker command. The [env]({% link _docs/config/env.md %}) config is used to override `config.rb` settings on a `KUBES_ENV` basis. The [kubectl]({% link _docs/config/kubectl.md %}) config is used to customize the kubectl command.
39
38
  config.rb | The main thing to configure here is the repo to push the docker image to.
40
39
  output | Where kubes builds and writes the Kubernetes YAML to.
41
40
  resources | Where you define your Kubernetes resources.
42
- shared | The shared folder is where you can put shared resources. This folder gets applied first. More info: [Ordering]({% link _docs/intro/ordering.md %}).
41
+ resources/base | The base folder is processed first and can be used to define common fields and resources. Learn more on the [Layering Docs]({% link _docs/layering.md %}).
42
+ resources/shared | The shared folder is where you can put shared resources. This folder gets applied first. More info: [Ordering]({% link _docs/intro/ordering.md %}).
43
43
  state | Temporary state info that stores the built Docker image name.
File without changes
@@ -0,0 +1,76 @@
1
+ ---
2
+ title: Merge Options
3
+ ---
4
+
5
+ Underneath the hood, Kubes uses the [danielsdeleo/deep_merge](https://github.com/danielsdeleo/deep_merge) library to merge layers together. You can control the merge behavior options with [config.merger.options]({% link _docs/config/reference.md %}).
6
+
7
+ The default merge options is:
8
+
9
+ {overwrite_arrays: true}
10
+
11
+ You can control the merge behavior by setting:
12
+
13
+ .kubes/config.rb
14
+
15
+ ```ruby
16
+ Kubes.configure do |config|
17
+ # ...
18
+ config.merger.options = {overwrite_arrays: false}
19
+ end
20
+ ```
21
+
22
+ See the [danielsdeleo/deep_merge](https://github.com/danielsdeleo/deep_merge) docs for the different options.
23
+
24
+ ## Example of overwrite_arrays false
25
+
26
+ An example of where you might want to use `{overwrite_arrays: false}` is if you are using YAML and want a base sidecar container in all of your deployments.
27
+
28
+ .kubes/resources/base/deployment.yaml
29
+
30
+ ```yaml
31
+ spec:
32
+ template:
33
+ spec:
34
+ containers:
35
+ - name: sidecar
36
+ image: sidecar-image
37
+ ```
38
+
39
+ .kubes/resources/web/deployment.yaml
40
+
41
+ ```yaml
42
+ spec:
43
+ template:
44
+ metadata:
45
+ labels:
46
+ role: web
47
+ spec:
48
+ containers:
49
+ - name: web
50
+ image: <%= docker_image %>
51
+ ```
52
+
53
+ Produces:
54
+
55
+ ```yaml
56
+ # ...
57
+ spec:
58
+ template:
59
+ metadata:
60
+ labels:
61
+ role: web
62
+ spec:
63
+ containers:
64
+ - name: sidecar
65
+ image: sidecar-image
66
+ - name: web
67
+ image: gcr.io/boltops-learn/demo:kubes-2021-10-21T18-06-48
68
+ # ...
69
+ ```
70
+
71
+ However, using this merge behavior will also add additional ports if you are assigning a `targetPort` in the DSL. See:
72
+
73
+ * [DSL in service creates always default port 80 #45](https://github.com/boltops-tools/kubes/issues/45)
74
+ * [use deep_merge overwrite_arrays option #48](https://github.com/boltops-tools/kubes/pull/48)
75
+
76
+ Will welcome PRs for improvements.
@@ -7,4 +7,4 @@ Kubes supports layering files together so you can use the same Kubernetes files
7
7
  * [YAML Layering]({% link _docs/layering/yaml.md %})
8
8
  * [DSL Layering]({% link _docs/layering/dsl.md %})
9
9
  * [Mix Layering]({% link _docs/layering/mix.md %})
10
- * [Merge Behavior]({% link _docs/layering/merge.md %})
10
+ * [Merge Behavior]({% link _docs/layering/merge-dsl.md %})
@@ -4,7 +4,7 @@ nav_text: Helm
4
4
  categories: vs
5
5
  ---
6
6
 
7
- Though both Kubes and Helm can be used to deploy applications to Kubernetes, they work quite differently. Kubernetes is more focused on deploying your application. Helm is more like a package manager.
7
+ Kubes and Helm are quite different. Helm is a package manager tool. In contrast, Kubernetes is focused on deploying your application. While you can use package manager tools like Helm to deploy your application, application-focused deploy tools are better for the job. For example, apt-get and yum are also package manager tools. But few companies use `apt-get install` or `yum install` to deploy their application code. Instead, people usually use application-specific tools to deploy their web app.
8
8
 
9
9
  {% include vs/article.md %}
10
10
 
@@ -168,7 +168,7 @@ Helm supports a wide variety of hooks for the install, delete, upgrade, and roll
168
168
 
169
169
  Kubes also supports hook as the kubes-level; this is similar to the helm-level. Kubes also provide finer-grain control hooks at the kubectl-level.
170
170
 
171
- Overally, Helm and Kubes hooks work quite differently. We'll take a look at **some** examples:
171
+ Overall, Helm and Kubes hooks work quite differently. We'll take a look at **some** examples:
172
172
 
173
173
  ### Helm Hook Example
174
174
 
@@ -240,4 +240,4 @@ Kubes supports the deployment workflow. It can build the docker image from your
240
240
 
241
241
  ## Summary
242
242
 
243
- Helm and Kubes are quite different. Helm is a full-fledge package management. Kubes is a more focused on deployment. Both tools support templating logic to help keep your code DRY. Additionally, Kubes supports layering to merge YAML files together for DRYness. Kubes also helps you build your Docker images.
243
+ Helm and Kubes are quite different. Helm is a full-fledge package management tool. In contrast, Kubes is more focused on app deployment. Both tools support templating logic to help keep your code DRY. Additionally, Kubes supports layering to merge YAML files together for DRYness. Kubes also helps you build your Docker images.
@@ -2,6 +2,13 @@
2
2
  <nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
3
3
  <a class="navbar-brand" href="/"><img class="navbar-logo" src="/img/logos/kubes-black.png" /></a>
4
4
 
5
+ {% if page.url != '/' %}
6
+ <form class="search-form form-group has-search" method="get" action="/search" data-search-form>
7
+ <span class="fa fa-search form-control-feedback"></span>
8
+ <input type="text" class="form-control" name="q" id="q" placeholder="Search docs" data-search-input />
9
+ </form>
10
+ {% endif %}
11
+
5
12
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
6
13
  <span class="navbar-toggler-icon"></span>
7
14
  </button>
@@ -11,6 +11,7 @@ Here's an example structure, so we can understand how layering works.
11
11
  ├── clock
12
12
  │ └── deployment.{{ include.ext }}
13
13
  └── web
14
+ ├── all.{{ include.ext }}
14
15
  ├── deployment
15
16
  │ ├── dev.{{ include.ext }}
16
17
  │ └── prod.{{ include.ext }}
@@ -34,16 +35,17 @@ Notes
34
35
 
35
36
  Here's a table showing the the full layering.
36
37
 
37
- Folder/Pattern | Example
38
- -------------------|--------------------------------------------
39
- base/all.{{ include.ext }} | base/all.{{ include.ext }}
40
- base/all/ENV.{{ include.ext }} | base/all/dev.{{ include.ext }}
41
- base/KIND.{{ include.ext }} | base/deployment.{{ include.ext }}
42
- base/KIND/base.{{ include.ext }} | base/deployment/base.{{ include.ext }}
43
- base/KIND/ENV.{{ include.ext }} | base/deployment/dev.{{ include.ext }}
44
- ROLE/KIND.{{ include.ext }} | web/deployment.{{ include.ext }}
45
- ROLE/KIND/base.{{ include.ext }} | web/deployment/base.{{ include.ext }}
46
- ROLE/KIND/ENV.{{ include.ext }} | web/deployment/dev.{{ include.ext }}
38
+ Type | Folder/Pattern | Example
39
+ ---|---|---
40
+ pre | base/all.{{ include.ext }} | base/all.{{ include.ext }}
41
+ pre | base/all/ENV.{{ include.ext }} | base/all/dev.{{ include.ext }}
42
+ pre | base/KIND.{{ include.ext }} | base/deployment.{{ include.ext }}
43
+ pre | base/KIND/base.{{ include.ext }} | base/deployment/base.{{ include.ext }}
44
+ pre | base/KIND/ENV.{{ include.ext }} | base/deployment/dev.{{ include.ext }}
45
+ pre | ROLE/all.{{ include.ext }} | web/all.{{ include.ext }}
46
+ main | ROLE/KIND.{{ include.ext }} | web/deployment.{{ include.ext }}
47
+ post | ROLE/KIND/base.{{ include.ext }} | web/deployment/base.{{ include.ext }}
48
+ post | ROLE/KIND/ENV.{{ include.ext }} | web/deployment/dev.{{ include.ext }}
47
49
 
48
50
  ## Real-World Uses
49
51
 
@@ -1,3 +1,3 @@
1
- Kubes is a Kubernetes deployment tool. It automates the deployment process. Kubes will:
1
+ Kubes is a Kubernetes deployment tool. It focuses on deploying your specific application. It is very good at automating the deployment process. Kubes will:
2
2
 
3
3
  {% include kubes-steps.md %}
@@ -97,7 +97,8 @@
97
97
  <li><a href="{% link _docs/layering/yaml.md %}">YAML</a></li>
98
98
  <li><a href="{% link _docs/layering/dsl.md %}">DSL</a></li>
99
99
  <li><a href="{% link _docs/layering/mix.md %}">Mix</a></li>
100
- <li><a href="{% link _docs/layering/merge.md %}">Merge Behavior</a></li>
100
+ <li><a href="{% link _docs/layering/merge-dsl.md %}">Merge DSL</a></li>
101
+ <li><a href="{% link _docs/layering/merge-options.md %}">Merge Options</a></li>
101
102
  </ul>
102
103
  </li>
103
104
  <li><a href="{% link _docs/dsl.md %}">DSL</a>
@@ -315,3 +315,95 @@ ul.toc {
315
315
  height:100%;
316
316
  }
317
317
  }
318
+
319
+
320
+ #search-field {
321
+ // background-color: purple;
322
+
323
+ td {
324
+ padding: 0;
325
+ margin: 0;
326
+ border: none;
327
+ }
328
+
329
+ table {
330
+ // background-color: orange;
331
+ border: none;
332
+ margin: 0;
333
+ }
334
+
335
+ .gsc-input-box td {
336
+ vertical-align: top;
337
+ // padding-top: 15px;
338
+ }
339
+ }
340
+
341
+ .search-result {
342
+ padding-bottom: 24px;
343
+ }
344
+
345
+ .search-tips {
346
+ border: 1px solid gray;
347
+ // background-color: red;
348
+ font-size: 0.9em;
349
+ padding: 10px;
350
+ margin-bottom: 15px;
351
+ p {
352
+ margin: 0;
353
+ }
354
+ }
355
+
356
+ .search-terms {
357
+ background-color: #ffffcb;
358
+ padding: 0.25em;
359
+ }
360
+
361
+ .search-count {
362
+ font-weight: bold;
363
+ }
364
+
365
+
366
+ .top-bar {
367
+ .has-search {
368
+ // mobile
369
+ // without padding-left its centered
370
+ margin: 0;
371
+ padding: 0;
372
+ width: 200px;
373
+ // desktop
374
+ @media (min-width: 500px) {
375
+ // without padding-left its centered
376
+ width: 320px;
377
+ }
378
+ @media (min-width: 600px) {
379
+ // without padding-left its centered
380
+ width: 400px;
381
+ }
382
+ @media (min-width: 768px) {
383
+ padding-left: 64px;
384
+ width: 512px;
385
+ }
386
+
387
+
388
+ .form-control-feedback {
389
+ position: absolute;
390
+ z-index: 2;
391
+ width: 2.375rem;
392
+ height: 2.375rem;
393
+ line-height: 2.375rem;
394
+ text-align: center;
395
+ pointer-events: none;
396
+ color: #aaa;
397
+ }
398
+
399
+ .form-control {
400
+ padding-left: 2.375rem;
401
+ width: 100%;
402
+ display: inline;
403
+ }
404
+
405
+ input {
406
+ width: auto;
407
+ }
408
+ }
409
+ }
data/docs/index.html CHANGED
@@ -9,8 +9,8 @@ sidebar: false
9
9
  <div class="col-sm-8 col-sm-offset-2">
10
10
  <div class="header-content">
11
11
  <div class="header-content-inner">
12
- <h1>Kubes: Kubernetes Deployment Tool</h1>
13
- <h2>Kubes is a Kubernetes Deployment Tool. It builds the docker image, creates the Kubernetes YAML, and runs kubectl apply. It automates the deployment process and saves you precious finger-typing energy.</h2>
12
+ <h1>Kubes: Kubernetes App Deploy Tool</h1>
13
+ <h2>Kubes is a Kubernetes App Deployment Tool. It focuses on deploying your specific application. It builds the docker image, creates the Kubernetes YAML, and runs kubectl apply. It automates the deployment process and saves you precious finger-typing energy.</h2>
14
14
  </div>
15
15
  </div>
16
16
  </div>
@@ -0,0 +1,44 @@
1
+ ---
2
+ layout: null
3
+ ---
4
+ {% assign first = true %}
5
+ [
6
+ {% for doc in site.docs %}
7
+ {% if doc.title != null and doc.title != empty %}
8
+ {% unless first %},{% endunless %}{
9
+ "title": {{doc.title | jsonify}},
10
+ "search_title": {{doc.search_title | jsonify}},
11
+ "content": {{doc.content | markdownify | strip_html | replace:'├','' | replace:'└','' | replace:'─','' | replace:'│','' | jsonify}},
12
+ "link": "{{ site.baseurl }}{{ doc.url }}",
13
+ "search_omit": "{{ doc.search_omit }}"
14
+ }
15
+ {% assign first = false %}
16
+ {% endif %}
17
+ {% endfor %}
18
+
19
+ {% for post in site.posts %}
20
+ {% if post.title != null and post.title != empty %}
21
+ {% unless first %},{% endunless %}{
22
+ "title": {{post.title | jsonify}},
23
+ "search_title": {{doc.search_title | jsonify}},
24
+ "content": {{post.content | markdownify | strip_html | jsonify}},
25
+ "link": "{{ site.baseurl }}{{ post.url }}",
26
+ "search_omit": "{{ post.search_omit }}"
27
+ }
28
+ {% assign first = false %}
29
+ {% endif %}
30
+ {% endfor %}
31
+
32
+ {% for page in site.pages %}
33
+ {% if page.title != null and page.title != empty %}
34
+ {% unless first %},{% endunless %}{
35
+ "title": {{page.title | jsonify}},
36
+ "search_title": {{doc.search_title | jsonify}},
37
+ "content": {{page.content | markdownify | strip_html | jsonify}},
38
+ "link": "{{ site.baseurl }}{{ page.url | replace: 'index.html', '' }}",
39
+ "search_omit": "{{ page.search_omit }}"
40
+ }
41
+ {% assign first = false %}
42
+ {% endif %}
43
+ {% endfor %}
44
+ ]
@@ -0,0 +1,30 @@
1
+ ---
2
+ title: Search
3
+ search_omit: true
4
+ ---
5
+
6
+ <div class="search-tips">
7
+ <h3>Search Tips:</h3>
8
+ <p>To OR search terms: "install aws"</p>
9
+ <p>To AND search terms: "+install +aws"</p>
10
+ <p>To filter or reject search terms: "-aws"</p>
11
+ <p>More: <a href="{% link search/tips.md %}">Search Tips</a></p>
12
+ </div>
13
+
14
+ <!-- Search results placeholder -->
15
+ <p class="search-summary" data-search-found>
16
+ <span class="search-count" data-search-found-count></span> <span data-search-found-word>results</span> found for: <span class="search-terms" data-search-found-term></span>
17
+ </p>
18
+ <div data-search-results></div>
19
+
20
+ <!-- Search result template -->
21
+ <script type="text/x-template" id="search-result">
22
+ <div class="search-result">
23
+ <h3><a href="##Url##">##Title##</a></h3>
24
+ <div class="content">##Content##</div>
25
+ </div>
26
+ </script>
27
+
28
+ <!-- Search script - Must appear after template -->
29
+ <script src="/search/lunr.js"></script>
30
+ <script src="/search/search.js"></script>