Skip to content

Commit

Permalink
fix: make it all work again
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnl committed Nov 6, 2024
1 parent 23f9798 commit 9737937
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/syslog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default async function Page({ params }: { params: { slug: string } }) {
{hasSpline && !isMobile ?
<PostFeatured3D
// @ts-ignore
splineURL={postDetails.feature_spline}
splineURL={postDetails.splineUrl}
// @ts-ignore
placeholderBlurDataURL={postDetails.splineImagePlaceholderUrl}
// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion components/PostFeatured3D/PostFeatured3D.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.splineWrapper {
flex: 1;
position: relative;
height: 100%;
height: 350px;
filter: blur(0px);

transition-property: filter;
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const config = {
})
const prefix = config.assetPrefix ?? config.basePath ?? '';
config.module.rules.push({
test: /\.mp4$/,
test: /\.(mp4|splinecode)$/,
use: [{
loader: 'file-loader',
options: {
Expand Down
2 changes: 1 addition & 1 deletion posts/kybervarusmieshaku/post.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Palvelus kybervarusmiehenä? Haku saapumiseriin 2/25 ja 1/26 auki!
category: Kyber
feature_image: kyber2.png
feature_spline_image: kyber-spline.jpg
feature_spline: https://prod.spline.design/zFVjCtO2eGUcDLk7/scene.splinecode
feature_spline: scene.splinecode
excerpt: Kybervarusmiespalvelus tunnetaan syystäkin hieman salamyhkäisenä palvelustehtävänä. Seula sisäänpääsyyn on tiukka, mutta palvelustehtävä on palkitseva.
authors:
- ts:61d8846356a221b65bfae359
Expand Down
Binary file modified posts/kybervarusmieshaku/scene.splinecode
Binary file not shown.
6 changes: 5 additions & 1 deletion utils/posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,22 @@ async function getPostDetails(fileName: string) {

let splineImageUrl = null;
let splineImagePlaceholderUrl = null;
let splineUrl = null;
if (serialized.frontmatter.feature_spline_image) {
const splineImage = require('../posts/' + slug + '/' + serialized.frontmatter.feature_spline_image).default;
splineImageUrl = splineImage.src;
splineImagePlaceholderUrl = splineImage.blurDataURL;

const spline = require('../posts/' + slug + '/' + serialized.frontmatter.feature_spline).default;
splineUrl = spline;
}

const authorsResolved = await Promise.all((serialized.frontmatter.authors as string[]).map(async (id) => ({
name: id.startsWith('ts:') ? await api.getMemberDisplayName((id || "").replace('ts:', '')) : id,
_id: id || ""
})));

return {...serialized.frontmatter, slug, readingTime, imagePlaceholder, imageUrl, splineImageUrl, splineImagePlaceholderUrl, authorsResolved } as PostDetails;
return {...serialized.frontmatter, slug, readingTime, imagePlaceholder, imageUrl, splineImageUrl, splineImagePlaceholderUrl, splineUrl, authorsResolved } as PostDetails;
}

/**
Expand Down
1 change: 1 addition & 0 deletions utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,5 @@ export type PostDetails = {
feature_spline?: string;
splineImagePlaceholderUrl?: string | null;
splineImageUrl?: string | null;
splineUrl?: string | null;
};

0 comments on commit 9737937

Please sign in to comment.