Skip to content

Commit ca04a2d

Browse files
author
tkokhing
committed
major revamp - incorporate heptagoning and new checks features
1 parent 60f7eb9 commit ca04a2d

15 files changed

Lines changed: 249 additions & 15 deletions

File tree

.github/workflows/nextjs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ jobs:
2020
steps:
2121
- name: Checkout full branches
2222
uses: actions/checkout@v4
23+
- name: Checkout [heptagoning] private repo
24+
uses: actions/checkout@v4
25+
with:
26+
repository: tkokhing/heptagoning
27+
token: ${{ secrets.PULL_HEPTAGONING_TOKEN }}
28+
path: temp_heptagoning
29+
- name: Move [_kill-chain] folder inside _heptagoning to correct level
30+
id: move_heptagoning_kill-chain
31+
run: |
32+
mkdir -p _heptagoning/_kill-chain
33+
mv ./temp_heptagoning/_kill-chain/*.mdx ./_heptagoning/_kill-chain
34+
rm -rf ./temp_heptagoning
2335
- name: Checkout [tkokhing_lib] private repo
2436
uses: actions/checkout@v4
2537
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ tkokhing.github.io.code-workspace
2929
/_frontier_post/
3030
/_topic_post
3131
/_linux_post
32+
/_heptagoning
3233
/public
3334

3435
# production

src/app/_components/main_frame/icons_svg.tsx

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,70 @@ export const TopicWithTextIcon: React.FC<IconProps> = ({ height = 50, fillColour
168168
);
169169
};
170170

171+
export const HeptagoningWithTextIcon: React.FC<IconProps> = ({ height = 50, fillColour = "#0071C1", hoverColour = "#D9F99D" }) => {
172+
const [hoverOn, setHover] = useState(false);
173+
174+
return (
175+
<svg
176+
version="1.1"
177+
viewBox={hoverOn ? "0 0 1179 333" : "0 0 359 333"}
178+
xmlns="http://www.w3.org/2000/svg"
179+
x="0" y="0"
180+
width="100%"
181+
height={height}
182+
onMouseEnter={() => setHover(true)}
183+
onMouseLeave={() => setHover(false)}
184+
>
185+
<g stroke={fillColour} fillRule="evenodd" strokeLinecap="round" opacity={hoverOn ? "0.000000" : "1.000000"}>
186+
<rect x="27" y="15" width="304" height="304" strokeWidth="7.66667" strokeMiterlimit="8" fill="none"/>
187+
<g strokeWidth="12">
188+
<line x1="180.414" y1="46.794" x2="276.813" y2="94.396" />
189+
<line x1="276.813" y1="94.396" x2="300.631" y2="201.398" />
190+
<line x1="300.631" y1="201.398" x2="233.826" y2="287.180" />
191+
<line x1="233.826" y1="287.180" x2="130.438" y2="287.180" />
192+
<line x1="130.438" y1="287.180" x2="57.400" y2="201.398" />
193+
<line x1="57.400" y1="201.398" x2="81.191" y2="94.396" />
194+
<line x1="81.191" y1="94.396" x2="180.414" y2="46.794" />
195+
</g>
196+
<g strokeWidth="5">
197+
<line x1="180.1018" y1="176.7104" x2="180.414" y2="46.794" />
198+
<line x1="180.1018" y1="176.7104" x2="276.813" y2="94.396" />
199+
<line x1="180.1018" y1="176.7104" x2="300.631" y2="201.398" />
200+
<line x1="180.1018" y1="176.7104" x2="233.826" y2="287.180" />
201+
<line x1="180.1018" y1="176.7104" x2="130.438" y2="287.180" />
202+
<line x1="180.1018" y1="176.7104" x2="57.400" y2="201.398" />
203+
<line x1="180.1018" y1="176.7104" x2="81.191" y2="94.396" />
204+
</g>
205+
</g>
206+
{hoverOn && (
207+
<g fill={hoverColour} stroke={hoverColour} strokeLinecap="round" opacity="1.000000">
208+
<rect x="27" y="14.9936" width="1127" height="303.871" stroke={hoverColour} strokeWidth="7.66992" strokeMiterlimit="8" fill="none"/>
209+
<path d="M331.5 36.4845 331.5 298.085" stroke={hoverColour} strokeWidth="6.6695" strokeMiterlimit="8" fill="none" fillRule="evenodd"/>
210+
<text fontFamily="Georgia,Georgia_MSFontService,sans-serif" fontWeight="400" fontSize="113.333" transform="matrix(1 0 0 0.999576 388.082 227)">Heptagoning</text>
211+
<g strokeWidth="12">
212+
<line x1="180.414" y1="46.794" x2="276.813" y2="94.396" />
213+
<line x1="276.813" y1="94.396" x2="300.631" y2="201.398" />
214+
<line x1="300.631" y1="201.398" x2="233.826" y2="287.180" />
215+
<line x1="233.826" y1="287.180" x2="130.438" y2="287.180" />
216+
<line x1="130.438" y1="287.180" x2="57.400" y2="201.398" />
217+
<line x1="57.400" y1="201.398" x2="81.191" y2="94.396" />
218+
<line x1="81.191" y1="94.396" x2="180.414" y2="46.794" />
219+
</g>
220+
<g strokeWidth="5">
221+
<line x1="180.1018" y1="176.7104" x2="180.414" y2="46.794" />
222+
<line x1="180.1018" y1="176.7104" x2="276.813" y2="94.396" />
223+
<line x1="180.1018" y1="176.7104" x2="300.631" y2="201.398" />
224+
<line x1="180.1018" y1="176.7104" x2="233.826" y2="287.180" />
225+
<line x1="180.1018" y1="176.7104" x2="130.438" y2="287.180" />
226+
<line x1="180.1018" y1="176.7104" x2="57.400" y2="201.398" />
227+
<line x1="180.1018" y1="176.7104" x2="81.191" y2="94.396" />
228+
</g>
229+
</g>
230+
)}
231+
</svg>
232+
);
233+
};
234+
171235
export const ResearchWithTextIcon: React.FC<IconProps> = ({ height = 50, fillColour = "#0071C1", hoverColour = "#D9F99D" }) => {
172236
const [hoverOn, setHover] = useState(false);
173237

@@ -332,6 +396,7 @@ export default {
332396
HomeWithTextIcon,
333397
BlogWithTextIcon,
334398
TopicWithTextIcon,
399+
HeptagoningWithTextIcon,
335400
ResearchWithTextIcon,
336401
SystemModeIcon,
337402
DarkModeIcon,

src/app/_components/main_frame/navi-bar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { useEffect } from "react";
44
import { usePathname } from "next/navigation";
55
import { Disclosure, DisclosureButton, DisclosurePanel, Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/react";
66
import { Bars3Icon, BellIcon, XMarkIcon } from "@heroicons/react/24/outline";
7-
import { HomeWithTextIcon, BlogWithTextIcon, TopicWithTextIcon, ResearchWithTextIcon } from "@/app/_components/main_frame/icons_svg";
8-
import { ProfileLogoSVG } from "@/app/_components/main_frame/icons_svg";
7+
import { ProfileLogoSVG, HomeWithTextIcon, BlogWithTextIcon, TopicWithTextIcon, HeptagoningWithTextIcon, ResearchWithTextIcon } from "@/app/_components/main_frame/icons_svg";
98
import { useNavigation } from "@/app/_components/main_frame/navigation-context";
109
import { TKOKHING_LOGO_SVG_URL } from "@/lib/share/constants";
1110
import { ThemeSwitcher } from "@/app/_components/main_frame/theme-switcher";
@@ -27,6 +26,7 @@ const navigation = [
2726
{ name: 'Home', href: '/', icon: HomeWithTextIcon },
2827
{ name: 'Blog', href: '/blog', icon: BlogWithTextIcon },
2928
{ name: 'Topics', href: '/topics', icon: TopicWithTextIcon },
29+
{ name: 'heptagoning', href: '/heptagoning', icon: HeptagoningWithTextIcon},
3030
{ name: 'Research', href: '/research', icon: ResearchWithTextIcon },
3131
];
3232

src/app/_components/post_gen/post-list-concise.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,21 @@ import { Suspense } from "react";
77

88
type Props = {
99
dir: string;
10+
chosen_subPath: string;
1011
};
1112

12-
export function PostListConcise ({ dir }: Props) {
13+
export function PostListConcise ({ dir, chosen_subPath }: Props) {
1314
const allPosts = getAllPosts(dir);
1415

16+
const filteredPosts = allPosts.filter(
17+
(post) => post.subPath === chosen_subPath
18+
);
19+
1520
return (
1621
<main>
1722
<Container>
1823
<Suspense>
19-
{allPosts.length > 0 && <MoreStoriesConcise posts={allPosts} />}
24+
{filteredPosts.length > 0 && <MoreStoriesConcise posts={filteredPosts} />}
2025
</Suspense>
2126
</Container>
2227
</main>

src/app/blog/posts/[slug]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { generatePageStaticParams } from "@/lib/share/generatePageStaticParams";
77
import Container from "@/app/_components/preference/container";
88
import { PostHeader } from "@/app/_components/post_gen/post-header";
99
import { PostBody } from "@/app/_components/post_gen/post-body";
10-
import { ToggleFrame } from "@/app/_components/preference/toggle-frame";
1110
import { FrontierData } from "@/app/_components/preference/data-exporter";
1211
import { FrontierLeadinData } from "@/app/_components/preference/data-exporter";
12+
import { ToggleFrame } from "@/app/_components/preference/toggle-frame";
1313
import { PostListConcise } from "@/app/_components/post_gen/post-list-concise";
1414

1515
const MDX_FOLDER = "_blog_post/_blogs";
@@ -22,14 +22,14 @@ type Params = {
2222

2323
export default async function Post(props: Params) {
2424
const params = await props.params;
25-
const post = getPostBySlug(params.slug, MDX_FOLDER);
2625
const ImportComponents = {
2726
FrontierData,
2827
FrontierLeadinData,
2928
ToggleFrame,
3029
PostListConcise,
3130
};
32-
if (!post) return notFound();
31+
const post = getPostBySlug(params.slug, MDX_FOLDER);
32+
if (!post || post.subPath != 'blog/posts') return notFound();
3333

3434
return (
3535
<main>

src/app/blog/posts/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
import { PostListConcise } from "@/app/_components/post_gen/post-list-concise";
33

44
export default function BlogPostListPage() {
5-
return <PostListConcise dir={"_blog_post/_blogs"} />
5+
return <PostListConcise dir={"_blog_post/_blogs"} chosen_subPath={"blog/posts"}/>
66
}

src/app/blog/posts/securing-digital-frontiers/[slug]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ type Params = {
2020

2121
export default async function Post(props: Params) {
2222
const params = await props.params;
23-
const post = getPostBySlug(params.slug, MDX_FOLDER);
2423
const ImportComponents = {
2524
CyberDomainData,
2625
CyberThreatsData,
2726
BlueprintBattlefieldData,
2827
};
29-
if (!post) return notFound();
28+
const post = getPostBySlug(params.slug, MDX_FOLDER);
29+
if (!post || post.subPath != 'blog/posts/securing-digital-frontiers') return notFound();
3030

3131
return (
3232
<main>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// [tkokhing/topic_post/_topic_post/_topics] MDX_FOLDER
2+
import { Metadata } from "next";
3+
import { notFound } from "next/navigation";
4+
import Container from "@/app/_components/preference/container";
5+
import { PostHeader } from "@/app/_components/post_gen/post-header";
6+
import { PostBody } from "@/app/_components/post_gen/post-body";
7+
import { getPostBySlug } from "@/lib/share/api";
8+
import { generatePageMetadata } from "@/lib/share/generatePageMetadata";
9+
import { generatePageStaticParams } from "@/lib/share/generatePageStaticParams";
10+
import { ToggleFrame } from "@/app/_components/preference/toggle-frame";
11+
import { PostListConcise } from "@/app/_components/post_gen/post-list-concise";
12+
13+
const MDX_FOLDER = "_heptagoning/_kill-chain";
14+
15+
type Params = {
16+
params: Promise<{
17+
slug: string;
18+
}>;
19+
};
20+
21+
export default async function Post(props: Params) {
22+
const params = await props.params;
23+
const ImportComponents = {
24+
ToggleFrame,
25+
PostListConcise,
26+
};
27+
const post = getPostBySlug(params.slug, MDX_FOLDER);
28+
if (!post || post.subPath != 'heptagoning/kill-chain') return notFound();
29+
30+
return (
31+
<main>
32+
<Container>
33+
<article className="mb-32">
34+
<PostHeader
35+
title={post.title}
36+
coverImage={post.coverImage}
37+
date={post.date}
38+
author={post.author}
39+
subPath={post.subPath}
40+
postStatus={post.postStatus}
41+
/>
42+
<PostBody content={post.content} components={ImportComponents}/>
43+
</article>
44+
</Container>
45+
</main>
46+
);
47+
}
48+
49+
export async function generateMetadata(props: Params): Promise<Metadata> {
50+
const params = await props.params;
51+
return generatePageMetadata(params.slug, MDX_FOLDER);
52+
}
53+
54+
export async function generateStaticParams() {
55+
return generatePageStaticParams(MDX_FOLDER);
56+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { PostListConcise } from "@/app/_components/post_gen/post-list-concise";
2+
3+
export default function KillChainIndexPage() {
4+
return <PostListConcise dir={"_heptagoning/_kill-chain"} chosen_subPath={"heptagoning/kill-chain"}/>
5+
}

0 commit comments

Comments
 (0)