Verified Commit afa09f21 authored by Jay Kamat's avatar Jay Kamat

Update to circleci 2.0, and use cask

parent ce6aa796
version: 2
jobs:
build:
working_directory: ~/jgkamat-website
docker:
- image: silex/emacs:25.2
steps:
# Install cask
- run: curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | python
- checkout
- run: git config --global user.name "$GIT_USERNAME" && git config --global user.email "$GIT_EMAIL"
- run: git clone "$CIRCLE_REPOSITORY_URL" html && cd html && git checkout master && cd ..
- run: ~/.cask/bin/cask install
# Generate build files to /html
- run: ~/.cask/bin/cask eval "(progn (require 'jgkamat-website) (jgkamat-publish))"
- deploy:
name: Deploy website
command: |
if [ "${CIRCLE_BRANCH}" == "sources" ]; then
cd html && git add $(find . \( -iname \*.css -o -iname \*.html \)) && git commit -m "Autoupdate html sources" || true && git push https://$GH_TOKEN@github.com/jgkamat/jgkamat.github.io master || true
fi
......@@ -16,3 +16,5 @@ coverage
tmp/stackprof-*
*.html
html/
.cask/
(source gnu)
(source org)
(source melpa)
(package-file "jgkamat-website.el")
;; (files "jgkamat-website.el")
(development
(depends-on "htmlize")
(depends-on "ox-twbs"))
machine:
services:
- docker
# The test phase dosen't actually run tests. We need the caching from the deploy step.
test:
override:
- git clone "$CIRCLE_REPOSITORY_URL" html && cd html && git checkout master && cd ..
- docker run -ti -v `pwd`:/root/website ubuntu:zesty 'bash' '-c' 'cd ~/website/src && apt-get update && export TERM="xterm-256color" && apt-get install -y emacs25-nox && emacs -nw -q --eval "(progn (load-file \"buildproject.el\") (save-buffers-kill-terminal))"'
deployment:
github:
branch: sources
commands:
- git config --global user.name "$GIT_USERNAME" && git config --global user.email "$GIT_EMAIL"
- cp -r src/ html/
- cd html && git add $(find . \( -iname \*.css -o -iname \*.html \)) && git commit -m 'Autoupdate html sources' || true && git push https://$GH_TOKEN@github.com/jgkamat/jgkamat.github.io master || true
;;; jgkamat-website.el --- generation scripts for jgkamat's website
;; Copyright (C) 2016-present Jay Kamat
;; Author: Jay Kamat <jaygkamat@gmail.com>
;; Version: 1.0
;; Keywords: jgkamat
;; URL: https://github.com/jgkamat/jgkamat.github.io
;; Package-Requires: ((emacs "25.0") (htmlize) (ox-twbs))
;;; Commentary:
;;Creates and builds org project files for my website
;; To run: cask eval "(progn (require 'jgkamat-website) (jgkamat-publish))" in the root of the project.
;;; Code:
(require 'ox-publish)
(require 'ox-twbs)
(defvar website-publish-dir (concat (file-name-directory load-file-name) "./html"))
;; Force htmlize to activate even in nogui mode:
;; https://stackoverflow.com/questions/3591337/emacs-htmlize-in-batch-mode
;; http://sebastien.kirche.free.fr/emacs_stuff/elisp/my-htmlize.el
;; Get fancy colors! (but this will screw up your native emacs install)
(when noninteractive
;; Don't run in interactive mode to avoid breaking your colors
(custom-set-faces
;; Draculized minimal: https://github.com/jgkamat/darculized
;; TODO find out why default face is not applying.
'(default ((t (:foreground "#909396" :background "#262626"))))
'(font-lock-builtin-face ((t (:foreground "#598249"))))
'(font-lock-comment-face ((t (:foreground "#5e6263"))))
'(font-lock-constant-face ((t (:foreground "#15968D"))))
'(font-lock-function-name-face ((t (:foreground "#2F7BDE"))))
'(font-lock-keyword-face ((t (:foreground "#598249"))))
'(font-lock-string-face ((t (:foreground "#15968D"))))
'(font-lock-type-face ((t (:foreground "#598249"))))
'(font-lock-variable-name-face ((t (:foreground "#2F7BDE"))))
'(font-lock-warning-face ((t (:foreground "#bd3832" :weight bold)))))
(setq htmlize-use-rgb-map 'force)
(require 'htmlize))
;; I reccomend you publish with FORCE on to avoid loosing changes in history files
;; (org-publish-current-project t)
(let ((proj-base (file-name-directory load-file-name)))
(setq project-base proj-base)
(setq project-base (concat proj-base "src/"))
(setq org-publish-project-alist
`(("jgkamat.github.io"
:base-directory ,(concat proj-base ".")
:base-directory ,project-base
:recursive t
:publishing-directory ,(or (and (boundp 'website-publish-dir) website-publish-dir) (concat proj-base "../"))
:publishing-directory ,(or (and (boundp 'website-publish-dir) website-publish-dir) (concat project-base "../html/"))
:html-head-extra "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://jgkamat.github.io/src/jgkamat.css\"> <link href=\"https://fonts.googleapis.com/css?family=Open+Sans\" rel=\"stylesheet\">"
:title nil
:with-headline-numbers nil
......@@ -54,7 +94,7 @@
(sort
;; Map environments to (filename . property titles)
(mapcar #'gen-org-property files)
'(lambda (one two)
(lambda (one two)
(let ((x (org-timestamp-to-str (first (second one))))
(y (org-timestamp-to-str (first (second two)))))
;; (print (concat x " " y))
......@@ -77,7 +117,7 @@
;; Get desired sorting order
(reverse
;; Map properties to strings
(mapcar '(lambda (x)
(mapcar (lambda (x)
(format "1. %s" (org-property-to-link x)))
(gen-links-properties directory)))))
......@@ -104,36 +144,21 @@
"\n#+end_div-right"
"\n#+end_div-wrap"))))
;; (require 'request)
;; (defun gh-stars (repo-string)
;; (if (string= "-" repo-string)
;; "-"
;; (progn (require 'request)
;; (defvar result nil)
;; (request (concat "https://api.github.com/repos/" repo-string "/stargazers?per_page=1")
;; :parser 'json-read
;; :sync t
;; :success
;; (cl-function
;; (lambda (&key response &allow-other-keys)
;; (setq result response))))
;; result)))
;; (defun parse-gh-str (url-string)
;; "Parses a github url and returns a nice representation like: jgkamat/alda-mode"
;; (let* ((var (split-string url-string "/"))
;; (len (length var)))
;; (when (string= (elt (last var) 0) "")
;; (setq len (- len 1)))
;; (concat (elt var (- len 2)) "/" (elt var (- len 1)))))
;; (defun parse-org-link (org-link)
;; "takes in an org link and returns a string link"
;; (symbol-name (elt (elt org-link 0) 0)))
;; (defun org-link-to-str (link)
;; "Turns org links to jgkamat/alda-mode format"
;; (let ((str-link (parse-org-link link)))
;; (if (string-match "github" str-link)
;; (parse-gh-str str-link)
;; "-")))
;; Don't prompt for build stuff
(defun my-org-confirm-babel-evaluate (lang body)
(not (member lang '("emacs-lisp" "python" "sh" "dot"))))
(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)
(setq org-cycle-include-plain-lists 'integrate ;; Cycle through plain lists
org-pretty-entities t
org-src-fontify-natively t)
(defun jgkamat-publish ()
"Export this website. Assumes this file has set up the projects already."
(let ((make-backup-files nil))
(org-publish-all t)))
(provide 'jgkamat-website)
;;; jgkamat-website.el ends here
==================================================================
https://keybase.io/jgkamat
--------------------------------------------------------------------
I hereby claim:
* I am an admin of https://jgkamat.github.io
* I am jgkamat (https://keybase.io/jgkamat) on keybase.
* I have a public key ASBaCSG1YsS8KsPu1UIEbOLcs2SPRDmG5T9xG5WJrIrm8go
To do so, I am signing this object:
{
"body": {
"key": {
"eldest_kid": "01205a0921b562c4bc2ac3eed542046ce2dcb3648f443986e53f711b9589ac8ae6f20a",
"host": "keybase.io",
"kid": "01205a0921b562c4bc2ac3eed542046ce2dcb3648f443986e53f711b9589ac8ae6f20a",
"uid": "b24b81a5345b97f1a76acd448bde0c19",
"username": "jgkamat"
},
"service": {
"hostname": "jgkamat.github.io",
"protocol": "https:"
},
"type": "web_service_binding",
"version": 1
},
"client": {
"name": "keybase.io go client",
"version": "1.0.16"
},
"ctime": 1469294635,
"expire_in": 504576000,
"merkle_root": {
"ctime": 1469294581,
"hash": "169e7c3483d9c75c6e0b0fc8d8f575bac0dcd52ebea25632da08a901f25c7324913ce8fddca3b31c05bb3e0736df787115f084e83e1d623b642888f0867d56f3",
"seqno": 539470
},
"prev": "b1f59c3ea6085830bbb87fb4312f157cded4b47775ab26ceddb2d190080aa0fe",
"seqno": 10,
"tag": "signature"
}
which yields the signature:
hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgWgkhtWLEvCrD7tVCBGzi3LNkj0Q5huU/cRuViayK5vIKp3BheWxvYWTFAvl7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTIwNWEwOTIxYjU2MmM0YmMyYWMzZWVkNTQyMDQ2Y2UyZGNiMzY0OGY0NDM5ODZlNTNmNzExYjk1ODlhYzhhZTZmMjBhIiwiaG9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwNWEwOTIxYjU2MmM0YmMyYWMzZWVkNTQyMDQ2Y2UyZGNiMzY0OGY0NDM5ODZlNTNmNzExYjk1ODlhYzhhZTZmMjBhIiwidWlkIjoiYjI0YjgxYTUzNDViOTdmMWE3NmFjZDQ0OGJkZTBjMTkiLCJ1c2VybmFtZSI6Impna2FtYXQifSwic2VydmljZSI6eyJob3N0bmFtZSI6Impna2FtYXQuZ2l0aHViLmlvIiwicHJvdG9jb2wiOiJodHRwczoifSwidHlwZSI6IndlYl9zZXJ2aWNlX2JpbmRpbmciLCJ2ZXJzaW9uIjoxfSwiY2xpZW50Ijp7Im5hbWUiOiJrZXliYXNlLmlvIGdvIGNsaWVudCIsInZlcnNpb24iOiIxLjAuMTYifSwiY3RpbWUiOjE0NjkyOTQ2MzUsImV4cGlyZV9pbiI6NTA0NTc2MDAwLCJtZXJrbGVfcm9vdCI6eyJjdGltZSI6MTQ2OTI5NDU4MSwiaGFzaCI6IjE2OWU3YzM0ODNkOWM3NWM2ZTBiMGZjOGQ4ZjU3NWJhYzBkY2Q1MmViZWEyNTYzMmRhMDhhOTAxZjI1YzczMjQ5MTNjZThmZGRjYTNiMzFjMDViYjNlMDczNmRmNzg3MTE1ZjA4NGU4M2UxZDYyM2I2NDI4ODhmMDg2N2Q1NmYzIiwic2Vxbm8iOjUzOTQ3MH0sInByZXYiOiJiMWY1OWMzZWE2MDg1ODMwYmJiODdmYjQzMTJmMTU3Y2RlZDRiNDc3NzVhYjI2Y2VkZGIyZDE5MDA4MGFhMGZlIiwic2Vxbm8iOjEwLCJ0YWciOiJzaWduYXR1cmUifaNzaWfEQD7uX0L87miJiEi/3+ixNPVv52XiEXh/SoafblxXxbRa9ZEhRamUmSPHxLZiH/oSjkQ2LxLgT1z3uC79wM7zmQKoc2lnX3R5cGUgpGhhc2iCpHR5cGUIpXZhbHVlxCBcleLZkgq+6aFuc8VFbDoFuRPX635Pj6acXgl9y52296N0YWfNAgKndmVyc2lvbgE=
And finally, I am proving ownership of this host by posting or
appending to this document.
View my publicly-auditable identity here: https://keybase.io/jgkamat
==================================================================
all:
cask eval "(progn (require 'jgkamat-website) (jgkamat-publish))"
install:
cask install
User-agent: *
Disallow: /src/
......@@ -60,9 +60,9 @@ For a single file, we would put ~#+OPTIONS: toc:nil~, but to apply this to every
** Making this Shareable
Some people might want to put this ~setq~ call in your Emacs dotfiles, but I prefer to place it in a [[https://github.com/jgkamat/jgkamat.github.io/blob/sources/src/project.el][project.el]] file instead, which lets others get the same project definition. It also lets you put other changes you make in this file as well, since all those changes will be elisp. Anyone who wants to work with your project simply needs to source this file, instead of setting up the project again.
Some people might want to put this ~setq~ call in your Emacs dotfiles, but I prefer to place it in a [[https://github.com/jgkamat/jgkamat.github.io/blob/sources/jgkamat-website.el][seperate emacs lisp file]] file instead, which lets others get the same project definition. It also lets you put other changes you make in this file as well, since all those changes will be elisp. Anyone who wants to work with your project simply needs to source this file, instead of setting up the project again.
In order to make sure others can use this flawlessly, we need to remove these absolute links from our project, such as ~/var/www/html~ and ~~/org-project~, since we can't expect everyone to have the same directory structure as we do. Since we are loading the static file ~project.el~, we can define the root/export in terms of this file. This is one way to do that, assuming that project.el is in the root:
In order to make sure others can use this flawlessly, we need to remove these absolute links from our project, such as ~/var/www/html~ and ~~/org-project~, since we can't expect everyone to have the same directory structure as we do. Since we are loading the static file ~jgkamat-website.el~, we can define the root/export in terms of this file. This is one way to do that, assuming that ~jgkamat-website.el~ is in the root:
#+BEGIN_SRC emacs-lisp
(let ((proj-base (file-name-directory load-file-name)))
......@@ -74,7 +74,7 @@ In order to make sure others can use this flawlessly, we need to remove these ab
:publishing-function org-html-publish-to-html))))
#+END_SRC
The org project definition for this blog (in [[https://github.com/jgkamat/jgkamat.github.io/blob/master/src/project.el][project.el]]) is not much more complicated than this one.
The org project definition for this blog (in [[https://github.com/jgkamat/jgkamat.github.io/blob/sources/jgkamat-website.el][jgkamat-website.el]] is not much more complicated than this one.
The main difference is it has a bunch of org project customizations turned on, and it's using ~ox-twbs~ instead of the native html exporter.
This is done by changing the ~:publishing-function~ to ~org-twbs-publish-to-html~, which is in the ~ox-twbs~ docs.
......@@ -129,7 +129,7 @@ After creating a ~(gen-links)~ to generate a sorted list of org blog posts, and
,#+END_SRC
#+END_SRC
I put the source for these functions in my [[https://github.com/jgkamat/jgkamat.github.io/blob/master/src/project.el][project.el]]. These functions work by parsing all my org files in ~/blog~ and sorting them by the ~#+DATE~, and displaying the relevant information.
I put the source for these functions in my [[https://github.com/jgkamat/jgkamat.github.io/blob/sources/jgkamat-website.el][jgkamat-website.el]]. These functions work by parsing all my org files in ~/blog~ and sorting them by the ~#+DATE~, and displaying the relevant information.
They need some more work, but they are usable for now. I might post about how I made those functions later...
* Side Note: Divs
......
......@@ -107,6 +107,7 @@ These are projects that I have created purely for fun, or for improvements in my
+ Jenkins
+ GoCD
+ Travis
- Performance Analysis via ~perf~
- Robotics
+ [[https://www.robojackets.org/][Georgia Tech RoboJackets]] - RoboCup /(2014-Present)/
+ [[http://homesteadrobotics.com/][Homestead HRT]] - FRC Team 670 /(2012-2014)/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment