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') %> -

This is a <%= engine %> Template

+
+
+ +
+
+ <%= name %> +
+ +
<%- include('partials/footer') %> \ No newline at end of file diff --git a/src/views/partials/footer.ejs b/src/views/partials/footer.ejs index f3328a6..2bf2078 100644 --- a/src/views/partials/footer.ejs +++ b/src/views/partials/footer.ejs @@ -1,4 +1,3 @@ \ No newline at end of file diff --git a/src/views/partials/head.ejs b/src/views/partials/head.ejs index 1bb9854..190302c 100644 --- a/src/views/partials/head.ejs +++ b/src/views/partials/head.ejs @@ -1,5 +1,8 @@ - + + + + diff --git a/src/views/partials/header.ejs b/src/views/partials/header.ejs index 4706f26..9c65a31 100644 --- a/src/views/partials/header.ejs +++ b/src/views/partials/header.ejs @@ -1,3 +1,2 @@
- This is the header
\ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 15e4def..bebe122 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,6 +30,11 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -405,6 +410,13 @@ jake@^10.8.5: filelist "^1.0.1" minimatch "^3.0.4" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"