I have been working on this forever. I am getting an Error 404 /Quest/questlist.txt.
this is what I am using
``// QuestCarousel.tsx
import React, { useState, useEffect } from "react";
import { Carousel } from "@mantine/carousel";
import { TextInput } from "@mantine/core";
import "./index.css";
import { NavLink } from "react-router-dom";
const QUEST_FILE_PATH = "/dist/Quests/questlist.txt";
const QuestCarousel: React.FC = () => {
const [questList, setQuestList] = useState<string[]>([]);
const [searchQuery, setSearchQuery] = useState<string>("");
//const overlayDuration = 10000; // 10 seconds
useEffect(() => {
fetchQuestList();
}, []);
const fetchQuestList = async () => {
try {
const response = await fetch(`${QUEST_FILE_PATH}`);
const text = await response.text();
const quests = text.split(",");
setQuestList(quests);
console.log(quests);
} catch (error) {
console.error("Error fetching quest list:", error);
}
};
const filteredQuests = questList.filter((quest) =>
quest.toLowerCase().includes(searchQuery.toLowerCase())
);
function handleSearchChange(event: React.ChangeEvent<HTMLInputElement>) {
setSearchQuery(event.target.value);
}
return (
<>
<div>
<TextInput
label="Search for Quest"
placeholder="Type in a quest"
size="md"
value={searchQuery}
onChange={handleSearchChange}
/>
</div>
<div className="carousel-container">
<Carousel maw={320} mx="auto" withIndicators height={200}>
{filteredQuests.map((quest, index) => {
let questTEdit = quest.toLowerCase().split(" ");
let pattern = /[!,`']/g;
let modifiedQuestVal1 = questTEdit
.join("")
.replace(pattern, "");
return (
<Carousel.Slide key={index}>
<NavLink
to={"/QuestPage"}
state={{
questName: quest,
modified: modifiedQuestVal1,
}}
>
{quest}
</NavLink>
</Carousel.Slide>
);
})}
</Carousel>
</div>
</>
);
};
export default QuestCarousel;`
`
I have used:
`/../dist/questlist.txt`
`/../../dist/questlist.txt`
`./questlist.txt`
I am using Jekyll to deploy my site with :
`# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Debugging Step 1: List the contents of the directory
- name: List Contents
run: ls -R
- name: Setup Pages
uses: actions/configure-pages@v3
# Debugging Step 3: Print environment variables
- name: Print Environment Variables
run: env
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./dist
destination: ./_site
# Debugging Step 4: Display the contents of the _site directory
- name: Display _site Contents
run: ls -R ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
`
I put the debugging in to make sure everything is where it should be and it is :’) I also copied related files to the ./dist folder in hopes it would help but it did not
This is my directory structure (of course its closed :’))
I really want my pathing fixed I cant get my head wrapped around it.