[examples/openspending][m] - added loader + fetching from datapackage

- Also added an indexing example
This commit is contained in:
Luccas Mateus de Medeiros Gomes
2023-05-17 14:57:50 -03:00
parent ebcb93c996
commit 902e5e07a0
11 changed files with 2051 additions and 87 deletions

View File

@@ -38,7 +38,7 @@ export default function ProjectPage({ project }) {
</tr>
</thead>
<tbody className="divide-y divide-gray-200">
{project.files.map((file) => (
{project.files?.map((file) => (
<tr key={file.download_url}>
<td className="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<a href={file.download_url}>{file.name}</a>
@@ -79,7 +79,7 @@ export async function getStaticPaths() {
repo.readme && repo.readme.split('/').length > 1
? repo.readme.split('/').slice(0, -1)
: null;
let path = [repo.repo];
let path = [repo.name];
if (projectPath) {
projectPath.forEach((element) => {
path.push(element);
@@ -105,7 +105,7 @@ export async function getStaticProps({ params }) {
_repo.readme && _repo.readme.split('/').length > 1
? _repo.readme.split('/').slice(0, -1)
: null;
let path = [_repo.repo];
let path = [_repo.name];
if (projectPath) {
projectPath.forEach((element) => {
path.push(element);