Archives for p1k3, a website.

Makefile 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # This is the Makefile that stitches together p1k3.com.
  2. #
  3. # Assumptions:
  4. #
  5. # - p1k3 is served from /var/www/p1k3/public on a server at p1k3.com, while
  6. # /var/www/p1k3 contains the .git/ for the p1k3 repo
  7. # - App::WRT is installed both locally and on the server
  8. # - galleryhtml is installed
  9. # - You have the right SSH keys
  10. #
  11. # This is all super brittle and much of it should be configured somewhere
  12. # instead of hardcoded like so.
  13. all: topics photos render
  14. # Stash an epoch date somewhere for use in tacking a GET param on to CSS/JS
  15. # files and the like in the template (the sed call is just to chop off a newline;
  16. # remember here that $$ is an escaped single $):
  17. asset_update_tag: archives/css/p1k3.css archives/js/p1k3.js
  18. date '+%s' | sed -z 's/\n$$//m' > asset_update_tag
  19. # All of the entries in a single HTML file:
  20. fulltext:
  21. mkdir -p public/fulltext
  22. wrt display fulltext > public/fulltext/index.html
  23. photos:
  24. ./bin/photos.sh > photos.log
  25. header-photos:
  26. ./bin/header-photos.sh
  27. # add 'https://github.com/brennen.atom'\ below to include github activity
  28. linkdump:
  29. rm -f archives/linkdump
  30. ./bin/linkdump.pl\
  31. 'withbody :: https://feeds.pinboard.in/rss/u:brennen/?count=25'\
  32. 'https://brennen.newsblur.com/social/rss/98457/brennen'\
  33. > archives/linkdump
  34. manifest: $(shell find archives)
  35. find archives > manifest
  36. markup-manifest: manifest
  37. grep -ril '<freeverse>' ./archives > freeverse
  38. grep -ril '<textile>' ./archives > textile
  39. grep -ril '<markdown>' ./archives > markdown
  40. xargs -a freeverse -n1 sh -c 'echo $$1; cat $$1; echo' {} > freeverse_full
  41. # Generate a list of entries in archives/topics/ by tag-* tag file,
  42. # copy stuff in from topics/ vimwiki:
  43. topics: render manifest
  44. mkdir -p archives/topics
  45. bin/topics.sh
  46. # Profile rendering the entire site.
  47. #
  48. # Install Devel::NYTProf to use. See archives/2016/1/28/index for some notes.
  49. profile:
  50. perl -d:NYTProf `which wrt-render-all` > render.log
  51. nytprofhtml
  52. # Copy to a bare repo on the target system, then pull from there to a checked
  53. # out copy in the web root. Requires some configuration of both repositories.
  54. # This used to pass through GitHub. I don't really trust GitHub any more.
  55. publish:
  56. git push origin
  57. git push public_staging
  58. ssh -A root@p1k3.com 'cd /var/www/p1k3; git pull public_staging master; make render'
  59. cd code.p1k3.com && make publish
  60. # Locally render all entries in archives (includes some special cases):
  61. render: manifest asset_update_tag
  62. wrt render-all > render.log
  63. @tail -3 render.log
  64. render-lynx: manifest asset_update_tag
  65. wrt render-all --config=wrt-lynx-preview.json