test workflow embed on netlify

This commit is contained in:
Deborah Barnard
2024-07-01 11:59:37 +01:00
parent c03a00ec66
commit 14bf0cb7c8
4 changed files with 29 additions and 1 deletions

1
.gitignore vendored
View File

@@ -12,3 +12,4 @@ yarn.lock
venv
env
site
__pycache__/

View File

@@ -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
View 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>"