Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benbrown/secret_textfiles
a super super basic cms for posting stuff
https://github.com/benbrown/secret_textfiles
Last synced: about 1 month ago
JSON representation
a super super basic cms for posting stuff
- Host: GitHub
- URL: https://github.com/benbrown/secret_textfiles
- Owner: benbrown
- Created: 2021-02-01T23:02:22.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-16T21:38:37.000Z (over 1 year ago)
- Last Synced: 2024-10-12T19:41:25.427Z (2 months ago)
- Language: JavaScript
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ben Brown's SECRET_TEXTFILES
This is a very simple tool for publishing a blog-like site. It focuses on having ONE post on the front page, and an archive of previous posts.
There is a posting interface that supports drafts. There is not currently support for uploading files directly into the system.
All files are stored as dated markdown files with YAML headers making it easy to backup or use the content in other ways.
### Install
clone the repo
```git clone [email protected]:benbrown/secret_textfiles.git```run npm install
```npm install```set the config options in `.env`
```
USERS="user:password"
PATH_TO_TEXT=./text/
PATH_TO_TEMPLATES=./design/
SITE_NAME=Daily Text
RECENT_POSTS=5
PORT=
ROOT_URL=
BASE_URL=http://localhost:3000
```USERS should be a username:password combo. This is what is used to login to the posting interface.
PATH_TO_TEXT is the relative path to your collection of text files.
PATH_TO_TEMPLATES is the relative path to your HTML template files.
SITE_NAME is the name of the site, used in the RSS feed.
RECENT_POSTS is how many posts you want to be included in the list of recent posts on the homepage.
PORT is the port to run the service on, this defaults to 3000 if not specified
ROOT_URL is the an optional sub-path for the site, for example `blog`
BASE_URL is the ROOT url of your website
start the service
```npm start```this should start a webserver on port 3000 or the port you specified.
navigate to the admin page:
```http://localhost:3000/secret```post away!
### Change the design
There are 3 files involved in the design.
`design/home.handlebars` design of the homepage or individual post
`design/archive.handlebars` design of the archive page
`design/layouts/main.handlebars` the wrapper content into which either the home or archive content is inserted.
CSS files and images can be put into the `public/` folder.
### Hosting
When you are ready to deploy your website to a public URL, run the app using something like `pm2`. Then, host it behind an nginx proxy and make sure it is behind https!
So if you had your site running with `blog` as the ROOT_URL option and the app is running on port 3000, a block like this inside your nginx config should work:
```
location ~ ^/blog {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
```