Skip to content

Commit

Permalink
chore: add meta components to site and boost score (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdo29 committed Jun 11, 2023
2 parents 7c261cc + eee211a commit 9444c4b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 13 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ RUN VITE_SERVER_URL="https://api.unteris.com" pnpm nx run site:build:production

FROM caddy:2.6.4-alpine as site-prod
WORKDIR /src
COPY apps/site/robots.txt ./dist/apps/site/robots.txt
COPY --from=site-build /src/dist/apps/site/ ./dist/apps/site
COPY Caddyfile ./Caddyfile
CMD ["caddy", "run", "--config", "Caddyfile"]
16 changes: 14 additions & 2 deletions apps/site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="description"
content="dm.bunni's homebrew TTRPG world. Site Author: Jay McDoniel"
/>
<title>Unteris</title>
<base href="/" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:title" content="Unteris" />
<meta property="og:type" content="website" />
<meta property="og:image" content="/images/vitoak.png" />
<meta property="og:url" content="https://unteris.com" />
<meta
property="og:description"
content="dm.bunni's homebrew TTRPG world. Site Author: Jay McDoniel"
/>
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="/src/styles.scss" />
<link
Expand All @@ -14,11 +26,11 @@
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Cinzel+Decorative"
href="https://fonts.googleapis.com/css2?family=Cinzel+Decorative&display=swap"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Cinzel"
href="https://fonts.googleapis.com/css2?family=Cinzel&display=swap"
/>
<script
src="https://unpkg.com/tachyonjs@2.0.1/tachyon.min.js"
Expand Down
6 changes: 6 additions & 0 deletions apps/site/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
User-agent: Googlebot
Disallow: /nogooglebot/

User-agent: *
Allow: /

9 changes: 7 additions & 2 deletions apps/site/src/app/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Grid, StyledLink } from '@unteris/ui/components';

export const Footer = (): JSX.Element => {
const theme = useTheme();
const color = theme.palette.mode === 'dark' ? 'primary' : 'secondary';
return (
<Box
sx={{
Expand All @@ -16,8 +17,12 @@ export const Footer = (): JSX.Element => {
sx={{ justifyContent: 'center', justifyItems: 'center' }}
>
<div>
Made with <Heart color="primary" display="inline-block" /> by&nbsp;
<StyledLink href="https://github.com/jmcdo29" display="inline">
Made with <Heart color={color} display="inline-block" /> by&nbsp;
<StyledLink
href="https://github.com/jmcdo29"
display="inline"
color={color}
>
Jay McDoniel
</StyledLink>
</div>
Expand Down
4 changes: 2 additions & 2 deletions apps/site/src/app/nav-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const NavBar = (props: {
<>
<Grid container={true} columns={{ xs: 4, md: 12 }}>
<Grid md={1}>
<Button onClick={() => setShowMenu(!showMenu)}>
<Button onClick={() => setShowMenu(!showMenu)} aria-label="Menu">
<MenuIcon />
</Button>
</Grid>
Expand All @@ -27,7 +27,7 @@ export const NavBar = (props: {
<Grid xs={0} md={8}></Grid>
<ThemeSwitcher setTheme={props.setTheme} />
<Grid md={1}>
<Button>
<Button aria-label="Profile">
<ProfileIcon />
</Button>
</Grid>
Expand Down
24 changes: 17 additions & 7 deletions libs/docker/src/executors/build/executor.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
import { ExecutorContext } from '@nx/devkit';
import { Ogma } from '@ogma/logger';
import { style } from '@ogma/styler';
import { spawn } from 'child_process';
import { spawn, execSync } from 'child_process';
import { BuildExecutorSchema } from './schema';

export default async function runExecutor(
options: BuildExecutorSchema,
context: ExecutorContext
) {
const project = options.imageName ?? context.projectName;
const logger = new Ogma({
application: 'Nx Docker Plguin',
application: `Nx Docker Plguin - ${project}`,
logLevel: options?.verbose ? 'VERBOSE' : 'LOG',
});
const scope = context.nxJsonConfiguration?.npmScope;
logger.verbose(`Project scope was determined to be ${scope}`);
const project = options.imageName ?? context.projectName;
logger.verbose(`Project name was determined to be ${project}`);
const cachePath = options.cachePath ?? `docker/cache/${project}`;
logger.verbose(
`Docker cache path was evaluated to ${cachePath}. This was automatically generated.`
);
const gCommit = execSync('git log -n 1 --format="%h"')
.toString()
.replace('\n', '');
const dockerNamespace = options.dockerNamespace ?? `jmcdo29`;
const tag =
`${dockerNamespace}/` + (options.tag ?? `${scope}-${project}:latest`);
logger.verbose(`Using docker tag ${tag}`);
const tagPrefix = options.tag ?? `${scope}-${project}:latest`;
const tags = [
`${dockerNamespace}/${tagPrefix}`,
`${dockerNamespace}/${tagPrefix.replace('latest', gCommit)}`,
];
logger.verbose(`Using docker tag ${tags}`);
const target = options.target ?? `${project}-prod`;
logger.verbose(`Using dockerfile target ${target}`);
const builder = options.builder ?? 'container';
logger.verbose(`Using doocker builder ${builder}`);
const publish = options.publish ?? false;
const commandString = `docker buildx build -t ${tag} --cache-from type=local,src=${cachePath} --cache-to type=local,dest=${cachePath} --target=${target} --builder=${builder} --platform linux/arm64/v8,linux/amd64 ${
const commandString = `docker buildx build ${tags
.map((t) => `-t ${t}`)
.join(
' '
)} --cache-from type=local,src=${cachePath} --cache-to type=local,dest=${cachePath} --target=${target} --builder=${builder} --platform linux/arm64/v8,linux/amd64 ${
publish ? '--push' : ''
} .`;
const [docker, ...args] = commandString.split(' ').filter((arg) => !!arg);
Expand Down

0 comments on commit 9444c4b

Please sign in to comment.