Skip to content

Commit

Permalink
Merge pull request #46 from plebnet-dev/fix-redirect
Browse files Browse the repository at this point in the history
 redirect join page, permalink
  • Loading branch information
bitkarrot authored Sep 25, 2023
2 parents d7ad4cf + 03e5d4e commit 05ad5f4
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 24 deletions.
9 changes: 6 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ import compress from 'astro-compress';
import { readingTimeRemarkPlugin } from './src/utils/frontmatter.mjs';
import { SITE } from './src/config.mjs';
import svelte from "@astrojs/svelte";
// import node from '@astrojs/node';
// import vercelEdge from '@astrojs/vercel/edge';
import vercel from "@astrojs/vercel/serverless";
import 'dotenv/config';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const whenExternalScripts = (items = []) => SITE.googleAnalyticsId ? Array.isArray(items) ? items.map(item => item()) : [items()] : [];


// https://astro.build/config
export default defineConfig({
redirects: {
'/join': {
status: 302,
destination: '/join-us'
}
},
site: SITE.origin,
base: SITE.basePathname,
trailingSlash: SITE.trailingSlash ? 'always' : 'never',
Expand Down
2 changes: 1 addition & 1 deletion src/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const CONFIG = {
}),

googleAnalyticsId: false, // or "G-XXXXXXXXXX",
googleSiteVerificationId: 'orcPxI47GSa-cRvY11tUe6iGg2IO_RPvnA1q95iEM3M',
googleSiteVerificationId: '', //'orcPxI47GSa-cRvY11tUe6iGg2IO_RPvnA1q95iEM3M',

blog: {
disabled: false,
Expand Down
2 changes: 1 addition & 1 deletion src/content/post/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ For design enthusiasts and contributors, we're contemplating whether to list the

Your feedback and suggestions drive us. We'd love to hear your thoughts on this, whether it's on [GitHub](https://github.com/plebnet-dev) or any of our other platforms.

**Join us if you're interested in contributing as a senior dev, junior dev, or a code advocate who wants to learn more by starting [here](https://plebnet.dev/join)**
**Join us if you're interested in contributing as a senior dev, junior dev, or a code advocate who wants to learn more by starting [here](https://plebnet.dev/join-us)**

**Attribution: This content is a PlebNet Dev Contribution. The article was authored by [bitc0inDad](https://github.com/Bitc0indad)**
10 changes: 5 additions & 5 deletions src/data.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getPermalink, getBlogPermalink, getAsset } from './utils/permalinks';
import {getBlogPermalink, getJoinPermalink, getAsset } from './utils/permalinks';

export const headerData = {
links: [
Expand All @@ -7,11 +7,11 @@ export const headerData = {
links: [
{
text: 'Join Us',
href: '/join',
href: getJoinPermalink(),
},
{
text: 'FAQ',
href: '/join#faq',
href: getJoinPermalink() + '#faq',
},
{
text: 'Projects',
Expand Down Expand Up @@ -98,8 +98,8 @@ export const footerData = {
{
title: 'Members',
links: [
{ text: 'Join Us', href: '/join' },
{ text: 'FAQ', href: '/join#faq' },
{ text: 'Join Us', href: getJoinPermalink() },
{ text: 'FAQ', href: getJoinPermalink() + '#faq' },
{ text: 'Projects', href: '/projects' },
{ text: 'Blog', href: '/blog' },
// { text: 'Directory', href: '/directory' },
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Corp.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Layout from "~/layouts/PageLayout.astro";
import Header from "~/components/widgets/Header.astro";
import { headerData } from "~/data";
import SignUpFormCorp from '../components/SignUpFormCorp.svelte';
import {getJoinPermalink } from '../utils/permalinks';
const meta = {
title: "PLEBNET.DEV Join Us",
Expand All @@ -17,7 +18,7 @@ const meta = {
{
type: "primary",
text: "Sign Up",
href: "/join",
href: getJoinPermalink(),
},
]}
isSticky
Expand Down
5 changes: 3 additions & 2 deletions src/pages/Indiv.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Layout from "~/layouts/PageLayout.astro";
import Header from "~/components/widgets/Header.astro";
import { headerData } from "~/data";
import SignUpFormIndiv from '../components/SignUpFormIndiv.svelte';
import { getJoinPermalink } from '../utils/permalinks';
const meta = {
title: "PLEBNET.DEV Join Us",
Expand All @@ -17,8 +18,8 @@ const meta = {
actions={[
{
type: "primary",
text: "Sign Up",
href: "/join",
text: "Join Us",
href: getJoinPermalink(),
},
]}
isSticky
Expand Down
7 changes: 4 additions & 3 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Content from '~/components/widgets/Content.astro';
import CallToAction from '~/components/widgets/CallToAction.astro';
import BlogLatestPosts from '~/components/widgets/BlogLatestPosts.astro';
import {getJoinPermalink } from '../utils/permalinks';
import { headerData } from '~/data';
Expand All @@ -24,7 +25,7 @@ const meta = {
{
type: "primary",
text: 'Join Us',
href: '/join',
href: getJoinPermalink(),
},
]}
isSticky
Expand All @@ -34,7 +35,7 @@ const meta = {
<!-- Hero2 Widget ******************* -->

<Hero2
callToAction={{ text: 'Join Us', href: '/join' }}
callToAction={{ text: 'Join Us', href: getJoinPermalink() }}
callToAction2={{ text: 'Learn More', href: '#more' }}
image={{ src: import('~/assets/images/electricbitcoin.jpg'), alt: 'Plebnet.dev Hero Image' }}
>
Expand Down Expand Up @@ -108,7 +109,7 @@ const meta = {
<CallToAction
callToAction={{
text: 'Join Us',
href: '/join',
href: getJoinPermalink(),
}}
>
<Fragment slot="title">
Expand Down
1 change: 0 additions & 1 deletion src/pages/join.astro → src/pages/join-us.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const meta = {
};
---

<Layout {meta}>
<Fragment slot="header">
<Header
Expand Down
6 changes: 4 additions & 2 deletions src/pages/projects.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Header from '~/components/widgets/Header.astro';
import FeaturesLink from '~/components/widgets/FeaturesLink.astro';
import { headerData } from '~/data';
import { getJoinPermalink } from '../utils/permalinks';
const meta = {
title: 'PLEBNET.DEV Projects',
Expand All @@ -18,8 +20,8 @@ const meta = {
actions={[
{
type: "primary",
text: 'Sign Up',
href: '/join',
text: 'Join Us',
href: getJoinPermalink(),
},
]}
isSticky
Expand Down
2 changes: 1 addition & 1 deletion src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const get = async () => {
if (BLOG.disabled) {
return new Response(null, {
status: 404,
statusText: 'Not found',
statusText: 'Content Not found',
});
}

Expand Down
5 changes: 3 additions & 2 deletions src/pages/sponsors.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import Layout from '~/layouts/PageLayout.astro';
import Header from '~/components/widgets/Header.astro';
import Content from '~/components/widgets/Content.astro';
import {getJoinPermalink } from '../utils/permalinks';
import { headerData } from '~/data';
Expand All @@ -17,8 +18,8 @@ const meta = {
actions={[
{
type: 'primary',
text: 'Sign Up',
href: '/join',
text: 'Join Us',
href: getJoinPermalink(),
},
]}
isSticky
Expand Down
5 changes: 3 additions & 2 deletions src/pages/svelte-contact.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Header from '~/components/widgets/Header.astro';
import ContactForm from "../components/ContactForm.svelte";
import { headerData } from '~/data';
import {getJoinPermalink } from '../utils/permalinks';
const meta = {
title: 'PLEBNET.DEV Contact us',
Expand All @@ -17,8 +18,8 @@ const meta = {
actions={[
{
type: "primary",
text: 'Sign Up',
href: '/join',
text: 'Join Us',
href: getJoinPermalink(),
},
]}
isSticky
Expand Down
4 changes: 4 additions & 0 deletions src/utils/permalinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const POST_PERMALINK_PATTERN = trimSlash(BLOG?.post?.permalink || '/%slug
export const BLOG_BASE = cleanSlug(BLOG?.list?.pathname);
export const CATEGORY_BASE = cleanSlug(BLOG?.category?.pathname || 'category');
export const TAG_BASE = cleanSlug(BLOG?.tag?.pathname) || 'tag';
export const JOIN_US = 'join-us';

/** */
export const getCanonical = (path = ''): string | URL => {
Expand Down Expand Up @@ -70,6 +71,9 @@ export const getHomePermalink = (): string => getPermalink('/');
/** */
export const getBlogPermalink = (): string => getPermalink(BLOG_BASE);

/** */
export const getJoinPermalink = (): string => getPermalink(JOIN_US);

/** */
export const getAsset = (path: string): string =>
'/' +
Expand Down

0 comments on commit 05ad5f4

Please sign in to comment.