Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/setup' into setup
Browse files Browse the repository at this point in the history
  • Loading branch information
LocoDelAssembly committed Oct 21, 2024
2 parents d82b461 + 24962d0 commit dfa162f
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 49 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
open-pull-requests-limit: 0
target-branch: 'development'
43 changes: 28 additions & 15 deletions .github/workflows/gh-pages.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
name: public-build
name: Deploy to GitHub Pages

on:
push:
branches: [main, setup]
branches:
- main
- setup
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: 'main'
fetch-depth: 0
- uses: actions/checkout@v2

- uses: actions/checkout@v4
with:
ref: 'setup'
fetch-depth: 0
Expand All @@ -25,32 +26,44 @@ jobs:
run: cp -r _setup/* .

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '16'

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
id: npm-cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci

- name: Build public view
run: npm run build

- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
target_branch: gh-pages
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: ./dist

deploy:
needs: build
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

permissions:
contents: write

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
!config
!config/**
!public
!public/**
!README.md
config/**/*.development.yml
config/**/*.development.yml
71 changes: 49 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ TaxonPages software is in active development and changes are expected that will

1. Click on "Fork" button to create your own repository from this.
2. Uncheck `Copy the setup branch only` and press `Save`
3. After create your repo, go to `Settings > Pages`, on "Branch" select `gh-pages` and `/(root)`. Then press save
4. Open `router.yml` file and change `base_url` to the name of your repository.
5. After a couple of minutes, your public page should be available at `https://<your_user_name>.github.io/<your_repo_name>`
3. After create your repo, go to `Settings > Pages`, on "Build and deployment - Source" select `GitHub Actions`.
4. Go to `Actions` tab and press `I understand my workflows, go ahead and enable them` button
5. Open `router.yml` file and change `base_url` to the name of your repository.
6. After a couple of minutes, your public page should be available at `https://<your_user_name>.github.io/<your_repo_name>`

### Setup

Expand Down Expand Up @@ -46,15 +47,16 @@ But if you don't want to fork it, you can clone directly from this
git clone https://github.com/SpeciesFileGroup/taxonpages.git
```
3. Go to `taxonpages` folder and switch to `main` branch
3. Go to `taxonpages` folder and enter the following commands to copy the software to your `setup` branch
```
cd taxonpages
git checkout main
git checkout setup
git checkout main .
git reset
git checkout .
```
4. [Download](https://github.com/SpeciesFileGroup/taxonpages/archive/refs/heads/setup.zip) configuration branch and paste `config` and `pages` folders inside taxonpages folder.
5. Setup `config/api.yml` with the API server configuration
6. Install node dependencies
Expand Down Expand Up @@ -162,25 +164,50 @@ const { project_name } = __APP_ENV__
const projectName = __APP_ENV__.project_name
```

## Panels

### Panel layout
## Taxa Page

### Layout

To modify the position of the panels in the layout of the Taxa page, edit the `taxa_page.yml` file
To modify the position of the panels in the layout of the Taxa page, edit the `taxa_page.yml` file. There you can add/move/remove panels from the layout, also you can add new tabs and include new panels there. If you want to make some tabs visible or not depending the rank group, you can include `rankGroup`

```yaml
taxa_page_overview:
panels:
- - - panel:gallery
- panel:type
- panel:type-specimen
- panel:nomenclature
- panel:nomenclature-references
taxa_page:
overview:
panels:
- - - panel:gallery
- panel:type
- panel:type-specimen
- panel:nomenclature
- panel:nomenclature-references
- - panel:map
- panel:descendants
- panel:content
- panel:statistics
#
# An example of a new tab:
#
# type_specimens:
# rank_group: ['SpeciesGroup']
# panels:
# - - - panel:specimen-records
```

- - panel:map
- panel:descendants
- panel:content
- panel:statistics
### Lifecycle hooks (Experimental feature)

The `onCreatePage` and `onSSRPageCreate` functions allow you to execute code at the time the taxa page is created. `onSSRPageCreate` will be executed only on the server side in SSR mode. To make use of them it is necessary to include them in a file object called `pages/otus.config.js`. Both functions accept `otu`, `taxon`, `route` and `router` objects as parameters. Since `onCreatePage` runs on Taxa page component, it is possible to use hooks like `onMounted` or `onBeforeMount` inside it

```javascript
export default {
onSSRCreatePage: async ({ otu, taxon, route, router }) => {
// Your code here
},
onCreatePage: ({ otu, taxon, route, router }) => {
// Your code here
}
}
```

### External panels
Expand All @@ -195,7 +222,7 @@ import MyPanelComponent from './MyPanelComponent.vue'
Export default {
id: 'panel:test', // ID to identify this panel
component: MyPanelComponent, // Vue component for your panel
available: ['HigherClassificationGroup', 'FamilyGroup', 'GenusGroup', 'SpeciesGroup'] // <-- OPTIONAL: This will define for which rank group will be available, remove it if your panel will be available for all.
rankGroup: ['HigherClassificationGroup', 'FamilyGroup', 'GenusGroup', 'SpeciesGroup'] // <-- OPTIONAL: This will define for which rank group will be available, remove it if your panel will be available for all.
}
```

Expand Down
24 changes: 13 additions & 11 deletions config/taxa_page.yml.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
taxa_page_overview:
panels:
- - - panel:gallery
- panel:type
- panel:type-specimen
- panel:nomenclature
- panel:nomenclature-references
taxa_page:
overview:
panels:
- - - panel:gallery
- panel:type
- panel:type-specimen
- panel:nomenclature
- panel:nomenclature-references

- - panel:map
- panel:descendants
- panel:content
- panel:statistics
- - panel:map
- panel:descendants
- panel:content
- panel:keys
- panel:statistics

0 comments on commit dfa162f

Please sign in to comment.