1/7/2024 0 Comments Sublime livereload local file![]() ![]() Commit builds to git or some other version control system Expose a single config file to determine which db servers to connect to among other things Save everything locally and talk to a local development database Develop inside of a local VM and mimic the production server This might work for small personal projects but it's going to kill you later.Įveryone has their own opinions but my ideal workflow is: The rationale here is that Pelican itself does not have a strong facility for renaming or deleting individual posts, so to avoid outdated HTML files hanging around we have to just clobber everything.It's a recipe for disaster because your post made it seem like you want to edit some files locally and have them saved live on your real web server. This should not be used to “mix” Pelican output and other files. The -delete option to rsync is potential trouble, but note that the destination directory is called pelican and is specific to these files. Git archive is a way of exporting the entire repo in a bare repo it is required because git checkout-index will not work. Any output also shows up on the client side during the push. Using pre-receive instead of post-receive allows the push to be canceled in case the script exits with a non-zero exit code. Mkdir -p " $tempdir /in/" " $tempdir /out/" git archive $newrev | tar -x -C " $tempdir /in/" pelican -s " $tempdir /in/pelicanconf.py" -o " $tempdir /out/" " $tempdir /in/content/" rsync -checksum -r -delete " $tempdir "/out/* " $destdir /" rm -rf " $tempdir " fi done I think an import statement somewhere changed and thus replacing the class no longer worked.ĭo if ] then set -e Note: I updated this snippet since I first published this article. Unfortunately, the code blocks in both RST and Markdown only take a subset of available Pygments arguments, and this isn’t one of them (boo!)Īfter looking into the plugin architectures for both Markdown and RST, I ended up just monkey patching the PhpLexer class in Pygments to deal with this. ![]() I looked around the Web a bit and found various ad-hoc solutions and open bug reports in different projects, ultimately leading to the startinline option to Pygments’ PHP lexer (which of course defaults to False). Given that code snippets are often individual lines or functions, they shouldn’t all have to have
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |