Skip to content

Commit

Permalink
upgrade to tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
deer committed Jan 11, 2024
1 parent 113be18 commit c4f1501
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 60 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy
on:
push:
branches: [main]
pull_request:
branches: main

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest

permissions:
id-token: write
contents: read

steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Build step
run: "deno task build"

- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: "rvr-blog"
entrypoint: "./main.ts"
39 changes: 17 additions & 22 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,25 @@
"tasks": {
"start": "deno run -A --watch=static/,routes/,posts/ dev.ts",
"newpost": "deno run --allow-read --allow-write utils/newpost.ts",
"update": "deno run -A -r https://fresh.deno.dev/update ."
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
"update": "deno run -A -r https://fresh.deno.dev/update .",
"build": "deno run -A dev.ts build",
"preview": "deno run -A main.ts"
},
"compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" },
"imports": {
"$fresh/": "https://raw.githubusercontent.com/denoland/fresh/21c72abeccd163c2dbac1477d28dd2f648808f87/",
"preact": "https://esm.sh/preact@10.15.1",
"preact/": "https://esm.sh/preact@10.15.1/",
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.0",
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.2.3",
"twind": "https://esm.sh/twind@0.16.19",
"twind/": "https://esm.sh/twind@0.16.19/",
"$fresh/": "https://deno.land/x/fresh@1.6.1/",
"preact": "https://esm.sh/preact@10.19.3",
"preact/": "https://esm.sh/preact@10.19.3/",
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.3.1",
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.2",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.1",
"tailwindcss": "npm:tailwindcss@3.4.1",
"tailwindcss/": "npm:/tailwindcss@3.4.1/",
"tailwindcss/plugin": "npm:/tailwindcss@3.4.1/plugin.js",
"@/": "./",
"./": "./"
"./": "./",
"$std/": "https://deno.land/std@0.211.0/"
},
"lint": {
"rules": {
"tags": [
"fresh",
"recommended"
]
}
}
"lint": { "rules": { "tags": ["fresh", "recommended"] } },
"exclude": ["**/_fresh/*"]
}
24 changes: 24 additions & 0 deletions fresh.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { defineConfig } from "$fresh/server.ts";
import tailwind from "$fresh/plugins/tailwind.ts";

import {
BlogOptions,
blogPlugin,
} from "https://deno.land/x/fresh_blog@0.0.5/mod.ts";

import { ga4Plugin } from "https://deno.land/x/fresh_ga4@0.0.4/mod.ts";

const blogOptions: BlogOptions = {
title: "Reed's Blog",
rootPath: import.meta.url,
navbarItems: {
Archive: "/archive",
About: "/about",
Contact: "/contact",
Projects: "/projects",
},
};

export default defineConfig({
plugins: [blogPlugin(blogOptions), ga4Plugin(), tailwind()],
});
19 changes: 10 additions & 9 deletions fresh.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.

import * as $0 from "./routes/about.tsx";
import * as $1 from "./routes/contact.tsx";
import * as $2 from "./routes/projects.tsx";
import * as $$0 from "./islands/Disqus.tsx";
import * as $about from "./routes/about.tsx";
import * as $contact from "./routes/contact.tsx";
import * as $projects from "./routes/projects.tsx";
import * as $Disqus from "./islands/Disqus.tsx";
import { type Manifest } from "$fresh/server.ts";

const manifest = {
routes: {
"./routes/about.tsx": $0,
"./routes/contact.tsx": $1,
"./routes/projects.tsx": $2,
"./routes/about.tsx": $about,
"./routes/contact.tsx": $contact,
"./routes/projects.tsx": $projects,
},
islands: {
"./islands/Disqus.tsx": $$0,
"./islands/Disqus.tsx": $Disqus,
},
baseUrl: import.meta.url,
};
} satisfies Manifest;

export default manifest;
29 changes: 5 additions & 24 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,11 @@
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />

import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";

import twindPlugin from "$fresh/plugins/twind.ts";
import twindConfig from "./twind.config.ts";
import "$std/dotenv/load.ts";

import {
BlogOptions,
blogPlugin,
} from "https://deno.land/x/fresh_blog@0.0.2/mod.ts";

import { ga4Plugin } from "https://deno.land/x/fresh_ga4@0.0.1/mod.ts";
import { start } from "$fresh/server.ts";

const blogOptions: BlogOptions = {
title: "Reed's Blog",
rootPath: import.meta.url,
navbarItems: {
Archive: "/archive",
About: "/about",
Contact: "/contact",
Projects: "/projects",
},
};
import manifest from "./fresh.gen.ts";
import config from "./fresh.config.ts";

await start(manifest, {
plugins: [twindPlugin(twindConfig), blogPlugin(blogOptions), ga4Plugin()],
});
await start(manifest, config);
3 changes: 3 additions & 0 deletions static/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
9 changes: 9 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { type Config } from "tailwindcss";
import { safelist } from "https://deno.land/x/fresh_blog@0.0.5/mod.ts";

export default {
content: [
"{routes,islands,components}/**/*.{ts,tsx}",
],
safelist: safelist,
} satisfies Config;
5 changes: 0 additions & 5 deletions twind.config.ts

This file was deleted.

0 comments on commit c4f1501

Please sign in to comment.