Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chibat committed Jan 13, 2024
1 parent 93c0c64 commit 30f3571
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![Made with Fresh](https://fresh.deno.dev/fresh-badge.svg)](https://fresh.deno.dev)

Source code for https://leaves.deno.dev/ .
Source code for https://leaves.chiba.dev/ .

[Zenn article](https://zenn.dev/chiba/articles/md-sns-deno-fresh)

Expand All @@ -13,7 +13,7 @@ Source code for https://leaves.deno.dev/ .
### Install

```
deno install -f -n s --allow-net=leaves.deno.dev https://raw.githubusercontent.com/chibat/leaves/main/cli.ts
deno install -f -n s --allow-net=leaves.chiba.dev https://raw.githubusercontent.com/chibat/leaves/main/cli.ts
```

## References
Expand Down
6 changes: 3 additions & 3 deletions cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S deno run --allow-net=localhost,leaves.deno.dev,leaves--develop.deno.dev
#!/usr/bin/env -S deno run --allow-net=localhost,leaves.chiba.dev,leaves--develop.deno.dev

import { Input } from "https://deno.land/x/[email protected]/prompt/input.ts";
import { Select } from "https://deno.land/x/[email protected]/prompt/select.ts";
Expand All @@ -14,7 +14,7 @@ const COMMAND_OPTIONS = [{ value: -1, name: ":Back" }, {
const keys = { next: ["j", "down"], previous: ["k", "up"] };
const API_PATH = Deno.args.at(0) === "dev"
? "http://localhost:8000/api/cli"
: "https://leaves.deno.dev/api/cli";
: "https://leaves.chiba.dev/api/cli";

let list: Array<{ value: number; name: string }> = [];
let searchSkip = false;
Expand Down Expand Up @@ -67,7 +67,7 @@ while (true) {
console.log(
"---------------------------------------------------------------------------------",
);
console.log(`https://leaves.deno.dev/posts/${postId}`);
console.log(`https://leaves.chiba.dev/posts/${postId}`);
const option: any = await Select.prompt({
message: "Select",
options: COMMAND_OPTIONS,
Expand Down
2 changes: 1 addition & 1 deletion routes/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function App({ Component }: PageProps) {
<footer class="container d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
<p class="col-md-4 mb-0 text-muted">
&copy;<a
href="https://chibat.github.io/"
href="https://chiba.dev"
target="_blank"
class="doc text-muted"
>
Expand Down
3 changes: 3 additions & 0 deletions routes/_middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export async function handler(
});
}
const url = new URL(_req.url);
if (url.hostname === "leaves.deno.dev") {
return Response.redirect("https://leaves.chiba.dev", 301); // Moved Permanently
}
if (url.pathname === "/sitemap.xml") {
const users = await selectUsers();
const posts = await selectPostIds();
Expand Down
16 changes: 9 additions & 7 deletions routes/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ export default defineRoute(async (req, _ctx) => {
<>
<Head>
<title>About - Leaves</title>
<meta property="og:url" content="https://leaves.deno.dev/"></meta>
<meta property="og:url" content="https://leaves.chiba.dev/"></meta>
<meta property="og:title" content="Leaves"></meta>
<meta
property="og:image"
content="https://leaves.deno.dev/assets/img/icon-192x192.png"
content="https://leaves.chiba.dev/assets/img/icon-192x192.png"
/>
<meta name="twitter:card" content="summary"></meta>
<meta name="twitter:site" content="@tomofummy" />
<meta name="twitter:creator" content="@tomofummy" />
<meta
name="twitter:image"
content="https://leaves.deno.dev/assets/img/icon-192x192.png"
content="https://leaves.chiba.dev/assets/img/icon-192x192.png"
/>
</Head>
<Header user={session?.user} authUrl={authUrl} />
Expand All @@ -31,7 +31,7 @@ export default defineRoute(async (req, _ctx) => {
<li>
This site is a portfolio by{" "}
<a
href="https://chibat.github.io/"
href="https://chiba.dev"
target="_blank"
class="doc"
>
Expand All @@ -43,10 +43,12 @@ export default defineRoute(async (req, _ctx) => {
</li>
<li>You can sign in using your Google account.</li>
<li>
<a href="https://leaves.deno.dev/posts/75">How to write Markdown</a>
<a href="https://leaves.chiba.dev/posts/75">
How to write Markdown
</a>
</li>
<li>
<a href="https://leaves.deno.dev/posts/177">
<a href="https://leaves.chiba.dev/posts/177">
The site previews YouTube URLs included in your posts.
</a>
</li>
Expand Down Expand Up @@ -117,7 +119,7 @@ export default defineRoute(async (req, _ctx) => {
<a href="/shortcuts">Keyboard Shortcuts</a>
</li>
<li>
<a href="https://leaves.deno.dev/posts/227">Leaves CLI</a>
<a href="https://leaves.chiba.dev/posts/227">Leaves CLI</a>
</li>
</ul>
</main>
Expand Down
6 changes: 3 additions & 3 deletions routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ export default defineRoute(async (req, _ctx) => {
<Head>
<title>{title}</title>
<meta name="description" content={title} />
<meta property="og:url" content="https://leaves.deno.dev/"></meta>
<meta property="og:url" content="https://leaves.chiba.dev/"></meta>
<meta property="og:title" content={title}></meta>
<meta
property="og:image"
content="https://leaves.deno.dev/assets/img/icon-192x192.png"
content="https://leaves.chiba.dev/assets/img/icon-192x192.png"
/>
<meta name="twitter:card" content="summary"></meta>
<meta name="twitter:site" content="@tomofummy" />
<meta name="twitter:creator" content="@tomofummy" />
<meta
name="twitter:image"
content="https://leaves.deno.dev/assets/img/icon-192x192.png"
content="https://leaves.chiba.dev/assets/img/icon-192x192.png"
/>
</Head>
<Header user={session?.user} authUrl={authUrl} />
Expand Down
2 changes: 1 addition & 1 deletion routes/posts/[postId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default defineRoute(async (req, ctx) => {
<Head>
<title>{title}</title>
<meta name="description" content={title} />
<meta property="og:url" content="https://leaves.deno.dev/"></meta>
<meta property="og:url" content="https://leaves.chiba.dev/"></meta>
<meta property="og:title" content={title}></meta>
<meta
property="og:description"
Expand Down
4 changes: 2 additions & 2 deletions routes/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ export default defineRoute(async (req, ctx) => {
</meta>
<meta
property="og:image"
content="https://leaves.deno.dev/assets/img/icon-192x192.png"
content="https://leaves.chiba.dev/assets/img/icon-192x192.png"
/>
<meta name="twitter:card" content="summary"></meta>
<meta name="twitter:site" content="@tomofummy" />
<meta
name="twitter:image"
content="https://leaves.deno.dev/assets/img/icon-192x192.png"
content="https://leaves.chiba.dev/assets/img/icon-192x192.png"
/>
</Head>
<Header user={session?.user} authUrl={authUrl} />
Expand Down
6 changes: 3 additions & 3 deletions routes/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ export default defineRoute(async (req, _ctx) => {
<>
<Head>
<title>Settings - Leaves</title>
<meta property="og:url" content="https://leaves.deno.dev/"></meta>
<meta property="og:url" content="https://leaves.chiba.dev/"></meta>
<meta property="og:title" content="Leaves"></meta>
<meta
property="og:image"
content="https://leaves.deno.dev/assets/img/icon-192x192.png"
content="https://leaves.chiba.dev/assets/img/icon-192x192.png"
/>
<meta name="twitter:card" content="summary"></meta>
<meta name="twitter:site" content="@tomofummy" />
<meta name="twitter:creator" content="@tomofummy" />
<meta
name="twitter:image"
content="https://leaves.deno.dev/assets/img/icon-192x192.png"
content="https://leaves.chiba.dev/assets/img/icon-192x192.png"
/>
</Head>
<Header user={session.user} authUrl={authUrl} />
Expand Down
6 changes: 3 additions & 3 deletions routes/shortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ export default defineRoute(async (req, _ctx) => {
<>
<Head>
<title>Keyboard Shortcuts - Leaves</title>
<meta property="og:url" content="https://leaves.deno.dev/"></meta>
<meta property="og:url" content="https://leaves.chiba.dev/"></meta>
<meta property="og:title" content="Leaves"></meta>
<meta
property="og:image"
content="https://leaves.deno.dev/assets/img/icon-192x192.png"
content="https://leaves.chiba.dev/assets/img/icon-192x192.png"
/>
<meta name="twitter:card" content="summary"></meta>
<meta name="twitter:site" content="@tomofummy" />
<meta name="twitter:creator" content="@tomofummy" />
<meta
name="twitter:image"
content="https://leaves.deno.dev/assets/img/icon-192x192.png"
content="https://leaves.chiba.dev/assets/img/icon-192x192.png"
/>
</Head>
<Header user={session?.user} authUrl={authUrl} />
Expand Down
2 changes: 1 addition & 1 deletion routes/users/[userId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineRoute(async (req, ctx) => {
<Head>
<title>{title}</title>
<meta name="description" content={title} />
<meta property="og:url" content="https://leaves.deno.dev/"></meta>
<meta property="og:url" content="https://leaves.chiba.dev/"></meta>
<meta property="og:title" content={title}></meta>
<meta property="og:description" content={title}>
</meta>
Expand Down

0 comments on commit 30f3571

Please sign in to comment.