-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db1bbd9
commit c249de3
Showing
16 changed files
with
157 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Deploying Minifolio | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "portfolio", | ||
"version": "0.0.2", | ||
"version": "0.2.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "vite dev", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export { default as Navbar } from './Navbar.svelte'; | ||
import Navbar from './Navbar.svelte'; | ||
|
||
export default Navbar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { version } from '$app/environment'; | ||
import type { ConfigJson } from './server/data/config'; | ||
|
||
const blankConfig: ConfigJson = { | ||
siteName: 'Minifolio', | ||
listedGroups: [], | ||
color: '#ffaaff', | ||
version, | ||
}; | ||
|
||
export default blankConfig; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { redirect } from '@sveltejs/kit'; | ||
import { getPortfolioGlobals } from '$lib/server'; | ||
import { isRequestAuthorized } from '$lib/server/auth.js'; | ||
import blankConfig from '$lib/blankConfig.js'; | ||
import type { ConfigJson } from '$lib/server/data/config.js'; | ||
import { version } from '$app/environment'; | ||
import { VERSION as SVELTE_VERSION } from 'svelte/compiler'; | ||
import { VERSION as SVELTEKIT_VERSION } from '@sveltejs/kit'; | ||
import { version as VITE_VERSION } from 'vite'; | ||
import os from 'os'; | ||
|
||
export async function load(req) { | ||
// If config fails to load (eg firstrun), just give a blank config | ||
let config: ConfigJson; | ||
let isInit = true; | ||
try { | ||
const globals = await getPortfolioGlobals(); | ||
config = globals.config; | ||
} catch { | ||
isInit = false; | ||
config = blankConfig; | ||
} | ||
|
||
const loggedIn = isInit ? await isRequestAuthorized(req) : undefined; | ||
|
||
let versions = null; | ||
if (!isInit || loggedIn) { | ||
versions = { | ||
minifolio: version, | ||
node: process.version, | ||
svelte: SVELTE_VERSION, | ||
sveltekit: SVELTEKIT_VERSION, | ||
vite: VITE_VERSION, | ||
os: `${os.platform()} ${os.release()}` | ||
}; | ||
} | ||
|
||
return { | ||
config, | ||
loggedIn, | ||
versions, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<script lang="ts"> | ||
import Background from '$components/Background.svelte'; | ||
import Markdown from '$components/markdown/Markdown.svelte'; | ||
import Navbar from '$components/navbar'; | ||
export let data: import('./$types').PageData; | ||
const mainInfo = ` | ||
# Minifolio | ||
This portfolio website is driven by Minifolio, a | ||
[free and open-source](https://en.wikipedia.org/wiki/Free_and_open-source_software) | ||
data-driven portfolio system made with <3 by [Maddy Guthridge](https://maddyguthridge.com). | ||
* [View the source code on GitHub](https://github.com/MaddyGuthridge/Minifolio). | ||
* [Learn how to deploy your own instance of Minifolio](https://github.com/MaddyGuthridge/Minifolio/blob/main/docs/Deploy.md). | ||
* [View the GPLv3 software license for Minifolio](https://github.com/MaddyGuthridge/Minifolio/blob/main/LICENSE.md). | ||
`; | ||
let technicalDetails = ''; | ||
if (data.versions) { | ||
technicalDetails = ` | ||
## Technical details | ||
For security reasons, these details are only shown if you are logged in. | ||
* Minifolio: v${data.versions.minifolio} | ||
* Node: ${data.versions.node} | ||
* Svelte: v${data.versions.svelte} | ||
* Sveltekit: v${data.versions.sveltekit} | ||
* Vite: v${data.versions.vite} | ||
* OS: ${data.versions.os} | ||
`; | ||
} | ||
const readme = mainInfo + technicalDetails; | ||
</script> | ||
|
||
<Navbar | ||
config={data.config} | ||
loggedIn={data.loggedIn} | ||
path={[ | ||
{ txt: 'About', url: 'about' }, | ||
]} | ||
/> | ||
|
||
<Background color={data.config.color} /> | ||
|
||
<main> | ||
<div> | ||
<Markdown source={readme} /> | ||
</div> | ||
</main> | ||
|
||
<style> | ||
main { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
main > div { | ||
min-width: 80%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters