Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix updated date #249

Merged
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
31 changes: 18 additions & 13 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ import compress from 'astro-compress'
import { defineConfig } from 'astro/config'
import sitemap from '@astrojs/sitemap'
import tailwind from '@astrojs/tailwind'
import { modifiedTime } from './src/utils/modifiedTime.mjs'
import { filePath } from './src/utils/filePath.mjs'

// https://astro.build/config
export default defineConfig({
integrations: [
preact({
include: ['**/preact/*'],
}),
react({
include: ['**/react/*'],
}),
mdx(),
compress(),
sitemap(),
tailwind(),
],
site: `https://bewebdev.tech/`,
integrations: [
preact({
include: ['**/preact/*'],
}),
react({
include: ['**/react/*'],
}),
mdx(),
compress(),
sitemap(),
tailwind(),
],
markdown: {
remarkPlugins: [modifiedTime, filePath],
},
site: `https://bewebdev.tech/`,
})
23 changes: 0 additions & 23 deletions src/components/ArticleUpdateDate/ArticleUpdateDate.tsx

This file was deleted.

35 changes: 0 additions & 35 deletions src/components/ArticleUpdateDate/useArticleDate.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/RightSidebar/RightSidebar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { headings, githubEditUrl } = Astro.props as Props
---

<nav class='w-full sticky top-0' aria-labelledby='grid-right'>
<div class='h-full overflow-auto'>
<div class='h-full overflow-auto pb-32'>
<TableOfContents client:only='preact' headings={headings} />
<MoreMenu editHref={githubEditUrl} />
</div>
Expand Down
7 changes: 1 addition & 6 deletions src/components/RightSidebar/TableOfContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,22 @@ type ItemOffsets = {
type ListLinkProps = {
href: string
children: ReactNode
className?: string
depth?: number
}

const ListLink = ({
children,
href,
className = '',
depth = 0,
}: ListLinkProps) => {
const linkCss =
'hover:bg-basetext/10 rounded-md group-hover:border-b-transparent block px-4 py-1 text-sm scroll-mt-32 max-w-[170px] ' +
className

return (
<li className='p-1 border-b-2 border-b-basetext/10 last:border-0'>
<a
style={{
paddingLeft: `${depth * 8}px`,
}}
className={linkCss}
className='hover:bg-basetext/10 rounded-md group-hover:border-b-transparent block px-4 py-1 text-sm scroll-mt-32 md:whitespace-nowrap'
href={href}
>
{children}
Expand Down
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export type Frontmatter = {
dir?: 'ltr' | 'rtl'
ogLocale?: string
lang?: string
filePath?: string
lastModified?: string
}

export const GITHUB_EDIT_URL = `https://github.com/NowYouKnowProgramming/webdev-learning-materials/tree/main`
Expand Down
Loading