-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
24 changed files
with
298 additions
and
47 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,7 @@ | ||
--- | ||
'astrobook': minor | ||
--- | ||
|
||
Add a new `head` option. This allows you to configure the global styles and fonts. Please check the README.md for more information. | ||
|
||
Add a new `title` option to set the title for your Astrobook site. |
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,3 @@ | ||
An example of using custom `<head>` tags with Astrobook. | ||
|
||
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/ocavue/astrobook/tree/master/examples/custom-head) |
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,18 @@ | ||
import { defineConfig } from 'astro/config' | ||
import astrobook from 'astrobook' | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
server: { | ||
port: 4305, | ||
}, | ||
|
||
// Enable many frameworks to support all different kinds of components. | ||
integrations: [ | ||
astrobook({ | ||
directory: 'src/components', | ||
head: './src/components/CustomHead.astro', | ||
title: 'Custom Title', | ||
}), | ||
], | ||
}) |
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,21 @@ | ||
{ | ||
"name": "example-custom-head", | ||
"type": "module", | ||
"version": "0.0.0", | ||
"private": true, | ||
"stackblitz": { | ||
"installDependencies": false, | ||
"startCommand": "pnpm install && pnpm run dev" | ||
}, | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"astro": "^5.0.5", | ||
"astrobook": "*" | ||
} | ||
} |
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,27 @@ | ||
<!-- Custom font --> | ||
<link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Freckle+Face&family=Lobster&family=Press+Start+2P&display=swap" | ||
rel="stylesheet" | ||
/> | ||
|
||
<style> | ||
.font-freckle-face { | ||
font-family: 'Freckle Face', system-ui; | ||
font-weight: 400; | ||
font-style: normal; | ||
} | ||
|
||
.font-lobster { | ||
font-family: 'Lobster', sans-serif; | ||
font-weight: 400; | ||
font-style: normal; | ||
} | ||
|
||
.font-press-start-2p { | ||
font-family: 'Press Start 2P', system-ui; | ||
font-weight: 400; | ||
font-style: normal; | ||
} | ||
</style> |
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,6 @@ | ||
--- | ||
import './global.css' | ||
import CustomFont from './CustomFont.html' | ||
--- | ||
|
||
<CustomFont /> |
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,13 @@ | ||
--- | ||
interface Props { | ||
fontName: 'freckle-face' | 'lobster' | 'press-start-2p' | ||
} | ||
const { fontName } = Astro.props | ||
--- | ||
|
||
<div> | ||
<div class={`font-${fontName}`}> | ||
<p>Lorem ipsum dolor sit amet</p> | ||
</div> | ||
</div> |
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 @@ | ||
import Typography from './Typography.astro' | ||
|
||
export default { | ||
component: Typography, | ||
} | ||
|
||
export const Lobster = { | ||
args: { | ||
fontName: 'lobster', | ||
}, | ||
} | ||
|
||
export const FreckleFace = { | ||
args: { | ||
fontName: 'freckle-face', | ||
}, | ||
} | ||
|
||
export const PressStart2P = { | ||
args: { | ||
fontName: 'press-start-2p', | ||
}, | ||
} |
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,3 @@ | ||
p { | ||
padding: 1rem; | ||
} |
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,5 @@ | ||
/// <reference path="../.astro/types.d.ts" /> | ||
/// <reference types="astro/client" /> | ||
|
||
declare module '*.vue' | ||
declare module '*.astro' |
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 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2022", | ||
"module": "esnext", | ||
"lib": ["esnext"], | ||
"jsx": "preserve", | ||
"declaration": true, | ||
"emitDeclarationOnly": true, | ||
"moduleResolution": "Bundler", | ||
"esModuleInterop": true, | ||
"outDir": "${configDir}/node_modules/.cache/tsc", | ||
"strict": true, | ||
"allowJs": true, | ||
"composite": true, | ||
"strictNullChecks": true, | ||
"verbatimModuleSyntax": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"skipDefaultLibCheck": true | ||
}, | ||
"include": ["./src", "./*.js", "./*.mjs", "./*.ts"] | ||
} |
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 @@ | ||
<slot /> |
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
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
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
Oops, something went wrong.