Statically generated site for Redbrick https://www.redbrick.dcu.ie
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Cian Butler 08aeb5bfad add codeclimate (#192) 4 years ago
bin fall back to sendmail if smtp server is disabled (#136) 4 years ago
lib have mail posts fallback to sendmail aswell (#166) 4 years ago
routes fall back to sendmail if smtp server is disabled (#136) 4 years ago
scaffolds annouce for week 4 (#68) 5 years ago
source Spelling mistakes (#180) 4 years ago
themes code block looks nicer then quote block (#184) 4 years ago
views add docker file 5 years ago
.codeclimate.yml add codeclimate (#192) 4 years ago
.dockerignore move source in to container and add git pull command to start (#143) 4 years ago
.env.example use env file for docker-compose (#169) 4 years ago
.eslintignore switch linter to eslint and fix errors (#135) 4 years ago
.eslintrc switch linter to eslint and fix errors (#135) 4 years ago
.gitignore Submodule (#116) 4 years ago
.gitmodules Submodule (#116) 4 years ago
.markdown.style.rb add codeclimate (#192) 4 years ago
.mdlrc add codeclimate (#192) 4 years ago
.nvmrc set node version as 6.9 for production (#89) 5 years ago
.yarnclean add git to regenerate api - close #76 (#117) 4 years ago
CONTRIBUTING.md Spelling mistake in CONTRIBUTING.md (#79) 5 years ago
Dockerfile move source in to container and add git pull command to start (#143) 4 years ago
LICENSE.md add contribution guide and licence 5 years ago
README.md Update README.md (#137) 4 years ago
_config.yml Turn on smartypants for markdown (#188) 4 years ago
app.js add xxs protection to express (#191) 4 years ago
circle.yml Tutorial/docker (#125) 4 years ago
docker-compose.yml use env file for docker-compose (#169) 4 years ago
npm-shrinkwrap.json add codeclimate (#192) 4 years ago
package.json add xxs protection to express (#191) 4 years ago
website.service add circle deployment script (#92) 5 years ago
yarn.lock add codeclimate (#192) 4 years ago

README.md

Static-Site

CircleCI

A Static Site for redbrick generated with hexo using a theme based off icarus

Requirements

  1. Node : v6.9(LTS) Download Node

Setup

To set up run:

  • yarn this will install all the dependencies

You will also need to create three files:

  • mailing_list a newline-separated list of email addresses
  • email_update_log a newline-separated reverse-chronological list of times email updates were sent
  • .env by copying .env.example and modifying values (important)

mailing_list and email_update_log can be left blank, though updates for every post in history will be sent if no previous send date is specified.

Generate

  • To demo the site run npm start. This will create a server that runs on localhost:3000
  • To work on css and have it auto regenerate use yarn hexo. This will create a server that runs on localhost:4000

Generate via API

  • While the server is live, a visit to http://[sitehost]/api/regenerate?token=your_secret_token will run hexo generate and send emails for any new posts so long as that process is not already underway.

Development

  • To generate new posts
    • Run yarn posts [title] This will create a new post in source/_post/[title].md
  • To generate new pages:
    • Run yarn page [title] this will create a new page in source/[title]/index.md
  • To edit the sidebar:
    • Edit themes/redbrick-theme/_config.yaml - this is where all the theme configuration is controlled from.

CSS and Templates

  • You can edit the css for the theme in themes/redbrick-theme/source/css
  • You can edit the templates in themes/redbrick-theme/layout

Google analytics

Analytics can be enabled by adding your analytics key to theme/redbrick/_config.yaml

Deployment

To deploy to a server run:

  • yarn
  • modify _config.yml with mailhost info
  • yarn start

Then using apache or nginx proxy traffic to port 3000. And done. You can create a service to run the server on startup if you want refer to express docs and using a service for this

Docker

There is a docker file if you want to generate a container that runs in production mode.

  • To build just run docker build . -t redbrick/site
  • Then to start just run docker run -it --rm -p=3000:3000 -v source:/usr/src/app/source --name redbrick-site redbrick/site
  • Source volume needs to be specified otherwise it wont have anything to generate Or Just run docker-compose up