Skip to content

Commit

Permalink
fixes for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
raffazizzi committed Oct 26, 2024
1 parent 7a995f9 commit 61988da
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type { GatsbyConfig } from "gatsby";

const baseId = process.env.AIRTABLE_SCD_BASE_ID;
const basePath = process.env.BASEPATH

const config: GatsbyConfig = {
pathPrefix: basePath,
siteMetadata: {
title: `scd`,
siteUrl: `https://www.yourdomain.tld`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"develop": "node --env-file=.env node_modules/.bin/gatsby develop",
"start": "node --env-file=.env node_modules/.bin/gatsby develop",
"build": "node --env-file=.env node_modules/.bin/gatsby build",
"build-pages": "BASEPATH=/scd gatsby build --prefix-paths",
"build-pages": "BASEPATH=/scd node --env-file=.env node_modules/.bin/gatsby build --prefix-paths",
"serve": "gatsby serve",
"clean": "gatsby clean",
"typecheck": "tsc --noEmit"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Header = () => {
RPTF/ARSC Sound Collections Database
</Link>
<ul className="flex basis-auto justify-end grow items-center list-none text-slate-100">
<li className="p-2 hover:text-slate-300"><Link to="about">About</Link></li>
<li className="p-2 hover:text-slate-300"><Link to="/about">About</Link></li>
<li className="p-2 hover:text-slate-300"><Link to="#">Recommend a Collection</Link></li>
</ul>
</nav>
Expand Down
10 changes: 7 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import * as React from "react"
import type { HeadFC, PageProps } from "gatsby"
import { withPrefix, type HeadFC, type PageProps } from "gatsby"
import Layout from "../components/Layout"
import Button from "../components/Button"

const IndexPage: React.FC<PageProps> = () => {
const heroStyle = {
backgroundImage: `linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url(${withPrefix("/images/werd.jpg")})`
}

return (
<Layout>
<div className="hero bg-linear min-h-[70vmin] bg-center bg-no-repeat bg-cover relative border-r-0 px-0 py-16 mb-8">
<div className="bg-linear min-h-[70vmin] bg-center bg-no-repeat bg-cover relative border-r-0 px-0 py-16 mb-8" style={heroStyle}>
<div className="w-full max-w-hlg md:flex-nowrap md:justify-start justify-between items-center px-4 m-auto flex flex-[0 0 50%]">
<div className="max-w-[50%] text-gray-200">
<h2 className="text-[2rem] mb-2 leading-tight" id="welcome-to-the-sound-collections-database">Welcome to the Sound Collections Database!</h2>
Expand All @@ -16,7 +20,7 @@ const IndexPage: React.FC<PageProps> = () => {
<p>Use the search box above to search for collections by keyword. You can also click below to browse everything, or to recommend collections for inclusion.</p>

<p>
<Button href="/search">Browse</Button>
<Button href="search">Browse</Button>
<Button href="#">Recommend a collection</Button>
</p>
<p>Image: <a href="https://artsandculture.google.com/asset/werd-radio-station/NAGIYZDoGYaZPA">WERD radio station</a>, <a href="https://aaamc.indiana.edu/"><abbr title="Archives of African American Music and Culture">AAAMC</abbr></a></p>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const SearchPage: React.FC<PageProps> = ({data}) => {
} else {
urlParams.append("sort", val)
}
history.pushState(null, '', '/search/?' + urlParams.toString());
history.pushState(null, '', '?' + urlParams.toString());
}

const handlePageChange = (_event: React.ChangeEvent<unknown>, page: number) => {
Expand Down Expand Up @@ -143,7 +143,7 @@ const SearchPage: React.FC<PageProps> = ({data}) => {
if (newP > 0 && newP <= totalPages) {
setCurrentPage(newP)
// Update search without refreshing the page.
history.pushState(null, '', '/search/?' + urlParams.toString());
history.pushState(null, '', '?' + urlParams.toString());
}
}
return <div>{prev}<strong>{startIndex+1}{endIndex}</strong> of <strong>{results.length}</strong>{next}</div>
Expand Down
6 changes: 4 additions & 2 deletions src/pages/{markdownRemark.frontmatter__slug}.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ export default function MdPageTemplate({data}: MdPageTemplateProps) {
const { frontmatter, html } = markdownRemark
return (
<Layout>
<h1>{frontmatter.title}</h1>
<div dangerouslySetInnerHTML={{ __html: html }} />
<div className="w-full max-w-hlg md:flex-nowrap md:justify-start justify-between items-center px-4 m-auto">
<h2 className="text-4xl">{frontmatter.title}</h2>
<div dangerouslySetInnerHTML={{ __html: html }}/>
</div>
</Layout>
)
}
Expand Down
3 changes: 0 additions & 3 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
@apply text-base relative pb-32;
}
.hero {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("/images/werd.jpg");
}
}
3 changes: 0 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ module.exports = {
},
maxWidth: {
'hlg': '1140px'
},
backgroundImage: {
'hero-pattern': "url('/images/werd.jpg')",
}
},
},
Expand Down

0 comments on commit 61988da

Please sign in to comment.