Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Jazee6 committed Jul 30, 2024
2 parents 9343432 + f333f84 commit 7eb5ce8
Show file tree
Hide file tree
Showing 9 changed files with 427 additions and 572 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "astro-blur",
"type": "module",
"version": "0.2.0",
"version": "0.2.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand All @@ -12,18 +12,18 @@
"new": "node scripts/new-post.js"
},
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/mdx": "^3.1.1",
"@astrojs/rss": "^4.0.6",
"@astrojs/check": "^0.8.3",
"@astrojs/mdx": "^3.1.3",
"@astrojs/rss": "^4.0.7",
"@astrojs/sitemap": "^3.1.6",
"@astrojs/tailwind": "^5.1.0",
"@iconify-json/material-symbols": "^1.1.82",
"astro": "^4.10.3",
"@iconify-json/material-symbols": "^1.1.85",
"astro": "^4.12.2",
"astro-icon": "^1.1.0",
"tailwindcss": "^3.4.4",
"typescript": "^5.4.5"
"tailwindcss": "^3.4.7",
"typescript": "^5.5.4"
},
"packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0",
"packageManager": "pnpm@9.6.0",
"devDependencies": {
"@tailwindcss/typography": "^0.5.13",
"pagefind": "^1.1.0",
Expand Down
960 changes: 405 additions & 555 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/Pagination.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {Page} from "astro";
import {Icon} from 'astro-icon/components'
interface Props {
page: Page<CollectionEntry<'blog'>>
page: Page<CollectionEntry<'posts'>>
class?: string
}
Expand Down
9 changes: 7 additions & 2 deletions src/components/Search.astro
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@
searchInput.addEventListener("input", async e => {
if (e.target.dataset.loaded !== 'true') {
e.target.dataset.loaded = 'true'
window.pagefind = await import("/pagefind/pagefind.js");
window.pagefind = await import("/dist/pagefind/pagefind.js");
pagefind.init()
}

const input = e.target.value.trim()
if (input.length) {
const search = await window.pagefind.search(input)
// window.pagefind.preload(input)
const search = await window.pagefind.debouncedSearch(input)
if (search === null) {
return
}
const searchResults = document.querySelector("#search-results")
searchResults.innerHTML = ""
for (const result of search.results) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/about.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {data, render} = about;
const {Content} = await render()
---
<PageLayout title={getTitle('About')} description={getDesc('The About Page')}>
<article class="article-global">
<article class="article-global" data-pagefind-body>
<h1>{data.title}</h1>
<Content/>
</article>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/links.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const links: {
}[] = data.sort(() => Math.random() - 0.5);
---
<PageLayout comments={true} title={getTitle('Links')} description={getDesc('The Links Page')}>
<ul class="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-4">
<ul data-pagefind-body class="grid lg:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-4">
{links.map(({title, description, url, avatar}) => (
<li>
<a href={url} target="_blank" class="flex h-24 card p-2">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/posts/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const {Content, headings, remarkPluginFrontmatter}: {
</div>
</slot>
<div class="grow">
<article class="article-global">
<article class="article-global" data-pagefind-body>
<h1 id={data.title}>{data.title}</h1>

<div class="flex space-x-4">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/projects.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const projects: {
}[] = data;
---
<PageLayout title={getTitle('Projects')} description={getDesc('The Projects Page')}>
<ul>
<ul data-pagefind-body>
{projects.map(({title, repo, description}) => (
<li>
<a href={repo} target="_blank" class="flex items-baseline p-4 card mb-4">
Expand Down
2 changes: 1 addition & 1 deletion src/utils/remark-modified-time.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {execSync} from "child_process";
export function remarkModifiedTime() {
return function (tree, file) {
const filepath = file.history[0];
const result = execSync(`git log -1 --pretty="format:%cI" "${filepath}"`);
const result = execSync(`git log -1 --pretty="format:%cI" -- "${filepath}"`);
file.data.astro.frontmatter.lastModified = result.toString();
};
}

0 comments on commit 7eb5ce8

Please sign in to comment.