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

Locationenv #25

Merged
merged 2 commits into from
Oct 18, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Set env
run: echo "{VITE_XDI_REPO_LOCATION}={$DATA_REPO}" >> $GITHUB_ENV
- name: Run build
run: pnpm run build --base=/webxdiviewer/
- name: Uploading production-ready build files
Expand Down
12 changes: 9 additions & 3 deletions src/components/WelcomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Link } from "react-router-dom";
import { Container, Typography, Box } from "@mui/material";

const env_repo_location = import.meta.env.VITE_SOME_KEY;

function WelcomePage() {

const repo_location = env_repo_location ?? "examplerepo/xdifiles"

console.log(repo_location)
return (
<Container maxWidth="md" sx={{ alignSelf: "center", p: "24px" }}>
<Typography variant="h4" padding="24px">
Expand All @@ -16,9 +22,9 @@ function WelcomePage() {
stored in a github repository. As part of the website build process,
the XDI files are pulled in and indexed, giving simple static website
to display open data. The website is currently pointing as a fork of
the data in the{" "}
<Link to={"https://github.com/XraySpectroscopy/XASDataLibrary"}>
XASDataLibrary
the data in{" "}
<Link to={"https://github.com/" + repo_location}>
{repo_location}
</Link>
.
</Typography>
Expand Down
Loading