Commit 9b46ce1a authored by Wohlgemuth, Jason's avatar Wohlgemuth, Jason
Browse files

feat: Update to support new json-ld aligned acorn schema

parent 487b5194
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
    "dev:mac": "astro dev --host",
    "predownload": "npm run clean",
    "download": "./acorn download --buckets buckets.json --output src/data",
    "postdownload": "npm run format",
    "start": "astro dev",
    "build:projects": "./acorn export --path src/data/project --output public/pdf",
    "build:organizations": "./acorn export --path src/data/organization --output public/pdf",
+2 −2
Original line number Diff line number Diff line
@@ -6,11 +6,11 @@ const { contact } = Astro.props;
    {contact && <p class="contact">
        <span>Contact</span>
        <span class="spacer">|</span>
        <span class="name"><a href={contact.profile}>{contact.first} {contact.last}</a></span>
        <span class="name"><a href={contact.profile}>{contact.givenName} {contact.familyName}</a></span>
        <span class="spacer">|</span>
        <span class="email">{contact.email}</span>
        <span class="spacer">|</span>
        <span class="phone">{contact.phone}</span>
        <span class="phone">{contact.telephone}</span>
    </p>}
    <img class="logo" src="/assets/logo_ornl_green.svg" alt="ORNL Logo" />
    <img
+12 −5
Original line number Diff line number Diff line
@@ -41,8 +41,8 @@ const search = items => {
            'sections.outcomes',
            'sections.research.focus',
            'sections.research.areas',
            'contact.first',
            'contact.last',
            'contact.givenName',
            'contact.familyName',
            'contact.organization',
        ],
    };
@@ -82,8 +82,8 @@ export default ({ items }) => {
                    <h4>
                        {
                            type === 'highlight'
                                ? <a href={`/pdf/${item?.meta.id}.pdf`}>{item?.title}</a>
                                : <a href={`/${item?.meta.id}`}>{item?.title}</a>
                                ? <a href={`/pdf/${item?.meta.identifier}.pdf`}>{item?.title}</a>
                                : <a href={`/${item?.meta.identifier}`}>{item?.title}</a>
                        }
                    </h4>
                    {item?.score && <span className="search-score">{formatScoreText(item?.score)}</span>}
@@ -95,7 +95,14 @@ export default ({ items }) => {
                        ))
                    }
                </div>
                <p>{item?.sections?.introduction}</p>
                <p>
                    {item?.sections?.introduction}
                    {
                        type === 'organization'
                            ? item?.sections?.mission
                            : item?.sections?.introduction
                    }
                </p>
            </>
        );
    };
+5 −5
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ const {

export async function getStaticPaths() {
	return (await getCollection("organizations")).map(({ data }) => ({
		params: { organization: data.meta.id.toLowerCase() },
		params: { organization: data.meta.identifier.toLowerCase() },
	}));
}
---
@@ -55,15 +55,15 @@ export async function getStaticPaths() {
			</div>
			{
				meta?.websites?.length > 0 &&
					meta.websites.map(({ title, url }) => {
					meta.websites.map(({ description, url }) => {
						return (
							<a class="link" target="_blank" href={url}>
								{title}
								{description}
							</a>
						);
					})
			}
			<a class="pdf" target="_blank" href=`/pdf/${meta.id}.pdf`
			<a class="pdf" target="_blank" href=`/pdf/${meta.identifier}.pdf`
				>Download PDF Fact Sheet</a
			>
			<a id="qr-code-link" class="qrcode">Display QR Code</a>
@@ -71,7 +71,7 @@ export async function getStaticPaths() {
		</aside>
	</main>
	<Footer contact={contact} />
	<QrCode data={`https://research.ornl.gov/${meta.id}`} />
	<QrCode data={`https://research.ornl.gov/${meta.identifier}`} />
</Layout>
<script>
	const label = "qr-code";
+5 −5
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ const {

export async function getStaticPaths() {
	return (await getCollection("projects")).map(({ data }) => ({
		params: { project: data.meta.id.toLowerCase() },
		params: { project: data.meta.identifier.toLowerCase() },
	}));
}
---
@@ -59,15 +59,15 @@ export async function getStaticPaths() {
			</div>
			{
				meta?.websites?.length > 0 &&
					meta.websites.map(({ title, url }) => {
					meta.websites.map(({ description, url }) => {
						return (
							<a class="link" target="_blank" href={url}>
								{title}
								{description}
							</a>
						);
					})
			}
			<a class="pdf" target="_blank" href=`/pdf/${meta.id}.pdf`
			<a class="pdf" target="_blank" href=`/pdf/${meta.identifier}.pdf`
				>Download PDF Fact Sheet</a
			>
			<a id="qr-code-link" class="qrcode">Display QR Code</a>
@@ -75,7 +75,7 @@ export async function getStaticPaths() {
		</aside>
	</main>
	<Footer contact={contact} />
	<QrCode data={`https://research.ornl.gov/${meta.id}`} />
	<QrCode data={`https://research.ornl.gov/${meta.identifier}`} />
</Layout>
<script>
	const label = "qr-code";