This is a website coded for the Robotics Team Website Challenge 2019.
git clone --recurse-submodules https://github.com/eshsrobotics/website-challenge-2019
cd website-challenge-2019sudo docker-compose upor
# Running on port 8080
yarn install
yarn run serveyarn run build
# Build and deploy to prod
./deploy.sh- Fix picture layout breaks with portrait dimensioned picture
- Transform markdown static articles to actual posts with routes & breadcrumbs, tags, dates, authors, etc.
- Update links on each individual cyberpatriots, frc, vex page
- Change links to the photograph album (and the "see more" button)
- Change images and content
- To do this, go to
src/views. Folder structure should resemble similarly to the nav bar menu on the site
- You may need to add a CNAME or something thats at root of project when deployed
- Place these files in
public/ - This is done with
copy-webpack-plugin, with abstraction layer provided byvue-cli-3
- Add photos in the data-base photos archive (is org gh repo)
- Run respective scripts there that build thumbnails for the higher resolution images
- If the photo is niche and does not group well into other photos, drop images in
src/assets/local-image- These images will copy over using CopyWebpackPlugin (config in Vue.config.js) to
dist/local-image - Reference these with /local-image/img.jpg' if it's in a JSON file. Ex.
website-challenge-2019/local-image/img.jpg. If you're in some JS file, you can reference it with@/assets/local-image/img.jpg
- These images will copy over using CopyWebpackPlugin (config in Vue.config.js) to
- Schema for albums at
/photosfound atsrc/views/media/photoData.json; observe and extend upon the existing schema, simple sample shown below
[
{
"year": "2018-2019",
"events": [
{
"title": "CyberPatriots Competition",
"image": "https://github.com/eshsrobotics/database-photos/blob/master/2018-2019/cyberpatriots-november-competition/IMG_0898.small.jpg?raw=true",
"desc": "Participating in the 2018-2019 CyberPatriots round 1 competition",
"uri": "2018-2019-cyberpatriots-competition-round-1",
"photosPrefix": "https://github.com/eshsrobotics/database-photos/blob/master/2018-2019/cyberpatriots-november-competition/IMG_0",
"photosSuffix": ".small.jpg?raw=true",
"photos": [
"896",
"897",
"898",
"899",
"900",
"901",
"902",
"903",
"904",
"906"
]
},
{
"title": "VEX Competition Prep",
"image": "https://github.com/eshsrobotics/database-photos/blob/master/2018-2019/vex-competition-prep/vexprep2.small.jpg?raw=true",
"desc": "Working on the 2018-2019 VEX Robot",
"uri": "2018-2019-vex-prep-fall",
"photosPrefix": "https://github.com/eshsrobotics/database-photos/blob/master/2018-2019/vex-competition-prep/",
"photosSuffix": ".small.jpg?raw=true",
"photos": [
"IMG_0907",
"IMG_0908",
"vexprep1",
"vexprep2"
]
}
]
},
{
"year": "2017-2018",
"events": [
"..."
]
}
]imageis a cover image for that albumuriis the route that shows in the url bar when you navigate to that page. Always include year. Makeuris as similar as previous ones to maintain continuityuriMUST start with a year.2018-2019due to 192154336e7badf3c9a6b25eca6328a79c2bb765
- Note that the Second "VEX Competition Prep" event will generate a page located at
/#/album/2018-2019-vex-prep-fall- Note you can browse through these photos here:
https://github.com/eshsrobotics/database-photos/tree/master/2018-2019/vex-competition-prep - Photos are a concatenation of
photosPrefix + photos[i] + photosSuffic- One example of result of concatenation is
https://github.com/eshsrobotics/database-photos/blob/master/2018-2019/vex-competition-prep/IMG_0907.jpg?raw=true
- One example of result of concatenation is
- Note that there are four photos in the "VEX Competition Prep" archive and four items in
photos: []
- Note you can browse through these photos here:
- Some
.jsonfiles (such assponsorData.jsonand others) have the repository name,website-challenge-2019hardcoded - This is because webpack does not seem to resolve '@' (as src (it's a default webpack alias within Vue-cli-3's default webpack config options))
- There's some way to config webpack to resolve this stuff in
.json, but this is a temporary work around. So change paths in .json file when changing repos name - if this is hosted somewhere else (in these case you'll have to change publicDir in
vue.config.js
When updating sponsors, change src/views/sponsors/sponsorData.json to match new sponsors. Use the following schema
{
"name": "Company Name",
"image": "https://github.com/eshsrobotics/website-challenge-2019/blob/master/src/assets/local-image/company-image.png?raw=true",
"imageAltText": "Text shown when image not found",
"tier": "Tier of Company"
}- Note that
company-image.pngmust be placed insrc/local-image - You may need to update
src/views/sponsorsif you're adding a new tier. Observe and extend upon the existing structure - You must also update
<infinite-slide-bar>components that use thesponsorData.json- In src/views/Home.vue, update
widthproperty on<infinite-slide-bar>component - Update when no sponsor photo overlaps another
- In src/views/Home.vue, update
If you're new to Vue, or contributing, you may encounter a few errors. I've isolated some of the more common (and uncommong) errors / mishehaviors you may be getting and I've provided a solution. i.e. If the website is not doing what you want, see if your issue matches any below. The first bullet point after a subsection is a snippet of example code that defines or relates to the issue.
<style scoped lang="scss">- You are changing a Vue component to have scoped slots (where it previously didn't), or removing scoped slots on a component.
- When toggling scoped components, your styles are messing up / not being applied
- Solution: Refresh the page. This has to do with webpack-hot-reload. Sometimes it doesn't update css (you're compiled scss) properties after you toggle if a component is scoped
createTransitions((background-color, color, box-shadow), false, 0.2s, ease-in-out)- You are trying to add transitions on a component, but in the process other transitions are being removed
- This has to do with my
createTransitionsscss function - It's doing the same thing as below, where .element has the color red (not blue)
.element { color: blue } .element { color: red }
- Solution 1: Remove all
createTransitionscalls within your mixins, and put them in your components. That way there are no twotransitionproperties for each element (since your mixin will bring an extratransitionproperty and cause conflicts) - Solution 2: Actually fix the issue. Just modifying the
createTransitionsscss function won't change anything. Try looking into extend in scss in combination with mixins / methods / whatever
-
Ids can only be used once per web page. Because components are reusable, you might be declaring multiple components of the same type on the same page
-
Alternatively, you may be giving the component two different Ids from two different places. Such as giving the Id when creating the component (
ChildComponent.vue) and using the component (ParentComponent.vue)ParentComponent.vue<parent-component> <child-component id="arc"> </child-component> </parent-component>
ChildComponent.vue<template id="car"> <!-- Contents of ChildComponent.vue --> </template>
-
Solution: Use classes, and almost never Ids for html elements, especially when you know you're going to use the component multiple times