Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion components/Blog/Byline/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import classNames from 'classnames';
import AvatarGroup from '@node-core/ui-components/Common/AvatarGroup';
import Avatar from '@node-core/ui-components/Common/AvatarGroup/Avatar';
import withIsland from '../../../node_modules/@doc-kit/generator-react/src/html/ui/islands/withIsland.jsx';

import styles from './index.module.css';

Expand Down Expand Up @@ -50,7 +51,7 @@ const authorLabel = authors => {
* className?: string,
* }} props
*/
export default function Byline({ authors, date, size = 'sm', className }) {
function Byline({ authors, date, size = 'sm', className }) {
const format = size === 'md' ? fullDate : shortDate;
const avatarSize = size === 'md' ? 'medium' : 'small';

Expand Down Expand Up @@ -81,3 +82,5 @@ export default function Byline({ authors, date, size = 'sm', className }) {
</div>
);
}

export default withIsland(Byline, { name: 'Byline', on: { idle: true } });
10 changes: 8 additions & 2 deletions components/MetaBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import GitHubIcon from '@node-core/ui-components/Icons/Social/GitHub';
import useSponsors from '../../hooks/useSponsors.mjs';
import { editURL } from '#theme/config';
import SponsorCard from '../Sponsors/Card/index.jsx';
import withIsland from '../../node_modules/@doc-kit/generator-react/src/html/ui/islands/withIsland.jsx';

import styles from './index.module.css';

const OC_URL = 'https://opencollective.com/webpack';

export default ({ metadata, headings = [], readingTime }) => {
function MetaBarComponent({ metadata, headings = [], readingTime }) {
const { sponsors } = useSponsors();
const platinumSponsors = sponsors
.filter(sponsor => sponsor.monthly.tier === 'platinum')
Expand Down Expand Up @@ -71,4 +72,9 @@ export default ({ metadata, headings = [], readingTime }) => {
}}
/>
);
};
}

export default withIsland(MetaBarComponent, {
name: 'MetaBar',
on: { idle: true },
});
8 changes: 7 additions & 1 deletion layouts/Blog/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect, useState } from 'react';

import BasePagination from '@node-core/ui-components/Common/BasePagination';
import withIsland from '../../node_modules/@doc-kit/generator-react/src/html/ui/islands/withIsland.jsx';

import NavBar from '../../components/NavBar.jsx';
import Footer from '../../components/Footer/index.jsx';
Expand Down Expand Up @@ -38,7 +39,7 @@ const hrefFor = ({ category, page }) => {
/**
* @param {{ metadata: object }} props
*/
export default function BlogLayout({ metadata }) {
function BlogLayout({ metadata }) {
const [{ category, page }, setView] = useState({ category: ALL, page: 1 });

useEffect(() => {
Expand Down Expand Up @@ -116,3 +117,8 @@ export default function BlogLayout({ metadata }) {
</>
);
}

export default withIsland(BlogLayout, {
name: 'BlogLayout',
on: { idle: true },
});
2 changes: 1 addition & 1 deletion pages/guides/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Guides
authors: moshams272s
authors: moshams272
---

# Guides
Expand Down
5 changes: 5 additions & 0 deletions scripts/html/doc-kit.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ export default {
'#theme/Metabar': join(ROOT, 'components/MetaBar/index.jsx'),
'#theme/blog': join(ROOT, 'generated/blog.json'),
'#theme/Layout': join(ROOT, 'components/Layout.jsx'),
'#theme/BlogLayout': join(ROOT, 'layouts/Blog/index.jsx'),
'#theme/Blog/Byline': join(ROOT, 'components/Blog/Byline/index.jsx'),
'#theme/Navigation': join(ROOT, 'components/NavBar.jsx'),
'#theme/Footer': join(ROOT, 'components/Footer/index.jsx'),
'#theme/Logo': join(ROOT, 'components/Icons/Webpack.jsx'),
Expand All @@ -119,6 +121,9 @@ export default {
ConfigSection: '#theme/Home/ConfigSection',
HomeSponsorSection: '#theme/Home/SponsorSection',
SponsorBoard: '#theme/Sponsors/Board',
BlogLayout: '#theme/BlogLayout',
Byline: '#theme/Blog/Byline',
MetaBar: '#theme/Metabar',
},
bundler: createViteBundler({
plugins: [tailwindcss()],
Expand Down