Archives for p1k3, a website.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. commit-and-publish-linkdump: linkdump
  35. git add archives/linkdump
  36. git commit -m 'recent links'
  37. make publish
  38. manifest: $(shell find archives)
  39. find archives > manifest
  40. markup-manifest: manifest
  41. grep -ril '<freeverse>' ./archives > freeverse
  42. grep -ril '<textile>' ./archives > textile
  43. grep -ril '<markdown>' ./archives > markdown
  44. xargs -a freeverse -n1 sh -c 'echo $$1; cat $$1; echo' {} > freeverse_full
  45. # Generate a list of entries in archives/topics/ by tag-* tag file,
  46. # copy stuff in from topics/ vimwiki:
  47. topics: render manifest
  48. mkdir -p archives/topics
  49. bin/topics.sh
  50. # Profile rendering the entire site.
  51. #
  52. # Install Devel::NYTProf to use. See archives/2016/1/28/index for some notes.
  53. profile:
  54. perl -d:NYTProf `which wrt-render-all` > render.log
  55. nytprofhtml
  56. # Copy to a bare repo on the target system, then pull from there to a checked
  57. # out copy in the web root. Requires some configuration of both repositories.
  58. publish:
  59. @echo "[publishing p1k3.com and code.p1k3.com]"
  60. git push origin
  61. ssh p1k3.com 'cd /var/www/p1k3 && git pull public_staging master && make render && cd code.p1k3.com/html && ./list.pl > list.html;'
  62. # Locally render all entries in archives (includes some special cases):
  63. render: manifest asset_update_tag
  64. wrt render-all > render.log
  65. @tail -3 render.log
  66. render-lynx: manifest asset_update_tag
  67. wrt render-all --config=wrt-lynx-preview.json