HRocket aspires to be a static site generator that's a blogging Geek's best friend.
The name HRocket is a play on the venerable portable typewriter the Hermes Rocket.
- We should have a top-level R folder where we organize our R code
- We should have a bin folder with has bash scripts that wrap the R code
- The user as part of the install instructions will be required to add the bin to the path
- The bin folder should have:
- bin/hrmk -- this is the make file which will run the build process
- bin/hrclean -- this will delete any cache files
- HRocket can operates in two different modes:
- monolithic-mode (perhaps we can find a better word) -- in this mode the published HTML files are under the same directory structure as the HRocket root folder
- separate-mode and this is the preferred mode, where the HTML generation directory is outside the HRocket folder
- Charting should be done using Plot.ly and ggplot
- HRocket will support code embedding from Bash, C, C++, Java, Python, and R -- later we will add support for Scala, Clojure, and other languages
- Each theme will be in a self-contained folder with a unique name
- The theme folder will be in a folder called themes
- The bootstrap theme will be used to build the first theme
Install Git on your local machine (see https://git-scm.com/downloads)
Install R on your local machine (see https://www.r-project.org)
Install "configr" package in R
Install "xml2" package in R
Install "pandoc" on your OS (For ubuntu $ sudo apt-get install pandoc)
Edit .bashrc using following command
$ sudo gedit /home/your-username/.bashrc
Add following new line at the end of file
export PATH=/home/your-username/hrocket/bin:$PATH
After setting above mentioned, clone hrocket from github using following command at your "/home/your-username/" location
$ git clone https://github.com/armaninspace/hrocket.git
Then on your terminal execute hrocket with following command
$ hrocket.sh build-clean
For embedding images put your images at "src/images" directory
Then in your Rmd files embed image as per images section on following link
https://rmarkdown.rstudio.com/authoring_basics.html
computer.jpg is a sample image embeded in "src/content/pages/about.Rmd"
For embedding youtube videos paste iframe embed code in Rmd file as follow
For showing full content or teaser on blog listing page there is an option for setting in "/hrocket/src/content/blogs_list/blogs.Rmd"
teaser: "full" (For full content)
teaser: "half" (For content as teaser)
For setting blog as home page there is an option for setting in "/hrocket/src/content/blogs_list/blogs.Rmd"
bloghome: "false" (Not as home page)
bloghome: "true" (As home page)
Hrocket will also create a sitemap.xml at website's root directory which includes all the urls of your static website.
In config.toml file you can add meta keywaords as follow.
metaKeywords = "HTML, CSS, XML, XHTML, JavaScript"
In config.toml file you can add key for google analytics as follow.
googleAnalyticsTrackingId = "UA-232232-34"
Hrocket will also create a robots.txt which allows or disallows the indexing of site by search engine crawlers. This can be handled by a variable in conf.toml file as follow
robotsAllow = "True" (This will allow indexing of static website by the search engine crawlers)
robotsAllow = "False" (This will disallow indexing of static website by the search engine crawlers)
For resolving relative path issue user can adjust some configuration variables in config.toml as follow
-
for a domain setup
publishDir = ""
logoLink = "/"
[[mainMenu]]
name = "Home"
url = "/"
[[mainMenu]]
name = "About"
url = "/content/pages/about"
[[mainMenu]]
name = "Blogs"
url = "/content/pages/blogs" -
for github pages (when user's github page repo is "testhrocket")
publishDir = "/testhrocket"
logoLink = "/testhrocket"
[[mainMenu]]
name = "Home"
url = "/testhrocket"
[[mainMenu]]
name = "About"
url = "/testhrocket/content/pages/about"
[[mainMenu]]
name = "Blogs"
url = "/testhrocket/content/pages/blogs"