Add about to homepage, add color script to templates
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
---
|
||||
// Import the global.css file here so that it is included on
|
||||
// all pages through the use of the <BaseHead /> component.
|
||||
import '../styles/global.css';
|
||||
import '../global.css';
|
||||
|
||||
export interface Props {
|
||||
title: string;
|
||||
@@ -41,5 +39,8 @@ const { title, description, image = '/placeholder-social.jpg' } = Astro.props;
|
||||
<meta name="twitter:creator" content="@cassidoo" />
|
||||
<meta name="twitter:image" content="http://cassidoo.co/img/headshot.png" />
|
||||
|
||||
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css?family=Roboto+Mono"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
|
||||
28
src/components/ColorScript.astro
Normal file
28
src/components/ColorScript.astro
Normal file
@@ -0,0 +1,28 @@
|
||||
<script is:inline>
|
||||
let colors = ['#24d05a', '#eb4888', '#10a2f5', '#e9bc3f'];
|
||||
|
||||
function getRandomColor() {
|
||||
return colors[Math.floor(Math.random() * colors.length)];
|
||||
}
|
||||
|
||||
function setRandomLinkColor() {
|
||||
Array.from(document.getElementsByTagName('a')).forEach((e) => {
|
||||
e.style.color = getRandomColor();
|
||||
});
|
||||
}
|
||||
|
||||
function setColorHoverListener() {
|
||||
Array.from(document.querySelectorAll('a, button')).forEach((e) => {
|
||||
e.addEventListener('mouseover', setRandomLinkColor);
|
||||
});
|
||||
}
|
||||
|
||||
(function () {
|
||||
setRandomLinkColor();
|
||||
setColorHoverListener();
|
||||
|
||||
setInterval(() => {
|
||||
setRandomLinkColor();
|
||||
}, 3000);
|
||||
})();
|
||||
</script>
|
||||
@@ -1,19 +1,25 @@
|
||||
---
|
||||
import HeaderLink from './HeaderLink.astro';
|
||||
import { SITE_TITLE } from '../config';
|
||||
import HeaderLink from "./HeaderLink.astro";
|
||||
import { SITE_TITLE } from "../config";
|
||||
---
|
||||
|
||||
<header>
|
||||
<h2>
|
||||
{SITE_TITLE}
|
||||
</h2>
|
||||
<div class="header-section">
|
||||
<div class="header-frame">
|
||||
<h1>{SITE_TITLE}</h1>
|
||||
<h2>a blog, or whatever</h2>
|
||||
</div>
|
||||
</div>
|
||||
<nav>
|
||||
<HeaderLink href="/">Home</HeaderLink>
|
||||
<HeaderLink href="/blog">Blog</HeaderLink>
|
||||
<HeaderLink href="/about">About</HeaderLink>
|
||||
<HeaderLink href="https://cassidoo.co/newsletter" target="_blank">Newsletter</HeaderLink>
|
||||
<HeaderLink href="https://twitter.com/cassidoo" target="_blank">Twitter</HeaderLink>
|
||||
<HeaderLink href="https://github.com/cassidoo" target="_blank">GitHub</HeaderLink>
|
||||
<HeaderLink href="/">home</HeaderLink>
|
||||
<HeaderLink href="/blog">posts</HeaderLink>
|
||||
<HeaderLink href="https://cassidoo.co" target="_blank">website</HeaderLink>
|
||||
<HeaderLink href="https://twitter.com/cassidoo" target="_blank"
|
||||
>twitter
|
||||
</HeaderLink>
|
||||
<HeaderLink href="https://cassidoo.co/newsletter" target="_blank"
|
||||
>newsletter
|
||||
</HeaderLink>
|
||||
</nav>
|
||||
</header>
|
||||
<style>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import BaseHead from "../components/BaseHead.astro";
|
||||
import Header from "../components/Header.astro";
|
||||
import Footer from "../components/Footer.astro";
|
||||
import ColorScript from "../components/ColorScript.astro";
|
||||
|
||||
export interface Props {
|
||||
content: {
|
||||
@@ -53,5 +54,6 @@ const {
|
||||
</article>
|
||||
</main>
|
||||
<Footer />
|
||||
<ColorScript />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
---
|
||||
layout: "../layouts/BlogPost.astro"
|
||||
title: "About Me"
|
||||
description: "I'm Cassidy"
|
||||
updatedDate: "August 08 2022"
|
||||
---
|
||||
|
||||
I'm Cassidy, and I like to make memes and dreams and software.
|
||||
|
||||
When I’m not working, I like to watch movies, play music, eat a lot, practice Spanish, and salsa dance. I like brainstorming projects that I build maybe half the time. It's nice to dream.
|
||||
|
||||
You should check out my website, [cassidoo.co](https://cassidoo.co), my [newsletter](https://cassidoo.co/newsletter), or my [GitHub profile](https://github.com/cassidoo). Or don’t. I’m not your mother.
|
||||
You should check out my website, [cassidoo.co](https://cassidoo.co), my [newsletter](https://cassidoo.co/newsletter), or my [GitHub profile](https://github.com/cassidoo). Or don’t. I’m not your mother.
|
||||
|
||||
Anyway, welcome to my blog AKA digital garden AKA mind dump land!
|
||||
@@ -2,7 +2,9 @@
|
||||
import BaseHead from '../components/BaseHead.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import ColorScript from '../components/ColorScript.astro';
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
|
||||
import {Content as About} from './about.md';
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
@@ -13,38 +15,15 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
|
||||
<body>
|
||||
<Header title={SITE_TITLE} />
|
||||
<main>
|
||||
<h1>🧑🚀 Hello, Astronaut!</h1>
|
||||
<p>
|
||||
Welcome to the official <a href="https://astro.build/">Astro</a> blog starter template. This
|
||||
template serves as a lightweight, minimally-styled starting point for anyone looking to build
|
||||
a personal website, blog, or portfolio with Astro.
|
||||
</p>
|
||||
<p>
|
||||
This template comes with a few integrations already configured in your
|
||||
<code>astro.config.mjs</code> file. You can customize your setup with
|
||||
<a href="https://astro.build/integrations">Astro Integrations</a> to add tools like Tailwind,
|
||||
React, or Vue to your project.
|
||||
</p>
|
||||
<p>Here are a few ideas on how to get started with the template:</p>
|
||||
<ul>
|
||||
<li>Edit this page in <code>src/pages/index.astro</code></li>
|
||||
<li>Edit the site header items in <code>src/components/Header.astro</code></li>
|
||||
<li>Add your name to the footer in <code>src/components/Footer.astro</code></li>
|
||||
<li>Check out the included blog posts in <code>src/pages/blog/</code></li>
|
||||
<li>Customize the blog post page layout in <code>src/layouts/BlogPost.astro</code></li>
|
||||
</ul>
|
||||
<p>
|
||||
Have fun! If you get stuck, remember to <a href="https://docs.astro.build/"
|
||||
>read the docs
|
||||
</a> or <a href="https://astro.build/chat">join us on Discord</a> to ask questions.
|
||||
</p>
|
||||
<p>
|
||||
Looking for a blog template with a bit more personality? Check out <a
|
||||
href="https://github.com/Charca/astro-blog-template"
|
||||
>astro-blog-template
|
||||
</a> by <a href="https://twitter.com/Charca">Maxi Ferreira</a>.
|
||||
</p>
|
||||
<About />
|
||||
|
||||
<h3>Here's a sampler of some posts</h3>
|
||||
<p>hello blah blah blah</p>
|
||||
|
||||
<h3>View posts by tag</h3>
|
||||
<p>hello blah blah blah</p>
|
||||
</main>
|
||||
<Footer />
|
||||
<ColorScript />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user