-
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
Showing
29 changed files
with
236 additions
and
298 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,26 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: denoland/setup-deno@v2 | ||
with: | ||
deno-version: v2.x | ||
- name: Build | ||
run: deno task build | ||
- uses: denoland/deployctl@v1 | ||
with: | ||
entrypoint: dist/index.js | ||
project: 4513echo | ||
include: | | ||
deno.json | ||
dist |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
/_fresh | ||
/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,12 @@ | ||
import { createClient } from "honox/client"; | ||
|
||
createClient({ | ||
hydrate: async (elem, root) => { | ||
const { hydrateRoot } = await import("react-dom/client"); | ||
hydrateRoot(root, elem); | ||
}, | ||
createElement: async (type, props) => { | ||
const { createElement } = await import("react"); | ||
return createElement(type, props); | ||
}, | ||
}); |
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
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,23 @@ | ||
// @ts-types="@types/react" | ||
import type { ReactNode } from "react"; | ||
|
||
export interface LinkProps { | ||
href: string; | ||
name: string; | ||
icon: ReactNode | string; | ||
} | ||
|
||
export function LinkBox(props: LinkProps) { | ||
return ( | ||
<li className="py-2 rounded-full bg-gray-600 hover:bg-gray-500"> | ||
<a className="flex items-center" rel="me" href={props.href}> | ||
{typeof props.icon === "string" | ||
? <img className="mx-4 w-6 h-6" src={props.icon} alt={props.name} /> | ||
: <div className="mx-4 w-6 h-6">{props.icon}</div>} | ||
<p className="items-center text-sm text-gray-100 font-mono overflow-x-auto"> | ||
{props.name} | ||
</p> | ||
</a> | ||
</li> | ||
); | ||
} |
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,8 @@ | ||
import "hono"; | ||
import "@hono/react-renderer"; | ||
|
||
declare module "@hono/react-renderer" { | ||
interface Props { | ||
title?: string; | ||
} | ||
} |
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,8 @@ | ||
import type { NotFoundHandler } from "hono"; | ||
|
||
const handler: NotFoundHandler = (c) => { | ||
c.status(404); | ||
return c.render(<p>404 Not Found</p>); | ||
}; | ||
|
||
export default handler; |
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,12 @@ | ||
import type { ErrorHandler } from "hono"; | ||
|
||
const handler: ErrorHandler = (e, c) => { | ||
if ("getResponse" in e) { | ||
return e.getResponse(); | ||
} | ||
console.error(e.message); | ||
c.status(500); | ||
return c.render(<p>Internal Server Error</p>); | ||
}; | ||
|
||
export default handler; |
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,38 @@ | ||
import { reactRenderer } from "@hono/react-renderer"; | ||
import { Link, Script } from "honox/server"; | ||
|
||
export default reactRenderer(({ children, title }) => { | ||
return ( | ||
<html lang="ja"> | ||
<head> | ||
<meta charSet="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>{title}</title> | ||
<link | ||
rel="icon" | ||
href="https://www.gravatar.com/avatar/1179b2be2101d818dbb543537e6c3107?s=1024" | ||
/> | ||
<Script src="/app/client.ts" async /> | ||
<Link rel="stylesheet" href="/app/style.css" /> | ||
<script | ||
data-goatcounter="https://4513echo.goatcounter.com/count" | ||
async | ||
src="//gc.zgo.at/count.js" | ||
/> | ||
<script | ||
type="application/ld+json" | ||
dangerouslySetInnerHTML={{ | ||
__html: JSON.stringify({ | ||
"@context": "http://schema.org", | ||
"@type": "WebSite", | ||
"name": "4513echo.dev", | ||
"url": "https://4513echo.dev", | ||
"author": { "@type": "Person", "name": "響" }, | ||
}), | ||
}} | ||
/> | ||
</head> | ||
<body className="bg-[#8685b1]">{children}</body> | ||
</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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import type { FreshContext } from "$fresh/server.ts"; | ||
import { createRoute } from "honox/factory"; | ||
import { STATUS_CODE } from "@std/http/status"; | ||
|
||
export function handler(req: Request, _ctx: FreshContext): Response { | ||
const rev = new URL(req.url).searchParams.get("rev") || "main"; | ||
export default createRoute((c) => { | ||
const rev = c.req.query("rev") || "main"; | ||
const location = | ||
`https://raw.githubusercontent.com/4513ECHO/dotfiles/${rev}/up`; | ||
return Response.redirect(location, STATUS_CODE.TemporaryRedirect); | ||
} | ||
}); |
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
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,8 @@ | ||
import { showRoutes } from "hono/dev"; | ||
import { createApp } from "honox/server"; | ||
|
||
const app = createApp(); | ||
|
||
showRoutes(app); | ||
|
||
export default app; |
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 @@ | ||
@import "tailwindcss" source("../app"); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
4a46327
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to deploy: