Skip to content

Commit e6527cf

Browse files
committed
Keep using old public target. add search back
Signed-off-by: Marc Duiker <[email protected]>
1 parent 9b7704e commit e6527cf

File tree

14 files changed

+29
-508
lines changed

14 files changed

+29
-508
lines changed

daprdocs/assets/scss/_code.scss.temp

Lines changed: 0 additions & 79 deletions
This file was deleted.

daprdocs/assets/scss/_sidebar-tree.scss.temp

Lines changed: 0 additions & 161 deletions
This file was deleted.

daprdocs/content/en/contributing/docs-contrib/contributing-docs.md

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -260,105 +260,6 @@ brew install dapr/tap/dapr-cli
260260

261261
{{< /tabpane >}}
262262

263-
### Embedded code snippets
264-
265-
Use the `code-snippet` shortcode to reference code snippets from the `static/code` directory.
266-
267-
```
268-
{{%/* code-snippet file="myfile.py" lang="python" */%}}
269-
```
270-
271-
{{% alert title="Warning" color="warning" %}}
272-
All Dapr sample code should be self-contained in separate files, not in markdown. Use these techniques to highlight the parts of the sample code users should focus on.
273-
{{% /alert %}}
274-
275-
Use the `lang` (default `txt`) parameter to configure the language used for syntax highlighting.
276-
277-
Use the `marker` parameter to limit the embedded snipped to a portion of the sample file. This is useful when you want to show just a portion of a larger file. Typically, you'd do this by:
278-
279-
1. Surrounding the interesting code with comments.
280-
1. Passing the comment text into `marker`.
281-
282-
The shortcode below and code sample:
283-
284-
```
285-
{{%/* code-snippet file="./contributing-1.py" lang="python" marker="#SAMPLE" */%}}
286-
```
287-
288-
```python
289-
import json
290-
import time
291-
292-
from dapr.clients import DaprClient
293-
294-
#SAMPLE
295-
with DaprClient() as d:
296-
req_data = {
297-
'id': 1,
298-
'message': 'hello world'
299-
}
300-
301-
while True:
302-
# Create a typed message with content type and body
303-
resp = d.invoke_method(
304-
'invoke-receiver',
305-
'my-method',
306-
data=json.dumps(req_data),
307-
)
308-
309-
# Print the response
310-
print(resp.content_type, flush=True)
311-
print(resp.text(), flush=True)
312-
313-
time.sleep(2)
314-
#SAMPLE
315-
```
316-
317-
Will result in the following output:
318-
319-
{{% code-snippet file="contributing-1.py" lang="python" marker="#SAMPLE" %}}
320-
321-
Use the `replace-key-[token]` and `replace-value-[token]` parameters to limit the embedded snipped to a portion of the sample file. This is useful when you want abbreviate a portion of the code sample. Multiple replacements are supported with multiple values of `token`.
322-
323-
The shortcode below and code sample:
324-
325-
```
326-
{{%/* code-snippet file="./contributing-2.py" lang="python" replace-key-imports="#IMPORTS" replace-value-imports="# Import statements" */%}}
327-
```
328-
329-
```python
330-
#IMPORTS
331-
import json
332-
import time
333-
#IMPORTS
334-
335-
from dapr.clients import DaprClient
336-
337-
with DaprClient() as d:
338-
req_data = {
339-
'id': 1,
340-
'message': 'hello world'
341-
}
342-
343-
while True:
344-
# Create a typed message with content type and body
345-
resp = d.invoke_method(
346-
'invoke-receiver',
347-
'my-method',
348-
data=json.dumps(req_data),
349-
)
350-
351-
# Print the response
352-
print(resp.content_type, flush=True)
353-
print(resp.text(), flush=True)
354-
355-
time.sleep(2)
356-
```
357-
358-
Will result in the following output:
359-
360-
{{% code-snippet file="./contributing-2.py" lang="python" replace-key-imports="#IMPORTS" replace-value-imports="# Import statements" %}}
361-
362263
### YouTube videos
363264

364265
Hugo can automatically embed YouTube videos using a shortcode:

daprdocs/layouts/_partials/hooks/body-end.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script src="/js/copy-code-button.js"></script>
22

3-
{{ with .Site.Params.algolia_docsearch }}
3+
{{ with .Site.Params.search.algolia }}
44
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
55
<script type="text/javascript">
66
docsearch({
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{{ with .Site.Params.algolia_docsearch }}
1+
{{ with .Site.Params.search.algolia }}
22
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
33
{{ end }}

daprdocs/layouts/_partials/search-input.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{{ if .Site.Params.gcs_engine_id -}}
22
<input type="search" class="form-control td-search-input" placeholder="&#xf002; {{ T "ui_search" }}" aria-label="{{ T "ui_search" }}" autocomplete="off">
3-
{{ else if .Site.Params.algolia_docsearch -}}
3+
{{ else if .Site.Params.search.algolia -}}
44
<div id="docsearch"></div>
5-
{{ else if .Site.Params.offlineSearch -}}
5+
{{ else if .Site.Params.search.offlineSearch -}}
66
{{ $offlineSearchIndex := resources.Get "json/offline-search-index.json" | resources.ExecuteAsTemplate "offline-search-index.json" . -}}
77
{{ if hugo.IsProduction -}}
88
{{/* Use `md5` as finger print hash function to shorten file name to avoid `file name too long` error. */ -}}

0 commit comments

Comments
 (0)