A Static Site for redbrick generated with hexo using a theme based off icarus
- Node : v6.9(LTS) Download Node
To set up run:
yarnthis will install all the dependencies
You will also need to create three files:
mailing_lista newline-separated list of email addressesemail_update_loga newline-separated reverse-chronological list of times email updates were sent.envby copying.env.exampleand 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.
- 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
- While the server is live, a visit to
http://[sitehost]/api/regenerate?token=your_secret_tokenwill runhexo generateand send emails for any new posts so long as that process is not already underway.
- To generate new posts
- Run
yarn posts [title]This will create a new post in source/_post/[title].md
- Run
- To generate new pages:
- Run
yarn page [title]this will create a new page in source/[title]/index.md
- Run
- To edit the sidebar:
- Edit themes/redbrick-theme/_config.yaml - this is where all the theme configuration is controlled from.
- You can edit the css for the theme in themes/redbrick-theme/source/css
- You can edit the templates in themes/redbrick-theme/layout
Analytics can be enabled by adding your analytics key to theme/redbrick/_config.yaml
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
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