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.

86 lines
2.2 KiB

4 years ago
4 years ago
4 years ago
4 years ago
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:4] and configure it for =one-post-for-file= to add support for exporting to *Hugo markdown*[fn:3].
  11. #+begin_src emacs-lisp
  12. (use-package ox-hugo
  13. :after ox)
  14. #+end_src
  15. * Posts
  16. Add a capture template for creating new blog posts.
  17. #+begin_src emacs-lisp
  18. (with-eval-after-load 'org-roam
  19. (add-to-list 'org-roam-capture-templates
  20. '("p" "Post" plain (function org-roam-capture--get-point)
  21. "%?"
  22. :file-name "docs/posts/${slug}"
  23. :unnarrowed t
  24. :head
  25. "
  26. ,#+TITLE: ${title}
  27. ,#+AUTHOR: Christopher James Hayward
  28. ,#+DATE: %<%Y-%m-%d>
  29. ,#+OPTIONS: num:nil todo:nil tasks:nil
  30. ,#+EXPORT_FILE_NAME: ${slug}
  31. ,#+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/
  32. ,#+HUGO_BASE_DIR: ../
  33. ,#+HUGO_AUTO_SET_LASTMOD: t
  34. ,#+HUGO_SECTION: posts
  35. ,#+HUGO_DRAFT: true
  36. ")))
  37. #+end_src
  38. * Notes
  39. Add a capture template for creating blog posts and notes on other peoples content / published works.
  40. #+begin_src emacs-lisp
  41. (with-eval-after-load 'org-roam
  42. (add-to-list 'org-roam-capture-templates
  43. '("n" "Notes" plain (function org-roam-capture--get-point)
  44. "%?"
  45. :file-name "docs/notes/${slug}"
  46. :unnarrowed t
  47. :head
  48. "
  49. ,#+TITLE: ${title}
  50. ,#+AUTHOR: Christopher James Hayward
  51. ,#+OPTIONS: num:nil todo:nil tasks:nil
  52. ,#+EXPORT_FILE_NAME: ${slug}
  53. ,#+ROAM_KEY: https://chrishayward.xyz/notes/${slug}/
  54. ,#+HUGO_BASE_DIR: ../
  55. ,#+HUGO_AUTO_SET_LASTMOD: t
  56. ,#+HUGO_SECTION: notes
  57. ,#+HUGO_DRAFT: true
  58. ")))
  59. #+end_src
  60. * Footnotes
  61. [fn:1] https://gohugo.io
  62. [fn:2] https://chrishayward.xyz
  63. [fn:3] https://markdownguide.org/tools/hugo
  64. [fn:4] https://github.com/kaushalmodi/ox-hugo