Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nmelhado/league-page into legends…
Browse files Browse the repository at this point in the history
…-league
  • Loading branch information
nmelhado committed Aug 17, 2021
2 parents 1d75880 + 15e3c8a commit b19b0fb
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 4 deletions.
8 changes: 6 additions & 2 deletions TRAINING_WHEELS.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,17 @@ Generate a custom league page for your Sleeper fantasy football league in just a

> ![managers preview](https://storage.googleapis.com/nfl-player-data/managersRendered.png)
## III. Wrapping up
## III. Updates

- That's it. You've built out your own league website!
- League Page is constantly being updated and improved. Check back on your repo periodically and whenever you see the `fetch update` button, click `fetch update` and commit the changes to get the upgrades
- If you first created your league before August 7th, 2021, you may encounter `merge conflicts` when trying to fetch upstream.
- In that situation, copy the contents of your managers page and your homepage text and delete your repo. Re-follow this guide and re-deploy your page.
- There should be **NO merge conflicts going forward**.


## IV. Wrapping up

- That's it. You've built out your own league website!
- If you want to delve further, you can also edit your league constitution page `/src/routes/constitution/index.svelte`
- This page is primarily HTML, so you can edit this in a similar way to how you edited the homepage
- If you and your league like League Page, please consider <b><a href="https://www.buymeacoffee.com/nmelhado" target="_blank">donating</a></b> (and encouraging your league-mates to too!)
Expand Down
19 changes: 17 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "legends-league",
"version": "2.0.0",
"name": "league-page",
"version": "1.0.0",
"homepage": "https://github.com/nmelhado/league-page#readme",
"author": {
"name" : "Nicholas Melhado",
"email" : "[email protected]",
"url" : "http://www.nmelhado.com/"
},
"funding": {
"type": "buy_me_a_coffee",
"url": "https://www.buymeacoffee.com/nmelhado"
},
"bugs": {
"url" : "https://github.com/nmelhado/league-page/issues",
"email" : "[email protected]"
},
"license": "MIT",
"engines": {
"node": ">=14.0.0",
"npm": ">=6.0.0"
Expand Down
19 changes: 19 additions & 0 deletions src/lib/Footer.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<script>
import { goto } from '$app/navigation';
import { tabs } from '$lib/utils/tabs';
import { onMount } from 'svelte';
let outOfDate = false;
onMount(async () => {
const res = await fetch('/api/checkVersion', {compress: true})
const needUpdate = await res.json();
outOfDate = needUpdate;
})
const year = new Date().getFullYear();
Expand Down Expand Up @@ -62,11 +71,21 @@
.navLink:hover {
color: #920505;
}
.updateNotice {
color: var(--g999);
font-style: italic;
font-size: 0.8em;
margin-top: 0;
}
</style>
<div class="footerSpacer" style="height: {footerHeight}px;" />
<footer bind:this={el}>
{#if outOfDate}
<p class="updateNotice">There is an update available for your League Page. <a href="https://github.com/nmelhado/league-page/blob/master/TRAINING_WHEELS.md#iii-updates">Follow the Update Instructions</a> to get all of the newest features!</p>
{/if}
<div id="navigation">
<ul>
{#each tabs as tab}
Expand Down
8 changes: 8 additions & 0 deletions src/lib/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
!!! DO NOT EDIT !!!
This is used to check if there are any updates
available for your copy of League Page
*/

// Keep in sync with package.json
export const version = "1.0.0";
19 changes: 19 additions & 0 deletions src/routes/api/checkVersion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {version} from '$lib/version';

export async function get() {
const res = await fetch('https://league-page.nmelhado.com/api/checkVersion', {compress: true})
let needsUpdate = false;
if(res.ok) {
const globalVersion = await res.json();
console.log(`VERSION CHECK: global version: ${globalVersion}, local version: ${version}`);
console.log(version);
// If it reaches the global checkpoint and the versions do not match
// set needsUpdate to true to display the update prompt
needsUpdate = globalVersion != version;
}

return {
status: 200,
body: JSON.stringify(needsUpdate)
};
}

1 comment on commit b19b0fb

@vercel
Copy link

@vercel vercel bot commented on b19b0fb Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.