Skip to content

Commit

Permalink
should be simpler but I want to launch :S
Browse files Browse the repository at this point in the history
  • Loading branch information
wolulcmit committed May 10, 2024
1 parent e2cda7f commit 0a7850f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 13 deletions.
7 changes: 1 addition & 6 deletions server/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { oakAdapter, etaEngine, viewEngine, Application, Router, staticFileRoutes, Status } from "./deps.ts";
import { getLikes, updateLikes } from "./service.ts";

//installGlobals();

const app = new Application();

app.use(
Expand All @@ -11,13 +9,11 @@ app.use(
})
);

// deno-lint-ignore no-explicit-any
async function updateLikesHandler(ctx: any) {
const likes = await updateLikes(ctx);
ctx.render("likes-done.html", {likes: likes});
}

// deno-lint-ignore no-explicit-any
async function getLikesHandler(ctx: any) {
const {likes, alreadyLiked} = await getLikes(ctx);

Expand All @@ -28,7 +24,6 @@ async function getLikesHandler(ctx: any) {
}
}

// deno-lint-ignore no-explicit-any
async function getUnLikesHandler(ctx: any) {
const likes = await updateLikes(ctx);
ctx.render("likes.html", {likes: likes});
Expand All @@ -41,7 +36,7 @@ router
.post("/unlikes.html", getUnLikesHandler)
.post("/likes.html", updateLikesHandler)

// checks for static routes (real html files generated by 11ty in the _site directory)
// checks for static routes (real html files generated by 11ty in the _site directory) and uses them if they exist
app.use(staticFileRoutes);

app.use(router.routes());
Expand Down
1 change: 1 addition & 0 deletions src/_includes/webc/c-footer.webc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<style webc:scoped>
:host {
margin-top: var(--space-3);
padding: var(--space) calc(var(--space) * 1.5);
background-color: var(--foreground-100);
display: flex;
Expand Down
12 changes: 10 additions & 2 deletions src/content/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ title: Deno
tags: pages
---

## What the? How do I use this
## How do I use this?

I made a blog post about this project which has [more detail](http://cssandstuff.deno.dev/writing/pairing-eleventy-with-htmx-and-deno/), you can visit.
### Installing Deno

To install Deno, follow the [docs here](https://docs.deno.com/runtime/manual/getting_started/installation),
You can then clone or download [this starter](https://github.com/cssandstuff/11ty-deno-htmx)

For local development run the deno command: <pre>deno task dev</pre>
to deploy to deno.deploy you just need to [sign up for an account](https://deno.com/deploy), then once logged in you can create a new project and point it to your github repo.

<!-- I made a blog post about this project which has [more details](http://cssandstuff.deno.dev/writing/pairing-eleventy-with-htmx-and-deno/). -->

26 changes: 22 additions & 4 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,28 @@
color: var(--denogrey);
font-family: var(--fontFam);
}

h3{
color: var(--pink);
}

pre{
display: block;
background: var(--black);
color: var(--white);
padding: 0.5em;
border-radius: 4px;
font-size: 1rem;
}



main p{
line-height: 1.2;
color: var(--denogreydark);
margin-bottom: var(--space-3);
}



a{
text-underline-offset: 0.3em;
text-decoration-color: var(--underline-resting);
Expand Down Expand Up @@ -139,8 +154,11 @@
display: none;
}
#main div > *+* {
display: block;
margin-top: calc(var(--margin)/2);
margin-top: calc(var(--space));
}

#main div > *:not(h2)+*:is(h2,h3) {
margin-top: var(--space-2);
}

.visually-hidden {
Expand Down
2 changes: 1 addition & 1 deletion src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Now that Eleventy supports ESM (from version 3.x), it means we can use it in pla

## Deno

Deno is a fast, secure and great alternative to Node and now supports most of the node ecosystem, so it seems like a great time to try and bring the two together in a starter project, and that's exactly what this is. Deno.deploy is also a super great place to try out ideas and has native key-pair database for doing server-side like things.
Deno is a fast, secure and great alternative to Node and now supports most of the node ecosystem, so it seems like a great time to try and bring the two together in a starter project, and that's exactly what this is. You can host staticly on Deno, but then there's room to do server stuff too if you want.

## Htmx

Expand Down

0 comments on commit 0a7850f

Please sign in to comment.