Giter VIP home page Giter VIP logo

app-oszkar / deadlydog.github.io Goto Github PK

View Code? Open in Web Editor NEW

This project forked from deadlydog/deadlydog.github.io

0.0 0.0 0.0 29.73 MB

Daniel Schroeder's Programming Blog - Sharing my tips, tricks, and code to help other developers be more productive. https://blog.danskingdom.com

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

Ruby 2.08% HTML 20.41% PowerShell 31.86% SCSS 24.70% Dockerfile 5.45% JavaScript 15.50%

deadlydog.github.io's Introduction

Daniel Schroeder's Programming Blog

Welcome to the home of my personal programming blog. If you're looking for the actual blog and not the code that generates it, you can find it at blog.danskingdom.com.

This repository was initially cloned off of Minimal Mistakes GitHub Pages Starter, and then updated with my content and configuration.

I currently use the Minimal Mistakes theme. View the documentation.

Running Jekyll locally

Prerequisites

  1. Install Ruby v2.5 (some gems don't support v2.6 yet), as well as have it install MSYS2 after installation.
    • Use ruby -v to see which version is installed.
  2. Install the Jekyll gem using gem install jekyll bundler
    • Use jekyll -v to see which version of jekyll is installed.
    • You may need to restart your computer before the VS Code terminal recognizes Ruby.
  3. Run bundle install in the repository directory to install all of the required gems.

Run Jekyll locally

To run Jekyll locally, from the site directory run bundle exec jekyll serve.

You can include the --incremental (or -I) parameter to do faster incremental builds. e.g. bundle exec jekyll serve --incremental. However, this will not rebuild the site when making site-wide changes, such as changes to the layout or styles.

Some features are only enabled for production builds (e.g. comments, advertisements). To build in production mode, you must create/set an environment variable JEKYLL_ENV=production before starting jekyll. You can start Jekyll in production mode using either of these one-liner commands:

  • PowerShell - $Env:JEKYLL_ENV='production'; bundle exec jekyll serve
  • Bash - JEKYLL_ENV=production bundle exec jekyll serve

If you've written a draft post in the _drafts directory and want it to show up on the site, use bundle exec jekyll serve --incremental --draft to start Jekyll.

Jekyll typically runs locally at http://127.0.0.1:4000/.

Keeping up to date

To ensure that the GitHub Pages and other gems are up-to-date, periodically run bundle update to update all gems.

To use a newer version of the theme, update the _config.yml file and change the line:

remote_theme: mmistakes/minimal-mistakes@[tag|commit|branch]

to use a newer tag/commit from the theme repo.

Additionally, since we are overriding some files (see the Customizations section below), you may also need to update those files with newer versions if they have been changed in theme updates.

Updating to a newer version of the theme

To update to a newer version of the minimal-mistakes theme, do the following:

  1. Find the latest stable tag from the theme's changelog.
  2. Update the _config.yml file's remote_theme attribute to use that tag.
  3. Checkout the minimal-mistakes theme repo for that specific tag.
  4. In this repo, find all of the files that have Dan's Customizations in them. You will want to copy the code from the files of the official minimal-mistakes repo into the files in this repo, being sure to keep the customizations sections though, if still necessary. e.g. Copy all of the code from the official footer.html file into this repo's footer.html file, but keep the Dan's Customizations section.
  5. Test the site locally to ensure it still works as expected.
  6. Commit the changes with an appropriate comment and push them to GitHub.

Installing new gems and themes

Simply modify the Gemfile with the new gem to use, and then run bundle install to have it install the new gems.

Typically themes are installed from gems, and then you update the _config.yml file to specify the new theme to use.

Currently with the MinimalMistakes theme we are not installing it from a gem, but are instead using the remote theme method instead.

Customizations I've made to the theme / site

Anywhere that I make custom code changes, I try to put Dan's Customizations in comments, so doing a search of the repo for Dan should find all places I've changed / overwritten code. This doesn't include the _config.yml though, as we're expected to set custom settings in there.

Here's a list of places I've changed code. This typically meant copying the file from the forked minimal-mistakes repo and overriding parts of it:

  • _data/navigation.yml: Added Home navigation menu item and commented out Tags.
  • _includes/comments.html: Added logic to sort comments by date.
  • _includes/footer.html: Added code to the bottom of the file that:
    • Adds advertisements.
    • Adds a Donate section.
    • Dynamically adds a "Copy to clipboard" button to all code blocks.
  • _layouts/home.html: Added id to 'Recent Posts' heading so we can adjust whitespace around it.
  • _config.yml file.
  • assets/css/main.scss:
    • Adjusted font sizes a bit.
    • Added class used for the site description in the masthead.html.
    • Adjusted colors used for inline code text.
    • Added styling for elements.
    • Added styles for custom Donate sections.

Here's a list of files I've added:

  • Everything in the _posts and _drafts directories.
  • The _pages\About.md page.
  • Everything in the _assets\Posts, _assets\Site, and _assets\js directories.
  • Everything in the _data\comments directory.
  • The favicon.ico image.
  • The .vscode directory.
  • The ReadMe.md file.
  • The ads.txt file with my Google AdSense info.
  • The CNAME file was added automatically by GitHub when setting up GitHub Pages to use my custom domain name.
  • The Scripts directory and all files in it for making some operations easier.

Additional Info

Supported code language highlighters

By default Jekyll uses Rouge for syntax highlighting of code blocks. See this page for the list of supported languages. e.g. csharp, css, html, http, ini, json, liquid, markdown, powershell, sql, text, xml, yaml, and many more.

We may want to look at replacing Rouge with Pygments to get support for more languages, like AutoHotkey and batch files. Unfortunately GitHub Pages only supports Rouge at this time (June 2019) so we have to stick with it, but that may change in the future. There are open issues to add more languages to Rouge though, like Batch and AutoHotkey files.

Supported Kramdown options

By default Jekyll uses Kramdown for markdown processing. See this page for the list of supported options that may be used in _config.yml.

To show line numbers in code blocks, rather than using the traditional ``` syntax, do this instead (replacing 'powershell' with the appropriate language):

{% highlight powershell linenos %}
Your code goes here
{% endhighlight %}

Other sites using the same theme

Here are some other sites using the same theme, so we can see how they've configured theirs and customizations they've made:

Site history

The site was migrated from WordPress to Jekyll in April 2019, and before WordPress it was hosted in GeeksWithBlogs. This is why the posts before 2019 have additional front matter on them; the tool to export them from WordPress to Jekyll added it.

Some tools I used to convert the site from WordPress to Jekyll:

  • WordPress to Jekyll Exporter - Used to migrate all of the posts and uploads to a Jekyll format.
  • wordpress-comments-jekyll-staticman - After exporting your WordPress blog comments to an xml using the native export functionality, use this tool to convert the xml file into Staticman-format comments for use in Jekyll.

deadlydog.github.io's People

Contributors

deadlydog 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.