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
1 parent
c0af6c1
commit 4b5da37
Showing
3 changed files
with
84 additions
and
0 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,50 @@ | ||
--- | ||
export interface Props { | ||
lang?: string; | ||
htmlClasses?: string[]; | ||
bodyClasses?: string[]; | ||
htmlId?: string; | ||
bodyId?: string; | ||
} | ||
const props = Astro.props as Props; | ||
if (!props.lang) { | ||
props.lang = 'en'; | ||
} | ||
if (!props.htmlClasses) { | ||
props.htmlClasses = []; | ||
} | ||
if (!props.bodyClasses) { | ||
props.bodyClasses = []; | ||
} | ||
if (!props.htmlId) { | ||
props.htmlId = null; | ||
} | ||
if (!props.bodyId) { | ||
props.bodyId = null; | ||
} | ||
--- | ||
|
||
<!DOCTYPE html> | ||
<html lang={props.lang} class:list={[...props.htmlClasses]} id={props.htmlId}> | ||
<head> | ||
<script is:inline> | ||
// CRITICAL | ||
// Add 'js' class to HTML tag if JavaScript is enabled | ||
(() => { | ||
const root = document.getElementsByTagName('html')[0]; | ||
root.classList.add('js'); | ||
})(); | ||
</script> | ||
|
||
<meta charset='UTF-8' /> | ||
<meta name='viewport' content='width=device-width, initial-scale=1' /> | ||
|
||
<slot name='head'></slot> | ||
</head> | ||
|
||
<body class:list={[...props.bodyClasses]} id={props.bodyId}> | ||
<slot name='body'></slot> | ||
</body> | ||
</html> |
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 @@ | ||
import Base from './Base.astro'; | ||
|
||
export default Base; |
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,31 @@ | ||
{ | ||
"name": "@julian_cataldo/astro-base", | ||
"version": "0.9.0", | ||
"description": "", | ||
"main": "index.js", | ||
"type": "module", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/JulianCataldo/astro", | ||
"directory": "app/Base" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"astro", | ||
"astro-component", | ||
"boilerplate", | ||
"app", | ||
"base", | ||
"wrapper", | ||
"javascript", | ||
"html", | ||
"document" | ||
], | ||
"author": "", | ||
"license": "ISC" | ||
} |