I showed you my source code, pls respond
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.

84 lines
2.2 KiB

4 years ago
  1. #+TITLE: Website
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle website.el :comments org
  5. #+PROPERTY: header-args :results silent :eval no-export :comments org
  6. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  7. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  8. I use *Hugo*[fn:1] for my *website*[fn:2] which I write in *Org*[fn:3] before compiling to *Hugo markdown*[fn:4].
  9. * Setup
  10. Download *Ox-hugo*[fn:5] and configure it for =one-post-for-file= to add support for exporting to *Hugo markdown*[fn:4].
  11. #+begin_src emacs-lisp
  12. (use-package ox-hugo
  13. :after ox
  14. :init (dotfiles/install "hugo"))
  15. #+end_src
  16. * Posts
  17. Add a capture template for creating new blog posts.
  18. #+begin_src emacs-lisp
  19. (with-eval-after-load 'org-roam
  20. (add-to-list 'org-roam-capture-templates
  21. '("p" "Post" plain (function org-roam-capture--get-point)
  22. "%?"
  23. :file-name "docs/posts/${slug}"
  24. :unnarrowed t
  25. :head
  26. "
  27. ,#+TITLE: ${title}
  28. ,#+AUTHOR: Christopher James Hayward
  29. ,#+DATE: %<%Y-%m-%d>
  30. ,#+OPTIONS: num:nil todo:nil tasks:nil
  31. ,#+EXPORT_FILE_NAME: ${slug}
  32. ,#+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/
  33. ,#+HUGO_BASE_DIR: ../
  34. ,#+HUGO_AUTO_SET_LASTMOD: t
  35. ,#+HUGO_SECTION: posts
  36. ,#+HUGO_DRAFT: true
  37. ")))
  38. #+end_src
  39. * Notes
  40. Add a capture template for creating blog posts and notes on other peoples content / published works.
  41. #+begin_src emacs-lisp
  42. (with-eval-after-load 'org-roam
  43. (add-to-list 'org-roam-capture-templates
  44. '("n" "Notes" plain (function org-roam-capture--get-point)
  45. "%?"
  46. :file-name "docs/notes/${slug}"
  47. :unnarrowed t
  48. :head
  49. "
  50. ,#+TITLE: ${title}
  51. ,#+AUTHOR: Christopher James Hayward
  52. ,#+OPTIONS: num:nil todo:nil tasks:nil
  53. ,#+EXPORT_FILE_NAME: ${slug}
  54. ,#+ROAM_KEY: https://chrishayward.xyz/notes/${slug}/
  55. ,#+HUGO_BASE_DIR: ../
  56. ,#+HUGO_AUTO_SET_LASTMOD: t
  57. ,#+HUGO_SECTION: notes
  58. ,#+HUGO_DRAFT: true
  59. ")))
  60. #+end_src
  61. * Resources
  62. [fn:1] https://gohugo.io
  63. [fn:2] https://chrishayward.xyz
  64. [fn:3] https://markdownguide.org/tools/hugo
  65. [fn:4] https://github.com/kaushalmodi/ox-hugo