GithubHelp home page GithubHelp logo

qzyse2017 / qzyse2017.github.io Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 423 KB

Zyck's blogs

Home Page: https://qzyse2017.github.io

License: Apache License 2.0

HTML 77.51% Ruby 5.59% CSS 15.00% Python 1.90%

qzyse2017.github.io's Introduction

Zyck's blog

built with github Pages with jekyll

write something worth recording visit https://qzyse2017.github.io to view the blogs.

How to reuse the site's page layouts

  1. clone this repo
git clone https://github.com/qzyse2017/qzyse2017.github.io
  1. remove *.mardown files in _posts directory

  2. write some post files yourself in _posts directory, you can refer to the format like any file in _posts directory

  3. configure settings in _config.yml, you may refer to this current site and change the corresponding parts in _config.yml

  4. generate files to be showed under WSL and Linux, enter this repo which you have cloned and configured and written some new posts

run command bundle exec jekyll serve preview your local Jekyll site in your web browser at http://localhost:4000.

I haven't tried how to get it done under windows or osx, you may refer to this help page in GitHub.

  1. you may also need to remove some other files like genContent.py and files under _site/daily_posts

Generate contents automatically while committing

Although jekyll default template provides some code to generate contents while building the website, I did not notice it and wrote a simple script to generate contents myself: genContent.py and I now added a gt hook to automatically start it every time I use git commit, if you also want to have a try:

  1. copy the following code and name it pre-commit
  2. put it under a git inited directory, dir-name/.git/hooks/, and you want to prevent it from working, use git commit --no-verify
  3. use git add <you-new-added-file-name-here>
  4. if you do not add new posts, it is recommended that you use git commit --no-verify
#!/bin/sh

if [ -n eval $(python genContent.py)]
then
	git commit content.md -m 'Renew content' --no-verify
else	
	# Handle error
	echo >&2 "Found error while generate contents, will execute normal commit without generating new contents"
fi

exit 0

Note:

  1. if any error occurred, you can use git reflog to list all you operations and use git reset --hard <status-sha1> here to reset your status.

  2. In fact the pre-commit hook will only commit changes in content.md, so you do not need to care about other files' changes will be included.

qzyse2017.github.io's People

Contributors

prism4time avatar

Watchers

 avatar

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.