How to contribute to PhysIKA documentation

This page tells you how to build PhysIKA website, including installation and basic configuration.

Prerequisites and installation

Install Hugo

You need a recent extended version (we recommend version 0.53 or later) of Hugo to do local builds and previews of sites (like this one) that use Docsy. If you install from the release page, make sure to get the extended Hugo version, which supports SCSS; you may need to scroll down the list of releases to see it.

For comprehensive Hugo documentation, see gohugo.io.

To see if you already have hugo installed and check the installed version, run the following commands:

hugo version

windows

1.Download hugo executable file

Click Here to download hugo executable file, you must download an extended version. For example, an 64bit windows OS should download hugo_extended_0.75.1_Windows-64bit.zip.

2.Config the path

Config the path where .exe file exist to environment variables. The path should not have spaces, which may cause some unexpected problems.

For example, the path of D:\Hugo\bin is ok. The path of D:\Program Files (x86)\Hugo\bin may cause some unexpected problems.

Linux

Do not use sudo apt-get install hugo, as it currently doesn’t get you the extended version.

If you’ve already installed Hugo, check your version:

hugo version

If the result is v0.52 or earlier, or if you don’t see Extended, you’ll need to install the latest version.

  1. Go to the Hugo releases page.

  2. In the most recent release, scroll down until you find a list of Extended versions.

  3. Download the latest extended version (hugo_extended_0.5X_Linux-64bit.tar.gz).

  4. Create a new directory:

    mkdir hugo
    
  5. Extract the files you downloaded to hugo.

  6. Switch to your new directory:

    cd hugo
    
  7. Install Hugo:

    sudo install hugo /usr/bin    
    

macOS

Install Hugo using Brew.

Install Node.js and npm

To see if you already have Node.js and npm installed and check the installed version, run the following commands:

node -v
npm -v

Click Here to download Node.js and install it.

Install PostCSS

To build or update your site’s CSS resources, you also need PostCSS to create the final assets. If you need to install it, you must have a recent version of NodeJS installed on your machine so you can use npm, the Node package manager. By default npm installs tools under the directory where you run npm install:

npm install postcss --save-dev
npm install -D --save autoprefixer
npm install -D --save postcss-cli

Note that versions of PostCSS later than 5.0.1 will not load autoprefixer if installed globally, you must use a local install.

Clone PhysiKA webset code and run

  1. Make a local working copy of the PhysiKA webset directly using git clone:

    git clone https://github.com/PhysikaTeam/PhysIKA-website.git
    
  2. Switch to the root of the cloned project, for example:

     cd physIKA-website
    
  3. Build your site:

     hugo server
    
  4. Preview your site in your browser at: http://localhost:1313/. You can use Ctrl + c to stop the Hugo server whenever you like.

In the cmd of windows, enter into current folder, and input hugo server to launch the local server. screen shot

Pull requests

Finally, you should make an “Pull requests” at our github repository. Thanks for your contribution to PhysIKA opensource project!

Publishing website

  1. Generate public folder

     cd physiIKA-website
     hugo
    
  2. Push files(If you have permission)

     cd public 
     git init
     git add -A
     git commit -am "init"
     git remote add origin https://github.com/PhysikaTeam/PhysikaTeam.github.io
     git push -f origin master
    
  3. Modify Custom domain(If you have permission) Enter the settings of the PhysikaTeam.github.io project(https://github.com/PhysikaTeam/PhysikaTeam.github.io/settings). Add www.physika.net in Custom domain. Wait a few minutes, you can see PhysiIKA website on www.physika.net.

If our project is helpful to you, give a star and watch us!!!