Hugo Dark Theme Site Generator https://after-dark.habd.as
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.

install.sh 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. #
  3. # The suspicious-looking install script for After Dark.
  4. # View the theme at <https://themes.gohugo.io/after-dark/>.
  5. #
  6. # Copyright (C) 2016–2018 Josh Habdas <jhabdas@protonmail.com>
  7. #
  8. # This work is free. You can redistribute it and/or modify it under the
  9. # terms of the Do What The Fuck You Want To Public License, Version 2,
  10. # as published by Sam Hocevar. See the COPYING file for more details.
  11. #
  12. # Exit early on failure
  13. set -e
  14. # Make some environment variables
  15. SITE_SOURCE_PATH=$(pwd)
  16. HUGO_CONFIG_PATH="./config.toml"
  17. # Create new After Dark site
  18. if [ -z "$1" ]; then
  19. SITE_SOURCE_PATH="${SITE_SOURCE_PATH}/flying-toasters"
  20. hugo new site flying-toasters && cd $_
  21. else
  22. SITE_SOURCE_PATH="${SITE_SOURCE_PATH}/$1"
  23. hugo new site $1 && cd $_
  24. fi
  25. echo "Installing After Dark ..."
  26. # Clone repo
  27. (cd themes; git clone -q --depth 1 https://git.habd.as/comfusion/after-dark || { echo "cloning failed :/"; exit 1; })
  28. # Copy archetypes
  29. cp themes/after-dark/archetypes/* ./archetypes
  30. # Ignore generated files from source control
  31. touch .gitignore
  32. echo "public
  33. resources" >> .gitignore
  34. # Add pretty config file with inline documentation
  35. tee $HUGO_CONFIG_PATH > /dev/null <<TOML
  36. baseurl = "https://c74ce35e.ngrok.io/" # Controls base URL
  37. languageCode = "en-US" # Controls site language
  38. title = "After Dark" # Homepage title and page title suffix
  39. paginate = 11 # Number of posts to show before paginating
  40. theme = "after-dark" # Set default theme
  41. enableRobotsTXT = true # Suggested, enable robots.txt file
  42. googleAnalytics = "" # Optional, add tracking Id for analytics
  43. disqusShortname = "" # Optional, add Disqus shortname for comments
  44. SectionPagesMenu = "main" # Enable menu system for lazy bloggers
  45. footnoteReturnLinkContents = "↩" # Provides a nicer footnote return link
  46. [params]
  47. description = "" # Suggested, controls default description meta
  48. author = "" # Optional, controls author name display on posts
  49. hide_author = false # Optional, set true to hide author name on posts
  50. show_menu = false # Optional, set true to enable section menu
  51. powered_by = true # Optional, set false to disable credits
  52. images = [
  53. "https://source.unsplash.com/collection/983219/2000x1322"
  54. ] # Suggested, controls default Open Graph images
  55. theme_variant = "" # Optional, for use to overriding default theme
  56. TOML
  57. echo "Creating an example post to get you started ..."
  58. # Create the first post with next steps for user
  59. hugo new post/starry-night.md
  60. echo "Serving your After Dark site ..."
  61. # Serve site backgrounded over Docker-friendly loopback
  62. hugo serve --buildDrafts --port 1337 --bind "0.0.0.0" &
  63. # Wait a second for Hugo server to fire up
  64. sleep 1
  65. # Pop the site in terminal browser, if installed
  66. if [[ "elinks" != "" ]]; then
  67. elinks http://0.0.0.0:1337/
  68. fi
  69. echo "Installation complete!"
  70. echo "Your new After Dark site is created in $SITE_SOURCE_PATH."
  71. echo "Site is currently running at http://0.0.0.0:1337/"
  72. echo "To stop it run \"kill \$(lsof -nt -i4TCP:1337)\"."
  73. echo "Thank you for choosing After Dark."
  74. exit 0