Skip to content

Commit

Permalink
Merge pull request #11 from torontojs/feat/home-page
Browse files Browse the repository at this point in the history
Feat/home page
  • Loading branch information
dreymoreau authored Jun 6, 2024
2 parents f4ed813 + 5821961 commit 20e8136
Show file tree
Hide file tree
Showing 37 changed files with 2,755 additions and 629 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Toronto JS blog
# TorontoJS Blog

## Pre-requisites

Expand Down
141 changes: 73 additions & 68 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,77 +1,82 @@
import { readFileSync } from 'node:fs';

import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import astroPWA, { type PwaOptions } from '@vite-pwa/astro';
import astroIcon from 'astro-icon';
import { defineConfig } from 'astro/config';

import { readFileSync } from 'node:fs';
import { assetsCache, externalResourcesCache, pagesCache, scriptsCache } from './src/sw-caching.ts';

const manifest: PwaOptions['manifest'] = JSON.parse(readFileSync('./src/manifest.json', { encoding: 'utf8' }));

const manifest: PwaOptions['manifest'] = JSON.parse(readFileSync('./src/manifest.json', {
encoding: 'utf8'
}));
const mode = process.env['NODE_ENV'] === 'production' ? 'production' : 'development';

// https://astro.build/config
export default defineConfig({
site: 'https://blog.torontojs.com/',
base: '/',
trailingSlash: 'ignore',
compressHTML: true,
build: {
format: 'directory'
},
server: {
host: 'localhost',
port: 3000
},
...(mode !== 'production' && {
vite: {
server: {
https: {
cert: './certs/server.crt',
key: './certs/server.key'
}
}
}
}),
markdown: {
syntaxHighlight: 'shiki',
shikiConfig: {
theme: 'css-variables',
themes: {
light: 'light-plus',
dark: 'dark-plus'
},
wrap: true
}
},
integrations: [
astroPWA({
registerType: 'prompt',
minify: true,
includeAssets: ['/icons/icon.svg'],
manifest,
workbox: {
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
maximumFileSizeToCacheInBytes: 1024 * 128,
cleanupOutdatedCaches: true,
clientsClaim: true,
skipWaiting: false,
navigateFallback: '/offline',
navigateFallbackDenylist: [/\.(?:png|gif|jpg|jpeg|webp|svg|ico)$/iu],
directoryIndex: 'index.html',
runtimeCaching: [externalResourcesCache, assetsCache, scriptsCache, pagesCache]
},
devOptions: {
enabled: false
}
}),
sitemap({
changefreq: 'weekly',
priority: 0.7,
lastmod: new Date()
}),
astroIcon({
iconDir: 'src/assets/icons'
})
]
devToolbar: {
enabled: false
},
site: 'https://blog.torontojs.com',
base: '/',
trailingSlash: 'ignore',
compressHTML: true,
build: {
format: 'directory'
},
server: {
host: 'localhost',
port: 3000
},
...(mode !== 'production' && {
vite: {
server: {
https: {
cert: './certs/server.crt',
key: './certs/server.key'
}
}
}
}),
markdown: {
syntaxHighlight: 'shiki',
shikiConfig: {
theme: 'css-variables',
themes: {
light: 'light-plus',
dark: 'dark-plus'
},
wrap: true
}
},
integrations: [
astroPWA({
registerType: 'prompt',
minify: true,
includeAssets: ['/icons/icon.svg'],
manifest,
workbox: {
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
maximumFileSizeToCacheInBytes: 1024 * 128,
cleanupOutdatedCaches: true,
clientsClaim: true,
skipWaiting: false,
navigateFallback: '/offline',
navigateFallbackDenylist: [/\.(?:png|gif|jpg|jpeg|webp|svg|ico)$/iu],
directoryIndex: 'index.html',
runtimeCaching: [externalResourcesCache, assetsCache, scriptsCache, pagesCache]
},
devOptions: {
enabled: false
}
}),
sitemap({
changefreq: 'weekly',
priority: 0.7,
lastmod: new Date()
}),
astroIcon({
iconDir: 'src/assets/icons'
}),
tailwind()
]

});
Loading

0 comments on commit 20e8136

Please sign in to comment.