Skip to content

Commit

Permalink
Merge pull request #20 from oriverk/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
oriverk authored May 14, 2024
2 parents 1efef38 + 741a44c commit f40d410
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 27 deletions.
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
PUBLIC_ALGOLIA_INDEX_BLOG=\w+
PUBLIC_ALGOLIA_APP_ID=\w+
PUBLIC_ALGOLIA_SEARCH_KEY=\w+
SECRET_ALGOLIA_ADMIN_KEY=\w+

SECRET_GH_PAT=\w+
5 changes: 1 addition & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@ jobs:
env:
MODE: production
SECRET_GH_PAT: ${{ secrets.SECRET_GH_PAT }}
PUBLIC_ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
PUBLIC_ALGOLIA_SEARCH_KEY: ${{ secrets.ALGOLIA_SEARCH_KEY }}
PUBLIC_ALGOLIA_INDEX_BLOG: ${{ secrets.ALGOLIA_INDEX_BLOG }}
- name: deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: astro-site
projectName: ${{ secrets.CL_PROJECT_NAME }}
directory: dist
# Optional: Enable this if you want to have GitHub Deployments triggered
# gitHubToken: ${{ secrets.SECRET_GH_PAT }}
5 changes: 5 additions & 0 deletions site.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ export default {
docsGitHubRepositoryExpression: "HEAD:cv/index.md",
zenn: 'oriverk',
x: 'not_you_die',
algolia: {
appId: "WOHC62BVSP",
apiKey: "bae638093bc0fe3156732e769d096c41",
index: "rod_oriverkdev"
}
}
10 changes: 5 additions & 5 deletions src/constants/feed.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Source } from "../types/feed";

export const sources: Source[] = [
{
id: "blog.oriverk",
url: "https://blog.oriverk.dev/feed.xml",
includeUrlRegex: "blog.oriverk.dev/entry/",
},
// {
// id: "blog.oriverk",
// url: "https://blog.oriverk.dev/feed.xml",
// includeUrlRegex: "blog.oriverk.dev/entry/",
// },
{
id: "zenn.dev",
url: "https://zenn.dev/oriverk/feed",
Expand Down
1 change: 1 addition & 0 deletions src/content/blog/20190513-learned-programming.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ update: '2019-12-12'
title: 'プログラミングを2か月間、日本人エンジニアの下で学んできた'
tags: [cebu]
published: true
nonidex: true
---

from [Qiita: プログラミングを2か月間、日本人エンジニアの下でマンツーマンで学んできた](https://qiita.com/OriverK/items/30d8941c7799c9aa6dfd)
Expand Down
2 changes: 1 addition & 1 deletion src/content/blog/20220125-renew-oriverkdev.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ published: true

## はじめに

過去の投稿:『[Next.js でポートフォリオサイトを作成した](https://blog.oriverk.dev/entry/2020/20200526-next-portfolio/)』で言及した Next.js + TypeScript の構成を作り替えました。
過去の投稿:『[Next.js でポートフォリオサイトを作成した](/blog/20200526-next-portfolio/)』で言及した Next.js + TypeScript の構成を作り替えました。

### 以前のサイト

Expand Down
2 changes: 1 addition & 1 deletion src/content/blog/20221205-next13-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Next.js beta docs にあるように `app/` はまだ production 環境下で使
- TypeScript
- マークダウン処理:[hashicorp/next-mdx-remote](https://github.com/hashicorp/next-mdx-remote)
- CSS: TailwindCSS
- [CSSライブラリを goober から TailwindCSS に移行した | blog.oriverk.dev](https://blog.oriverk.dev/entry/2022/20221116-next-ts-tailwind/)
- [CSSライブラリを goober から TailwindCSS に移行した | blog.oriverk.dev](/blog/2022/20221116-next-ts-tailwind/)
- 検索:[Algolia/react-instantsearch/packages/react-instantsearch-hooks-web](https://github.com/algolia/react-instantsearch/tree/master/packages/react-instantsearch-hooks-web)

## 移行前の主なディレクトリ構成
Expand Down
2 changes: 1 addition & 1 deletion src/content/blog/20230500-svelte-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ import Card from '../components/Card.astro';

- Static Site である
- GitHub の Pinned Repos と Contribution Calendar(GitHub 草)を表示できる
- [blog.oriverk.dev](https://blog.oriverk.dev) のコンテンツを取得表示できる
- blog.oriverk.dev のコンテンツを取得表示できる
- Cloudflare Pages にデプロイし、サイトデータを自動で更新できる

また、以前に [oriverk.dev](https://oriverk.dev) を React で作ったときの感じを踏襲したいとも考えていました。
Expand Down
4 changes: 0 additions & 4 deletions src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@

interface ImportMetaEnv {
readonly SECRET_GITHUB_PERSONAL_ACCESS_TOKEN: string;
readonly PUBLIC_GA_MEASUREMENT_ID: string;

readonly PUBLIC_ALGOLIA_APP_ID: string;
readonly PUBLIC_ALGOLIA_SEARCH_KEY: string;
readonly PUBLIC_ALGOLIA_INDEX_BLOG: string;
readonly SECRET_ALGOLIA_ADMIN_KEY: string;
}

Expand Down
13 changes: 5 additions & 8 deletions src/utils/algolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ import type { AlgoliaBlog } from "@/types/algolia";
import type { SearchResponse } from "@algolia/client-search";
import type { SearchClient, SearchIndex } from "algoliasearch";
import algolia from "algoliasearch";
import siteConfig from "site.config"

const {
PUBLIC_ALGOLIA_APP_ID,
PUBLIC_ALGOLIA_SEARCH_KEY,
PUBLIC_ALGOLIA_INDEX_BLOG,
} = import.meta.env;
const {appId, apiKey, index} = siteConfig.algolia;

const searchClient: SearchClient = algolia(
PUBLIC_ALGOLIA_APP_ID,
PUBLIC_ALGOLIA_SEARCH_KEY,
appId,
apiKey,
);
const searchIndex: SearchIndex = searchClient.initIndex(
PUBLIC_ALGOLIA_INDEX_BLOG,
index,
);

const emptyResults: SearchResponse<AlgoliaBlog> = {
Expand Down

0 comments on commit f40d410

Please sign in to comment.