Giter Site home page Giter Site logo

Comments (3)

justinabrahms avatar justinabrahms commented on July 20, 2024 2

If someone runs into this w/ static files that need copying, this is what I'm doing.

I have a few things like css files, favicons, etc that I need moved. The tangle of the main emacs.org will output my blog settings as elisp as well as some static files (like css). Then I use that to actually do the publish.

help:
	@echo "You want to pick one of the options. publish or tangle"

tangle:
	emacs --no-init-file --batch \
                --eval "(require 'package)"\
                --eval "(add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\") t)"\
                --eval "(package-initialize)"\
                --eval "(package-refresh-contents nil)"\
                --eval "(package-install 'org)"\
                --eval "(package-install 'lua-mode)" \
                --eval "(package-install 'toml-mode)" \
                --eval '(setq comment-start "#")' \
                --eval "(require 'org)" \
                --eval "(require 'lua-mode)" \
                --eval "(require 'toml-mode)" \
                --eval '(org-babel-tangle-file "./_posts/dotfiles/emacs.org")'

publish: tangle
	emacs --batch --no-init-file \
		--eval "(setq blog-root \"`pwd`\")" \
		--load ~/.config/emacs/static-blog.el  \
		--eval '(message "publishing...")' \
		--eval '(org-static-blog-publish t)' \
		--eval '(message "...done")'
	./copy-static-dirs.sh

copy-static-dirs.sh

#!/usr/bin/env bash
set -x
# Used to copy files over to the blog publishing location b/c org-static-blog
# doesn't support static blog-specific files

PUBLISH_DIR=$(emacs --batch --no-init-file --load ~/.config/emacs/static-blog.el --eval "(princ org-static-blog-publish-directory)" 2>/dev/null)
cp -vR ./static/ $PUBLISH_DIR/

from org-static-blog.

bastibe avatar bastibe commented on July 20, 2024

This is tough, since org-static-blog currently does not care about static files at all. I usually use relative paths, and don't care about them being broken in org-mode.

Maybe we should add an org-static-blog-assets-directory, and auto-copy linked files there on export? I am not sure about the best way to proceed, either.

Or maybe it would be best to just handle this locally, by symlinking your assets directory into both, the posts directory and the publish directory. This should work, and would not require a change in org-static-blog.

from org-static-blog.

neeasade avatar neeasade commented on July 20, 2024

Or maybe it would be best to just handle this locally, by symlinking your assets directory into both, the posts directory and the publish directory. This should work, and would not require a change in org-static-blog

currently what I'm doing FWIW

from org-static-blog.

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.