Skip to content

Commit

Permalink
site: Fixes to local development
Browse files Browse the repository at this point in the history
  • Loading branch information
tillywoodfield committed Feb 8, 2024
1 parent 56a3c0a commit 8b1f5e0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
7 changes: 5 additions & 2 deletions site/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</v-card-title >
<v-card-text >
<p>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.</p>
<p><b>Last Update:</b> {{stats.updated.substring(0, 16)}}</p>
<p><b>Last Update:</b> {{lastUpdated}}</p>
</v-card-text>
</v-card>
</v-col>
Expand Down Expand Up @@ -146,7 +146,8 @@ export default {
name: 'Home',
components: { TableModal },
data: () => ({
stats: { tables: [] }
stats: { tables: [] },
lastUpdated: 'Unavailable'
}),
created: function () {
this.fetchStats()
Expand All @@ -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) {
Expand Down

0 comments on commit 8b1f5e0

Please sign in to comment.