Skip to content

Commit

Permalink
Add Mastodon links
Browse files Browse the repository at this point in the history
  • Loading branch information
dguo committed Mar 21, 2024
1 parent 59fca23 commit b4cb5df
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PUBLIC_AUTHOR_EMAIL="danny@dannyguo.com"
PUBLIC_AUTHOR_NAME="Danny Guo"
PUBLIC_AUTHOR_GITHUB_NAME="dguo"
PUBLIC_AUTHOR_MASTODON_HANDLE="dannyguo@mastodon.social"
PUBLIC_AUTHOR_TWITTER_NAME="dannyguo"
PUBLIC_DISQUS_NAME="dannyguo"
PUBLIC_DOMAIN="https://www.dannyguo.com"
Expand Down
8 changes: 8 additions & 0 deletions public/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ button:hover {
background-color: #0c85d0;
}

.mastodon {
background-color: #6364ff;
}

.mastodon:hover {
background-color: #563acc;
}

.github {
background-color: #24292e;
}
Expand Down
4 changes: 4 additions & 0 deletions public/images/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ const title = props.title || import.meta.env.PUBLIC_AUTHOR_NAME;
</svg>
Twitter
</a>
<a
rel="me"
href={`https://${import.meta.env.PUBLIC_AUTHOR_MASTODON_HANDLE.split('@')[1]}/@${import.meta.env.PUBLIC_AUTHOR_MASTODON_HANDLE.split("@")[0]}`}
class="link-button mastodon"
>
<svg class="icon icon-mastodon">
<use xlink:href="/images/icons.svg#icon-mastodon"></use>
</svg>
Mastodon
</a>
<a
href={`https://github.com/${
import.meta.env.PUBLIC_AUTHOR_GITHUB_NAME
Expand Down
6 changes: 2 additions & 4 deletions src/layouts/BlogPostLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,8 @@ const nextPost = posts[postIndex - 1] ?? null;
Follow me on <a
href={`https://twitter.com/${
import.meta.env.PUBLIC_AUTHOR_TWITTER_NAME
}`}>Twitter</a
> or subscribe to my <a href="/newsletter">free newsletter</a> or <a
href="/blog/feed.xml"
type="application/rss+xml">RSS feed</a
}`}>Twitter</a> or <a href={`https://${import.meta.env.PUBLIC_AUTHOR_MASTODON_HANDLE.split('@')[1]}/@${import.meta.env.PUBLIC_AUTHOR_MASTODON_HANDLE.split('@')[0]}`}>Mastodon</a> or subscribe to my <a href="/newsletter">newsletter</a> or <a
href="/blog/feed.xml" type="application/rss+xml">RSS feed</a
> for future posts.
</p>

Expand Down

0 comments on commit b4cb5df

Please sign in to comment.