Code Monkey home page Code Monkey logo

Comments (11)

max-arnold avatar max-arnold commented on May 20, 2024 1

Thanks a lot! Will try it tomorrow and report here if it works.

from emacs-easy-hugo.

max-arnold avatar max-arnold commented on May 20, 2024 1

Sorry, I forgot to inform you that my use case is solved and everything works just fine. You are great!

from emacs-easy-hugo.

masasam avatar masasam commented on May 20, 2024

Hi @max-arnold .
Thank you for comment.

if I they require different versions

I think that if your site don't work on the latest stable version of hugo you should correct the cause of your source.
If absolutely require different version, you can do this by changing the binary of hugo when you move the current directory.
You can do it by writing elisp in your init.el to change the symbolic link.
I think that it is not a easy-hugo problem but your problem.

I do not want to place hugo in PATH

I don't want to support a method that doesn't conform to UNIX standards.

Hope that helps!

from emacs-easy-hugo.

max-arnold avatar max-arnold commented on May 20, 2024

Ok, more details about my use case:

  1. I use separate python virtualenvs for each blog
  2. I need python in order to deploy my blog (I use Fabric tool for this) and perform other blog-related tasks
  3. I put Hugo binary to virtualenv bin (~/.virtualenvs/blog1/bin/hugo)

The binary is actually in the PATH, but only after I activate virtualenv by doing workon blog1. It allows me to freeze and isolate blog dependencies. Upgrading hugo everywhere is too risky, I prefer to do this separately for each blog.

So, because supporting virtualenvs is out of scope of this project, what I'm asking is to allow me to customize hugo path on per-blog basis.

from emacs-easy-hugo.

max-arnold avatar max-arnold commented on May 20, 2024

I found multiple (call-process "hugo") calls in the code. Does it make sense to apply the DRY principle and extract them into a function or macros, along with the ability to customize the binary path?

from emacs-easy-hugo.

masasam avatar masasam commented on May 20, 2024

I found multiple (call-process "hugo") calls in the code. Does it make sense to apply the DRY principle and extract them into a function or macros, along with the ability to customize the binary path?

If customizing the binary path permit you to solve the problem, I can respond.

from emacs-easy-hugo.

masasam avatar masasam commented on May 20, 2024

The following runs the Rakefile.
Does this method solve your problem?

You can do it in the following way.
put deploy.sh and Rakefile at easy-hugo-basedir

deploy.sh

#!/bin/sh
rake hello
rake pen
rake apple
chmod a+x deploy.sh

Rakefile

task :hello do
File.open("hello.txt", "w") do |f|
f.puts("Hello, World!")
end
end
task :pen do
File.open("pen.txt", "w") do |f|
f.puts("I have a pen!")
end
end
task :apple do
File.open("apple.txt", "w") do |f|
f.puts("I have an apple!")
end
end

M-x easy-hugo-github-deploy
or
Press G on easy-hugo-mode

from emacs-easy-hugo.

max-arnold avatar max-arnold commented on May 20, 2024

If customizing the binary path permit you to solve the problem, I can respond.

Yes, this would solve my case.

from emacs-easy-hugo.

max-arnold avatar max-arnold commented on May 20, 2024

And sorry, but I do not understand your Rakefile example. If it is about deployment tasks, then I do not plan to change my deployment method or switch to Rake.

from emacs-easy-hugo.

masasam avatar masasam commented on May 20, 2024

Hi @max-arnold .

Make hugo's binary changeable for each blog at 3b0516c

It will be reflected in melpa in around 6 hours.

sample setting

(setq easy-hugo-url "https://yourdomain")
(setq easy-hugo-bin "/.virtualenvs/blog1/bin/hugo")
(setq easy-hugo-basedir "~/yoursource/")
(setq easy-hugo-sshdomain "blogdomain")
(setq easy-hugo-root "/home/yourblog/")

(setq easy-hugo-bloglist '(((easy-hugo-basedir . "~/yoursource2/")
(easy-hugo-bin . "/.virtualenvs/blog2/bin/hugo")
(easy-hugo-url . "https://yourdomain2")
(easy-hugo-sshdomain . "blogdomain")
(easy-hugo-root . "/home/yourblog2/"))))

from emacs-easy-hugo.

masasam avatar masasam commented on May 20, 2024

Hi @max-arnold .
Thank you for test.
Thanks for the report.

from emacs-easy-hugo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.