zfengg / WebsiteGen

Generate my personal website with Franklin.jl, containing work and hobby stuff.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Website Generator

This repository is for generating my personal website, containing both work and non-work related stuff, and currently hosted at rmsrosa.github.io.

It uses Franklin.jl, in the Julia language.

The css (cascading style sheet) was based on the "basic" Franklin template, one of the many Franklin templages available, but which I adapted to my taste.

The basic template was initiated with

using Franklin

newsite("website"; template="basic")

Then, I modified the original css files and added the desired contents.

Notes to myself

For a live local preview of the page, serve it from the website/ folder with

pkg> activate .

julia> using Franklin

julia> cd("website/")

julia> serve()

This generates the static website, under __site, and opens up the default browser with the locally generated site. Any changes made in the source files are automatically reflected in the generated site.

Publishing the generated website

Currently, with the site hosted at rmsrosa.github.io, one should make __site a git repo to sync with rmsrosa.github.io. If this has not been done yet, then, cd to the folder __site and proceed with

If starting afresh,

git init
git checkout -b main
git remote add origin https://github.com/rmsrosa/rmsrosa.github.com.git
git add -A
git commit -m "initial commit"
git push -u origin main
# git push --set-upstream origin main

After that, whenever you want to update the site with changes, just do

git add -A
git commit -m "commit message"
git push

Copying website/README.md to __site

README.md is ignored by Franklin, for a good reason, since it should not be processed to README/index.html.

But I wanted a website/README.md to be copied as is to __site, so it eventually gets synced to the github-pages repository.

Following the help of @tlienart, I created the following hfun_cpfiletosite function in utils.jl:

function hfun_cpfiletosite(filenamevec)
    cp(filenamevec[1], joinpath("__site", filenamevec[1]))
    return nothing
end

Then, I call this function in index.md with {{cpfiletoside README.md}}. That's it!

Blog comments

Franklin generates static sites, so it is not possible to have blog comments directly with it. However, there are several comment engines that can be included in a static site via javascript or iframe. Here is a list of some of them: utterances, StaticMan, IntenseDebate, Isso, Remark42, Talkyard, GraphComment, Muut, Commento, and Disqus. Some are free, some are paid, and some paid ones have limited free plans. Some are open source and some are closed source. I opted for utterances, since it is free, open-source, pretty easy to install, and all the comments are directly accessible in another github repo (or the same as the website repo, if you like).

Videos and animated gifs

Followed StackExchange: How do I convert a video to GIF using ffmpeg, with reasonable quality?

The periodic NSE simulation animation was reformatted with

ffmpeg -ss 0 -t 9 -i movie01xx.mp4 -vf "fps=10,scale=448:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 nsepersim.gif

The salt-layer evolution movie was reformatted with

ffmpeg -ss 0 -i potencial_ms_cropped.mp4 -vf "fps=15,scale=512:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 1 potencial_ms_cropped.gif

About

Generate my personal website with Franklin.jl, containing work and hobby stuff.

License:Creative Commons Zero v1.0 Universal


Languages

Language:HTML 45.3%Language:JavaScript 40.5%Language:CSS 10.2%Language:Julia 4.0%