mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2026-03-27 09:28:43 +07:00
test workflow embed on netlify
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,3 +12,4 @@ yarn.lock
|
||||
venv
|
||||
env
|
||||
site
|
||||
__pycache__/
|
||||
|
||||
@@ -32,7 +32,11 @@
|
||||
https://plausible.io/docs/script-extensions?ref=ryansechrest.com#all-our-script-extensions
|
||||
-->
|
||||
<script defer {% if page.meta and page.meta.contentType %}event-content_type="{{ page.meta.contentType }}"{% endif %} data-domain="docs.n8n.io" src="https://plausible.io/js/script.file-downloads.outbound-links.pageview-props.js"></script>
|
||||
|
||||
|
||||
<!-- n8n Workflow Preview Service -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2.0.0/webcomponents-loader.js"></script>
|
||||
<script src="https://www.unpkg.com/lit@2.0.0-rc.2/polyfill-support.js"></script>
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/@n8n_io/n8n-demo-component/n8n-demo.bundled.js"></script>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -147,4 +151,6 @@ https://plausible.io/docs/script-extensions?ref=ryansechrest.com#all-our-script-
|
||||
plausible("Video: Ended", { props: { page: pagePath, video: videoPath } });
|
||||
}
|
||||
</script>
|
||||
|
||||
<!---->
|
||||
{% endblock %}
|
||||
|
||||
File diff suppressed because one or more lines are too long
12
main.py
Normal file
12
main.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import requests
|
||||
|
||||
def define_env(env):
|
||||
"Hook function"
|
||||
|
||||
@env.macro
|
||||
def workflowDemo(workflow_endpoint):
|
||||
r = requests.get(url = workflow_endpoint)
|
||||
workflow_json = r.content.decode("utf-8")
|
||||
print(workflow_json)
|
||||
return f"<div class='workflow_preview'><n8n-demo clicktointeract='true' frame='true' collapseformobile='false' workflow={workflow_json}></n8n-demo></div>"
|
||||
|
||||
Reference in New Issue
Block a user