-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0033e71
commit 061276e
Showing
7 changed files
with
647 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# The Tito Widget | ||
|
||
This is an experiment to see if we can use Netlify's [Deploy to Netlify](https://docs.netlify.com/site-deploys/create-deploys/#deploy-to-netlify-button) button to make it really easy to setup a website using the [Tito Widget](https://help.tito.io/en/articles/2003029-widget). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[template.environment] | ||
TITLE = "Awesome Conf" | ||
EVENT = "demo/awesomeconf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "netlify-tito-widget", | ||
"version": "0.0.1", | ||
"description": "Deploy the Tito widget to Netlify", | ||
"main": "index.js", | ||
"scripts": { | ||
"generate": "node ./scripts/generate", | ||
"dev": "serve ./dist" | ||
}, | ||
"keywords": [], | ||
"author": "Team Tito", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"fs-extra": "^9.0.1", | ||
"serve": "^11.3.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const fse = require("fs-extra"); | ||
|
||
const data = fse.readFileSync("src/index.html"); | ||
const slug = process.env.EVENT || "demo/awesomeconf"; | ||
const widget = `<tito-widget event="${slug}"></tito-widget>`; | ||
const title = process.env.TITLE || "Tito Widget"; | ||
const html = data | ||
.toString() | ||
.replace(/{{ WIDGET }}/g, widget) | ||
.replace(/{{ TITLE }}/g, title) | ||
.replace(/{{ EVENT }}/g, slug); | ||
fse.mkdirsSync("dist"); | ||
fse.writeFileSync("dist/index.html", html); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>{{ TITLE }}</title> | ||
<link rel="stylesheet" type="text/css" href="https://css.tito.io/v1.1" /> | ||
<script src="https://js.tito.io/v1" async></script> | ||
<link | ||
href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" | ||
rel="stylesheet" | ||
/> | ||
<script type="text/javascript"> | ||
TitoDevelopmentMode = true; | ||
</script> | ||
</head> | ||
<body class="flex flex-col h-screen justify-between"> | ||
<header class="p-10"> | ||
<h1 class="font-bold text-3xl">{{ TITLE }}</h1> | ||
</header> | ||
<main class="p-10"> | ||
{{ WIDGET }} | ||
</main> | ||
<footer class="p-5 bg-gray-100 text-right"> | ||
Hosted by | ||
<a | ||
href="https://ti.to/{{ EVENT }}" | ||
class="text-blue-500 underline hover:text-blue-700" | ||
>Tito</a | ||
> | ||
</footer> | ||
</body> | ||
</html> |
Oops, something went wrong.