The homepage of CPSS Lab. at Chung-Ang University.
Guides written by karu-rress.
- Linux or other OSes that can run
.shfile - npm (>= 11.x)
- SvelteKit and other npm packages (install via
npm install) - git
- NginX
The website uses JSON files to manage the data. Consider using RDBMS in case the data gets bigger. Currently, the JSON datasets are stored in src/lib.
src/lib/alumni.json: defines the information of the alumni.src/lib/members.json: stores the current members of CPSS Lab. Move toalumni.jsonif they have graduated.static/images/card: profile pictures of current members. The ratio should be 3:4, and delete the picture if the member graduated.
src/lib/projects.json: list of the projectssrc/lib/publications.json: list of the publications
The pages are defined in src/routes. Add the page by creating directory <page_name>. In the directory, you should create +page.svelte file to design a page.
The structure should be like:
<script>
<!-- scripts or JSON imports -->
import Navbar from "$lib/Navbar.svelte";
import Footer from "$lib/Footer.svelte";
</script>
<div>
<!-- HTML page definition -->
</div>
<style>
@import "$lib/shared.css";
/* CSS definitions */
</style>The scripts and stylesheets are only visible in that page. If you need a shared element, consider using $lib (src/lib) directory. To avoid ambiguity, you must use shared elements as little as possible.
Run
$ npm run dev -- --opento debug the website while updating it. You must pass the --open option to open the page in the web browser. Also, you may want to add --host flag for other devices in the same network to access the debugging website.
Please run the command below in the CPSS server to deploy the website.
NOTE: DO NOT USE ROOT PRIVILEGES HERE!
$ ./deploy.shThis script will perform actions written below. If you are deploying on other environments, please execute them manually.
- Remove old files (
index.html, etc.) - Sync the origin/svelte branch (
git pull origin svelte) - Build the website (
npm run build) - Copy the new files (from
buildto server's root directory) - Restart the server (
sudo systemctl reload nginx)
Created by karu-rress & esther
Credits: http://freehtml5.co/