Skip to content

Commit

Permalink
[2] Repo Revival (w3f#2469)
Browse files Browse the repository at this point in the history
* restructure docs

* update all link paths

* take out v1

* remove deployment file and update readme

* update mirror links and sidebars

* update mirror script to account for different paths

* fix mirroring and redirection

* update links and fixes

* fixes

* dupdate gitignore - build docs

* rUpdate package.json:remove v1; add pretty check on commits, can fix w3f#944

* remove and ignore files

* ran pretty-quick

* Update README.md

* remove 'v2' from naming

* update paths in js

* update paths in index.js

* Update generate-pdf.yml

* updates

* clean up

* [2] Restructure Fixes (2/2) (w3f#2470)

* Update learn-scams.md (w3f#2440)

* clean up and fixes for restructure

* Update package.json

* update injection

* fixes

* trigger ci

Co-authored-by: Aleixo Sánchez <[email protected]>

* fix conflicts

* add slug for redirect to default path /docs/ + updates & edits

* fix file ref

* update paths and edits [kusama guide]

* update mirroring for kusama docs

* remove old mirror script

Co-authored-by: Aleixo Sánchez <[email protected]>
  • Loading branch information
salmad3 and alxs authored Aug 14, 2021
1 parent 91c0db0 commit 68c26c3
Show file tree
Hide file tree
Showing 4,097 changed files with 143,347 additions and 138,152 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/deploy-kusama-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
git config --global user.name "Polkadot Wiki CI"
echo "machine github.com login w3fdeploy password ${{ secrets.ACCESS_KEY }}" > ~/.netrc
yarn && yarn kusama:build && GIT_USER=w3fdeploy PUBLISHING=true PROJECT_NAME=kusama-guide-hosting yarn run kusama:publish-gh-pages
# setup ipfs cluster tools
wget https://dist.ipfs.io/ipfs-cluster-ctl/v0.14.0/ipfs-cluster-ctl_v0.14.0_linux-amd64.tar.gz
tar xf ./ipfs-cluster-ctl_v0.14.0_linux-amd64.tar.gz
chmod +x ./ipfs-cluster-ctl/ipfs-cluster-ctl
export PATH=$PATH:`pwd`/ipfs-cluster-ctl
node ./scripts/ipfs-cluster-pin.js --auth ${{ secrets.CLUSTER_BASIC_AUTH_USER}}:${{ secrets.CLUSTER_BASIC_AUTH_PASSWORD}} --websiteDir ./kusama-guide-v2/build --pinName kusama-guide
node ./scripts/ipfs-cluster-pin.js --auth ${{ secrets.CLUSTER_BASIC_AUTH_USER}}:${{ secrets.CLUSTER_BASIC_AUTH_PASSWORD}} --websiteDir ./kusama-guide/build --pinName kusama-guide
8 changes: 4 additions & 4 deletions .github/workflows/deploy-kusama-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "Polkadot Wiki CI"
echo "machine github.com login w3fdeploy password ${{ secrets.ACCESS_KEY }}" > ~/.netrc
yarn && yarn kusama:build && echo "staging.kusama.network" > kusama-guide-v2/static/CNAME && GIT_USER=w3fdeploy PUBLISHING=true PROJECT_NAME=kusama-guide-staging yarn run kusama:publish-gh-pages
yarn && yarn kusama:build && echo "staging.kusama.network" > kusama-guide/static/CNAME && GIT_USER=w3fdeploy PUBLISHING=true PROJECT_NAME=kusama-guide-staging yarn run kusama:publish-gh-pages
# setup ipfs cluster tools
wget https://dist.ipfs.io/ipfs-cluster-ctl/v0.14.0/ipfs-cluster-ctl_v0.14.0_linux-amd64.tar.gz
tar xf ./ipfs-cluster-ctl_v0.14.0_linux-amd64.tar.gz
chmod +x ./ipfs-cluster-ctl/ipfs-cluster-ctl
export PATH=$PATH:`pwd`/ipfs-cluster-ctl
which ipfs-cluster-ctl
node ./scripts/ipfs-cluster-pin.js --auth ${{ secrets.CLUSTER_BASIC_AUTH_USER }}:${{ secrets.CLUSTER_BASIC_AUTH_PASSWORD }} --websiteDir ./kusama-guide-v2/build --pinName kusama-guide-staging
node ./scripts/ipfs-cluster-pin.js --auth ${{ secrets.CLUSTER_BASIC_AUTH_USER }}:${{ secrets.CLUSTER_BASIC_AUTH_PASSWORD }} --websiteDir ./kusama-guide/build --pinName kusama-guide-staging
4 changes: 2 additions & 2 deletions .github/workflows/deploy-polkadot-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: "14"

- name: Publish
run: |
git config --global user.email "[email protected]"
Expand All @@ -28,4 +28,4 @@ jobs:
chmod +x ./ipfs-cluster-ctl/ipfs-cluster-ctl
export PATH=$PATH:`pwd`/ipfs-cluster-ctl
node ./scripts/ipfs-cluster-pin.js --auth ${{ secrets.CLUSTER_BASIC_AUTH_USER}}:${{ secrets.CLUSTER_BASIC_AUTH_PASSWORD}} --websiteDir ./website-v2/build --pinName polkadot-wiki
node ./scripts/ipfs-cluster-pin.js --auth ${{ secrets.CLUSTER_BASIC_AUTH_USER}}:${{ secrets.CLUSTER_BASIC_AUTH_PASSWORD}} --websiteDir ./polkadot-wiki/build --pinName polkadot-wiki
16 changes: 12 additions & 4 deletions .github/workflows/deploy-polkadot-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# uses: actions/upload-artifact@v2
# with:
# name: polkadot-wiki
# path: website/static/polkadot-wiki.pdf
# path: polkadot-wiki/static/polkadot-wiki.pdf

# - name: Build
# run: yarn; yarn polkadot:build
Expand All @@ -47,7 +47,7 @@ jobs:
# id: ipfs_pdf
# uses: aquiladev/[email protected]
# with:
# path: ./website/static/polkadot-wiki.pdf
# path: ./polkadot-wiki/static/polkadot-wiki.pdf
# timeout: 120000

# - name: Inject
Expand All @@ -58,20 +58,28 @@ jobs:
# - name: Upload to IPFS
# uses: aquiladev/[email protected]
# with:
# path: ./website/build/polkadot-wiki
# path: ./polkadot-wiki/build/polkadot-wiki
# timeout: 120000

- name: Publish
run: |
git config --global user.email "[email protected]"
git config --global user.name "Polkadot Wiki CI"
echo "machine github.com login w3fdeploy password ${{ secrets.ACCESS_KEY }}" > ~/.netrc
yarn && yarn polkadot:build && echo "staging.polkadot.network" > website-v2/static/CNAME && GIT_USER=w3fdeploy PUBLISHING=true PROJECT_NAME=polkadot-wiki-staging yarn run polkadot:publish-gh-pages
yarn && yarn polkadot:build && echo "staging.polkadot.network" > polkadot-wiki/static/CNAME && GIT_USER=w3fdeploy PUBLISHING=true PROJECT_NAME=polkadot-wiki-staging yarn run polkadot:publish-gh-pages
# setup ipfs cluster tools
wget https://dist.ipfs.io/ipfs-cluster-ctl/v0.14.0/ipfs-cluster-ctl_v0.14.0_linux-amd64.tar.gz
tar xf ./ipfs-cluster-ctl_v0.14.0_linux-amd64.tar.gz
chmod +x ./ipfs-cluster-ctl/ipfs-cluster-ctl
export PATH=$PATH:`pwd`/ipfs-cluster-ctl
<<<<<<< HEAD
node ./scripts/ipfs-cluster-pin.js --auth ${{ secrets.CLUSTER_BASIC_AUTH_USER}}:${{ secrets.CLUSTER_BASIC_AUTH_PASSWORD}} --websiteDir ./polkadot-wiki/build --pinName polkadot-wiki-staging
=======
<<<<<<< HEAD
node ./scripts/ipfs-cluster-pin.js --auth ${{ secrets.CLUSTER_BASIC_AUTH_USER}}:${{ secrets.CLUSTER_BASIC_AUTH_PASSWORD}} --websiteDir ./website/build --pinName polkadot-wiki-staging
=======
node ./scripts/ipfs-cluster-pin.js --auth ${{ secrets.CLUSTER_BASIC_AUTH_USER}}:${{ secrets.CLUSTER_BASIC_AUTH_PASSWORD}} --websiteDir ./website-v2/build --pinName polkadot-wiki-staging
>>>>>>> master
>>>>>>> folder
69 changes: 35 additions & 34 deletions .github/workflows/generate-pdf.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
name: Generate downloadable PDF

on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master

jobs:
generate-pdf:
name: Run the site and generate a PDF from it
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Clone and run the site
run: |
yarn
yarn polkadot:start &
while ! nc -z localhost 3000; do
sleep 1
echo waiting for website up...
done
yarn polkadot:pdf
- name: Upload PDF
uses: actions/upload-artifact@v2
with:
name: polkadot-wiki
path: website-v2/static/polkadot-wiki.pdf
name: Generate downloadable PDF

on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master

jobs:
generate-pdf:
name: Run the site and generate a PDF from it
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Clone and run the site
run: |
yarn
yarn mirror
yarn polkadot:start &
while ! nc -z localhost 3000; do
sleep 1
echo waiting for website up...
done
yarn polkadot:pdf
- name: Upload PDF
uses: actions/upload-artifact@v2
with:
name: polkadot-wiki
path: website/static/polkadot-wiki.pdf
15 changes: 8 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bower_components
build/Release

# Dependency directories
node_modules/
node_modules/*
jspm_packages/

# TypeScript v1 declaration files
Expand Down Expand Up @@ -66,20 +66,21 @@ typings/
# Emacs backup files
*~

build
polkadot-wiki/build
kusama-guide/build
build-script*
**/mirror*.md
.DS_Store
kusama-guide/translated_docs/
website/translated-docs/
website/i18n/*
polkadot-wiki/translated-docs/
polkadot-wiki/i18n/*
kusama-guide/i18n/*

.docusaurus
computed-dict.json
website-v2/i18n/
!website-v2/i18n/en/
kusama-guide-v2/i18n/zh-CN/docusaurus-plugin-content-docs/current/
polkadot-wiki/i18n/
!polkadot-wiki/i18n/en/
kusama-guide/i18n/zh-CN/docusaurus-plugin-content-docs/current/

# Ignore because we don't need a 10MB file in VCS
polkadot-wiki.pdf
Expand Down
10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,21 @@

## Contributing to Documentation

The Wiki is an open source project and we will review all issues and pull-requests created in this
repository. If you notice typos or grammatical errors, please feel free to directly create pull
requests with these corrections.
The Wiki is an open source project and we will review all issues and pull-requests created
in this repository. If you notice typos or grammatical errors, please feel free to directly create pull requests with
these corrections.

Larger contributions may start as issues to test the waters on the subject with the maintainers. It
is generally preferable to create a pull request over an issue to propose a change to the wiki
content.
Larger contributions may start as issues to test the waters on the subject with the maintainers.
It is generally preferable to create a pull request over an issue to propose a change to the wiki content.

### Running Locally

Both the Polkadot Wiki and the Kusama Guide are built from the source files in this repository.
After cloning the source locally, you can start the websites with each of these respective commands
(ensure you run `yarn` at the root of the repository first to install dependencies):

> The site is built using Docusaurus: you may need to install Docusaurus before running the Wiki
> locally. Using yarn, run `yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest`.
> The site is built using Docusaurus: you may need to install Docusaurus before running
> the Wiki locally. Using yarn, run `yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest`.
```zsh
# For the Polkadot Wiki:
Expand All @@ -60,12 +59,11 @@ Use the style guide from the

#### Formatting

Use
[pretty-quick](https://prettier.io/docs/en/precommit.html#option-2-pretty-quickhttpsgithubcomazzpretty-quick)
Use [pretty-quick](https://prettier.io/docs/en/precommit.html#option-2-pretty-quickhttpsgithubcomazzpretty-quick)
as a pre-commit formatting tool.

There is an automatic `pretty-quick` check that occurs pre-commit to format your changed/staged
files.
There is an automatic `pretty-quick` check that occurs pre-commit to format
your changed/staged files.

To format markdown pages, run the following in the `docs` folder:

Expand All @@ -77,17 +75,17 @@ To run pretty on the whole project, `npx pretty-quick`.

### Static Site Generator

The Wiki's latest version uses the [Docusaurus](https://docusaurus.io/) static website generator to
convert the Markdown docs into a documentation website.
The Wiki's latest version uses the [Docusaurus](https://docusaurus.io/) static website
generator to convert the Markdown docs into a documentation website.

### Search Engine

[Algolia DocSearch](https://docsearch.algolia.com/) is the search engine that is used, which is
built into Docusaurus. Indexing via Algolia provides faster lookup; the actual configuration for
lookup is located in another repository that's maintained by Algolia DocSearch.
[Algolia DocSearch](https://docsearch.algolia.com/) is the search engine that is used, which
is built into Docusaurus. Indexing via Algolia provides faster lookup; the actual configuration
for lookup is located in another repository that's maintained by Algolia DocSearch.

We have enabled searching on the Wiki by declaring the `algolia` section in the `siteConfig.js` file
in `scripts`, and defining an API key and index name that are provided by DocSearch.
We have enabled searching on the Wiki by declaring the `algolia` section in the `siteConfig.js`
file in `scripts`, and defining an API key and index name that are provided by DocSearch.

```js
algolia: {
Expand All @@ -100,13 +98,14 @@ in `scripts`, and defining an API key and index name that are provided by DocSea
```

If you would like to access and modify this, you can re-submit the documentation url via
[DocSearch Program](https://docsearch.algolia.com/apply/), where they will send a JavaScript snippet
that you can re-integrate into the configuration, similar to the one shown above.
[DocSearch Program](https://docsearch.algolia.com/apply/), where they will send
a JavaScript snippet that you can re-integrate into the configuration, similar to the
one shown above.

### Automated Deployments

The Polkadot wiki is built on the `gh-pages` branch and automatically deployed to GitHub Pages. The
Kusama wiki is also deployed to GitHub Pages (via a separate repository).
The Polkadot wiki is built on the `gh-pages` branch and automatically deployed to GitHub Pages.
The Kusama wiki is also deployed to GitHub Pages (via a separate repository).

### Mirror Pages

Expand Down Expand Up @@ -144,8 +143,9 @@ burned. :kusama }}
```

To test the resolution, run `polkadot:build` and `kusama:build`, then `polkadot:inject` and
`kusama:inject`, respectively. Inspect the built files in the corresponding `build` folder under
`website` or `kusama-guide`.
`kusama:inject`, respectively.
Inspect the built files in the corresponding `build` folder under `website` or
`kusama-guide`.

## Internationalization

Expand Down
10 changes: 4 additions & 6 deletions crowdin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ base_path: "./"
preserve_hierarchy: true

files:
-
source: '/website-v2/i18n/en/**/*.json'
translation: '/website-v2/i18n/%locale%/**/%original_file_name%'
- source: "/polkadot-wiki/i18n/en/**/*.json"
translation: "/polkadot-wiki/i18n/%locale%/**/%original_file_name%"
content_segmentation: 0
-
source: '/docs/*.md'
translation: '/website-v2/i18n/%locale%/docusaurus-plugin-content-docs/current/%original_file_name%'
- source: "/docs/*.md"
translation: "/polkadot-wiki/i18n/%locale%/docusaurus-plugin-content-docs/current/%original_file_name%"
content_segmentation: 0
18 changes: 0 additions & 18 deletions docker-compose.yml

This file was deleted.

Loading

0 comments on commit 68c26c3

Please sign in to comment.