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 6d9b6bb0a5 switch linter to eslint and fix errors (#135) 4 years ago
bin switch linter to eslint and fix errors (#135) 4 years ago
lib switch linter to eslint and fix errors (#135) 4 years ago
routes switch linter to eslint and fix errors (#135) 4 years ago
scaffolds annouce for week 4 (#68) 5 years ago
source add welocme page close #131 (#134) 4 years ago
themes add call for talks (#127) 4 years ago
views add docker file 5 years ago
.dockerignore fix docker and update docs to relflect change (#107) 4 years ago
.env.example Async hexo generate API endpoint (Sort of addresses #31) (#55) 5 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
.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 fix docker and update docs to relflect change (#107) 4 years ago
LICENSE.md add contribution guide and licence 5 years ago
README.md add env to docker compose (#111) 4 years ago
_config.yml move call for talks url (#132) 4 years ago
app.js switch linter to eslint and fix errors (#135) 4 years ago
circle.yml Tutorial/docker (#125) 4 years ago
docker-compose.yml refactor code to use routes (#113) 4 years ago
package.json switch linter to eslint and fix errors (#135) 4 years ago
website.service add circle deployment script (#92) 5 years ago
yarn.lock switch linter to eslint and fix errors (#135) 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