HsCMS is a small blogging platform. It allows you to easily setup and run your own blog, by taking care of the administration details and the back-end.
What is has:
- Markdown editing for articles and static pages with live preview
- Automatic gist creation (which is actually nice for backup)
- Integrates with disqus for comments
- Can pull cloudflare analytics info (and also disqus analytics info)
If you want to follow the progress you can check the issues section of the project.
For any additional information, check out the wiki pages (although some information is also repeated here in the readme).
Contributions are more than welcome! :)...
I assume you are somewhat familiar with the yesod framework.
The steps to get going are:
- copy the
config/default-settings.ymlfile, rename it to
config/settings.ymland then set it up following the information under settings.
- do the same with
Oh, and you probably also want a favicon. You get that by placing your favicon at
config/favicon.ico and it should pick it up.
Only google authentication is used throughout the system, and therefore a google account is needed to use the admin facilities.
The reason for this is quite simply that I'd prefer not to have any login credentials or other things stored on the server, and would rather move that concern to a third-party (in this case google).
The preferred method of deployment is using the tool called keter. There is included a standard
config/default-keter.yaml settings file in the root directory, same as with
config/settings.yml, this needs to be copied and renamed to
Alter the settings to what you need, and then you can generate a
yesod keter. You can then move this to where your
keter service expects it to be (you can also use the
copy-to feature in the
keter.yaml file to do this last step automatically).
If you need to run
nginx, there is also a good guide for that here.
Keep the same SQLite3 database through deployments
To keep the same SQLite3 database file throughout deployments, you need to set its path to a shared destination. My own approach, when using keter, is to make a directory at
/opt/keter/database, and then set the setting for the production sqlite3 file to,
Production: database: /opt/keter/database/HsCMS_production.sqlite3 poolsize: 100 <<: *defaults
HsCMS provides a default layout you can use to get quickly started. If you want to use another layout, it is recommended that you don't alter the default layout, but create your own separate one.
To do this:
- Create a folder in
templates/layoutswith the name of your layout
- Make sure it has, as minimum, a
my-new-layoutis the name of the folder you created earlier
Because of how this currently functions, layouts are not autorecompiled when using
yesod devel meaning you have to stop the devel command and execute it again.
There are several settings that allow you to customise the system a bit.
admins: ["firstname.lastname@example.org", "email@example.com"]
admins settings is a list of all the emails that are allowed in the admin section of the system. Since google auth is used, it's impossible to gain access without owning or having control over the defined email.
disqus: your_disqus_shortname disqusSecretKey: your_disqus_secret_api_key disqusAccessToken: your_disqus_access_token
disqus setting allows you to set it to your disqus name, and, via that, integrate comments on the article pages. I recommend having different disqus sites for development and for production.
disqusAccessToken are set, you can view comment statistics in the admin dashboard. They are completely optional, and only the
disqus setting is needed for comments on your site.
githubToken: your_github_personal_access_key gistPublic: false
githubToken setting is really a novelty feature. It allows for automatic gist creation of your blog posts, and also updates them when you update your posts, effectively giving you a history of revisions and online backup of blog posts.
The gist is created the first time you publish your post, and is updated every time you update the post. It isn't deleted or hidden if you later on unpublish your post.
gistPublic is false, it will post as a secret gist, if not, it will be public and the creation along with updates will be shown in the feeds of the users that follow you on GitHub.
NOTE: you might not want to set
githubToken in the development section, but only in production, so you don't end up with a lot of useless test gists.
cloudflareKey: cloudflare_api_key cloudflareMail: "firstname.lastname@example.org" cloudflareZone: "example.com"
Allows HsCMS to pull visitor statistics and show them in the dashboard.
As mentioned in the section about layouts, this is used to set another layout than the default-layout. If it is not present, HsCMS will use the layout found in