diff --git a/config/config.yml b/config/config.yml new file mode 100644 index 0000000..7ffc603 --- /dev/null +++ b/config/config.yml @@ -0,0 +1,7 @@ +name: "Nikurasu" # The name on the linktree +# profilePic: # uncomment and set this if your profile pic has a custom name +links: + - text: "YouTube" # text on the link + hyperlink: "Test" # the actual hyperlink + brandcolor: "youtube" # set this if you want to set the color of the link to the brand color of a platform... + color: "#0D0D0D" # or that if you want to set it to an exact color \ No newline at end of file diff --git a/package.json b/package.json index 7c642a6..355594b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ }, "dependencies": { "ejs": "^3.1.8", - "express": "^4.18.2" + "express": "^4.18.2", + "js-yaml": "^4.1.0" }, "devDependencies": { "nodemon": "^2.0.20" diff --git a/src/assets/img/profilepic.jpg b/src/assets/img/profilepic.jpg new file mode 100644 index 0000000..9a09c44 Binary files /dev/null and b/src/assets/img/profilepic.jpg differ diff --git a/src/index.js b/src/index.js index ab6c18d..aeb842c 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,8 @@ import express from 'express' +import yaml from 'js-yaml' +import fs, { cpSync } from 'node:fs' + +console.log('🔧 Configuring socialtree...') const app = express() const port = 3000 @@ -6,11 +10,16 @@ const engine = 'ejs' app.set('view engine', engine) app.set('views', './src/views') +app.use(express.static('src/public')) +app.use(express.static('src/assets')) app.get('/', (req, res) => { + let config = yaml.load(fs.readFileSync('config/config.yml'), 'utf8') + console.log(JSON.stringify(config)) res.render('index', { - engine + name: config.name, + filenameProfilePic: config.profilePic ? config.profilePic : 'profilepic.jpg' }) }) -app.listen(port, () => console.log(`App running on port ${port}, with view engine ${engine}`)) \ No newline at end of file +app.listen(port, () => console.log(`🚀 Socialtree started on port ${port}, with view engine ${engine}`)) \ No newline at end of file diff --git a/src/public/main.css b/src/public/main.css new file mode 100644 index 0000000..2066fe8 --- /dev/null +++ b/src/public/main.css @@ -0,0 +1,4 @@ +* { + margin: 0; + padding: 0; +} \ No newline at end of file diff --git a/src/public/simple-basic.css b/src/public/simple-basic.css new file mode 100644 index 0000000..afc2662 --- /dev/null +++ b/src/public/simple-basic.css @@ -0,0 +1,18 @@ +body { + min-height: 100vh; + display: flex; + justify-content: center; +} + +.container { + margin-top: 3rem; + display: flex; + flex-direction: column; + align-items: center; +} + +.imgbox>img { + height: 10rem; + width: 10rem; + border-radius: .5rem; +} \ No newline at end of file diff --git a/src/public/simple-orange.css b/src/public/simple-orange.css new file mode 100644 index 0000000..1712f18 --- /dev/null +++ b/src/public/simple-orange.css @@ -0,0 +1,3 @@ +body { + background-image: linear-gradient(165deg, #c7a25c 0%, #ff9601 43%, #980d0d 100%); +} \ No newline at end of file diff --git a/src/views/index.ejs b/src/views/index.ejs index 03c2c4f..b3494f1 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -1,4 +1,14 @@ <%- include('partials/head') %> <%- include('partials/header') %> -