Browse Source

Template files

master
Archie Baer 1 month ago
parent
commit
2bc930a0fa
4 changed files with 4 additions and 2 deletions
  1. 2
    2
      README.md
  2. 2
    0
      app.js
  3. 0
    0
      example/config.yml
  4. 0
    0
      example/custom.css

+ 2
- 2
README.md View File

@@ -1,6 +1,6 @@
# platform1
Platform1 is a simple personal blogging platform built by Archie Baer. It uses NodeJS, Express, YAML and NeDB.

To get started, open `config.yml` and change what you please. Make sure to set the password - you use it when creating new posts. You can also set icon links for the homepage, like to social media accounts. The icons use font awesome. When you're ready, run the server. If you visit the homepage, you'll notice there won't be any posts. To create one, visit /new, enter post content, use the password you set earlier, and click the button to post it.
To get started, install the dependencies and run the script. This will generate the config file and `custom.css`. Then open `config.yml` and change what you please. Make sure to set the password - you use it when creating new posts. You can also set icon links for the homepage, like to social media accounts. The icons use font awesome. When you're ready, run the server. If you visit the homepage, you'll notice there won't be any posts. To create one, visit /new, enter post content, use the password you set earlier, and click the button to post it.

You may want to change the accent colour by going into `frontend/static/master.css` and modifying the css variable.
You may want to change the accent colour by going into `custom.css` and modifying the css variable.

+ 2
- 0
app.js View File

@@ -2,6 +2,7 @@ const fs = require("fs");

//Config File
const yaml = require("yaml");
if (!fs.existsSync(__dirname + "/config.yml")) fs.copyFileSync(__dirname + "/example/config.yml", __dirname + "/config.yml");
const config = yaml.parse(fs.readFileSync(__dirname + "/config.yml", "utf8"));

//NeDB
@@ -36,6 +37,7 @@ const showdownc = new showdown.Converter({
app.use("/static", express.static(__dirname + "/frontend/static"));

//Custom.css
if (!fs.existsSync(__dirname + "/custom.css")) fs.copyFileSync(__dirname + "/example/custom.css", __dirname + "/custom.css");
app.get("/custom.css", (req, res) => {
res.sendFile(__dirname + "/custom.css");
});

config.yml → example/config.yml View File


custom.css → example/custom.css View File


Loading…
Cancel
Save