From 8b1f5e0448e9563c2eb26f7bd969f0405d976782 Mon Sep 17 00:00:00 2001 From: Tilly Woodfield <22456167+tillywoodfield@users.noreply.github.com> Date: Thu, 8 Feb 2024 10:55:31 +0200 Subject: [PATCH] site: Fixes to local development --- README.md | 17 +++++++++++++---- site/package.json | 4 ++-- site/src/views/Home.vue | 7 +++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 85de27f..5cfb2b2 100644 --- a/README.md +++ b/README.md @@ -69,20 +69,29 @@ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install nodejs ``` -Then: +Install yarn: ``` sudo npm install -g yarn +``` + +Install dependencies: + +``` cd site yarn install -NODE_OPTIONS="--openssl-legacy-provider" yarn build ``` -Server the site/dist directory on the root of a webserver. +Start the development server: + +``` +yarn serve +``` -e.g. for development: +Build and view the site: ``` +yarn build cd site/dist python3 -m http.server --bind 127.0.0.1 8000 ``` diff --git a/site/package.json b/site/package.json index 291a34f..72cd361 100644 --- a/site/package.json +++ b/site/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "private": true, "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build", + "serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve", + "build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build", "lint": "vue-cli-service lint" }, "dependencies": { diff --git a/site/src/views/Home.vue b/site/src/views/Home.vue index 84f6387..c6c60e9 100644 --- a/site/src/views/Home.vue +++ b/site/src/views/Home.vue @@ -70,7 +70,7 @@

IATI data has been transfromed into tables in order to make it easier to work with relational tools. Below is the list of tables that have been created. Click on them to see the fields and types within.

-

Last Update: {{stats.updated.substring(0, 16)}}

+

Last Update: {{lastUpdated}}

@@ -146,7 +146,8 @@ export default { name: 'Home', components: { TableModal }, data: () => ({ - stats: { tables: [] } + stats: { tables: [] }, + lastUpdated: 'Unavailable' }), created: function () { this.fetchStats() @@ -161,6 +162,8 @@ export default { const response = await fetch('https://iati.fra1.digitaloceanspaces.com/stats.json') const stats = await response.json() this.stats = stats + const lastUpdated = new Date(stats.updated) + this.lastUpdated = lastUpdated.toGMTString() // this.$nextTick(() => VueScrollTo.scrollTo(window.location.hash)) }, scrollDone: function (el) {