Skip to content

Commit

Permalink
Merge pull request #1089 from utelecon/202405-no-png-in-dist
Browse files Browse the repository at this point in the history
202405 no png in dist
  • Loading branch information
jtamatsukuri authored Aug 1, 2024
2 parents 7c6492f + 93d5103 commit 0ac1781
Show file tree
Hide file tree
Showing 82 changed files with 1,530 additions and 473 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/astro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
- name: Build
run: |
npm run build
- name: Check unused assets
run: |
npm run unused-asset
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/netlify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
- name: Build
run: |
npm run build
- name: Check unused assets
run: |
npm run unused-asset
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Markdownファイルのフロントマターにかける設定は以下の通り
- 例:`npm run find-link /oc/url`
- `npm run broken-link`:サイト内リンクで壊れているものをすべて標準出力する.
- `dist`以下のHTMLファイルを読むため,あらかじめ`npm run build`してから実行する.
- `npm run unused-asset`:使われていないアセットをすべて標準出力する.
- `dist`以下のHTMLファイルを読むため,あらかじめ`npm run build`してから実行する.

## How it works

Expand Down
18 changes: 15 additions & 3 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import simpleAttentionPlugin from "./src/lib/SimpleAttentionPlugin.js";
import externalLinks from "./src/lib/ExternalLinksIntegration.js";
import trailingSlash from "./src/lib/TrailingSlashIntegration.js";
import { cleanup } from "./src/lib/CleanupIntegration.js";
import collectHtmlImages from "./src/lib/CollectHtmlImagesPlugin.js";
import copyAsset from "./src/lib/CopyAssetIntegration.js";
import assetFileNames from "./src/lib/AssetFileNames.js";
import rehypeRaw from "rehype-raw";

// https://astro.build/config
export default defineConfig({
Expand All @@ -23,6 +27,13 @@ export default defineConfig({
server: {
watch: { usePolling: Boolean(process.env.USE_POLLING) },
},
build: {
rollupOptions: {
output: {
assetFileNames,
},
},
},
},
markdown: {
remarkPlugins: [
Expand All @@ -42,14 +53,14 @@ export default defineConfig({
footnoteLabelProperties: { className: ["visually-hidden"] },
footnoteLabelTagName: "b",
},
rehypePlugins: [rehypeRaw, collectHtmlImages],
shikiConfig: {
theme: "min-light",
}
},
},
publicDir: "src/pages",
scopedStyleStrategy: "where",
integrations: [
mdx(),
mdx({ rehypePlugins: [] }),
react(),
redirect(),
externalLinks({
Expand All @@ -59,6 +70,7 @@ export default defineConfig({
contentProperties: { className: ["external-link"] },
}),
cleanup(),
copyAsset(),
trailingSlash(),
],
site: "https://utelecon.adm.u-tokyo.ac.jp",
Expand Down
Loading

0 comments on commit 0ac1781

Please sign in to comment.