Skip to content

NightOwlCoder/NightOwlCoder.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NightOwlCoder Blog

My personal blog site lives here, kindly hosted by GitHub Pages.

Follow @OwlCoder for new posts.

My life in code language:

void LifeLoop()
{
    Code();
    Family();
    Fun();
}

.NightOwlCoder


πŸš€ Technology Stack

  • Static Site Generator: Jekyll 3.x
  • Theme: jekyll-theme-hacker
  • Hosting: GitHub Pages
  • Comments: Disqus
  • Analytics: Google Analytics
  • Plugins:
    • jekyll-feed (RSS)
    • jekyll-seo-tag (SEO optimization)
    • jekyll-paginate (Pagination)
    • jekyll-sitemap (Sitemap generation)

πŸ“ Project Structure

NightOwlCoder.github.io/
β”œβ”€β”€ _config.yml           # Site configuration
β”œβ”€β”€ _posts/               # Blog posts (Markdown files)
β”œβ”€β”€ _pages/               # Static pages
β”‚   β”œβ”€β”€ 404.md           # Error page
β”‚   β”œβ”€β”€ about.md         # About page
β”‚   └── archive.md       # Posts archive
β”œβ”€β”€ _layouts/             # Page templates
β”‚   β”œβ”€β”€ default.html      # Base layout
β”‚   β”œβ”€β”€ page.html         # Static pages
β”‚   └── post.html         # Blog posts
β”œβ”€β”€ _includes/            # Reusable components
β”‚   β”œβ”€β”€ header.html
β”‚   β”œβ”€β”€ footer.html
β”‚   β”œβ”€β”€ head.html
β”‚   β”œβ”€β”€ analytics.html
β”‚   └── disqus_comments.html
β”œβ”€β”€ _sass/                # Custom styles (SCSS)
β”œβ”€β”€ assets/               # Images and media files
β”œβ”€β”€ css/                  # Main stylesheet
β”œβ”€β”€ index.html            # Homepage
β”œβ”€β”€ Gemfile               # Ruby dependencies
β”œβ”€β”€ README.md             # This file
└── AGENT.md              # AI agent instructions

πŸ› οΈ Local Development Setup

Prerequisites

  • Ruby 2.5+ installed
  • Bundler gem installed (gem install bundler)

Installation

  1. Clone the repository:
git clone https://github.com/NightOwlCoder/NightOwlCoder.github.io.git
cd NightOwlCoder.github.io
  1. Install dependencies:
bundle install
  1. Run the development server:
bundle exec jekyll serve
  1. Open your browser to http://localhost:4000

The site will auto-regenerate when you make changes to files.

✍️ Creating a New Blog Post

Manual Method

  1. Create a new file in the _posts/ directory with the naming convention:

    YYYY-MM-DD-title-slug.md
    

    Example: 2024-01-15-my-awesome-post.md

  2. Add front matter at the top of the file:

    ---
    layout: post
    title: "Your Post Title"
    date: 2024-01-15 20:00:00 -0800
    categories: category1 category2 category3
    ---
  3. Write your content in Markdown below the front matter

  4. Add images to the assets/ folder and reference them:

    ![Alt text](../assets/image-name.png)
  5. Commit and push to GitHub:

    git add .
    git commit -m "Add new blog post: Your Post Title"
    git push origin master

GitHub Pages will automatically build and deploy your changes within a few minutes.

Using an AI Agent

See AGENT.md for detailed instructions on how to use an AI assistant to create blog posts.

πŸ–ΌοΈ Adding Images

  1. Place image files in the assets/ directory
  2. Reference images in your posts using relative paths:
    ![Description](../assets/your-image.png)
  3. Optionally resize images:
    ![Description](../assets/your-image.png){:width="350px"}

🎨 Customization

Site Configuration

Edit _config.yml to customize:

  • Site title and description
  • Social media links
  • Google Analytics ID
  • Disqus shortname
  • Pagination settings

Styling

  • Modify SCSS files in _sass/ directory
  • Edit css/main.scss to import custom styles

Layouts and Components

  • Edit HTML templates in _layouts/
  • Modify reusable components in _includes/

πŸ“ Blog Post Front Matter Options

---
layout: post              # Required: Always 'post'
title: "Your Title"       # Required: Post title
date: YYYY-MM-DD HH:MM:SS -0800  # Required: Publication date
categories: cat1 cat2     # Optional: Post categories
excerpt: "Short summary"  # Recommended: Used for auto-tweet and previews
image: /assets/post-image.png  # Optional: Custom social media preview image
comments: true            # Optional: Enable/disable Disqus comments
---

Auto-Tweet Feature

🐦 Automatic Twitter Posting

When you push a new blog post to GitHub, it automatically posts to @OwlCoder with:

  • Post title
  • Custom excerpt (if provided)
  • Link to the full post
  • Preview card with image

Setup Requirements:

  • Twitter API credentials configured in GitHub Secrets
  • See docs/X-API-SETUP-GUIDE.md for setup instructions
  • See docs/AUTO-TWEET-SUMMARY.md for complete documentation

Best Practices:

  • Always include an excerpt: field for better tweet text
  • Add an image: field for custom preview images (optional)
  • Without custom image, defaults to NightOwlCoder logo
  • Keep excerpts under 150 characters for best results

πŸ”§ Configuration Files

_config.yml

Main site configuration including:

  • Site metadata (title, description, URLs)
  • Jekyll settings (theme, plugins)
  • Pagination configuration
  • Social media links
  • Analytics and comments configuration

Gemfile

Ruby gem dependencies for Jekyll and plugins

🚒 Deployment

This site automatically deploys via GitHub Pages when you push to the master branch.

No manual deployment steps required!

πŸ“Š Features

  • βœ… Responsive design
  • βœ… Syntax highlighting for code blocks
  • βœ… Pagination (4 posts per page)
  • βœ… RSS feed at /atom.xml
  • βœ… SEO optimized
  • βœ… Google Analytics integration
  • βœ… Disqus comments
  • βœ… Twitter integration
  • βœ… Sitemap generation

πŸ› Troubleshooting

Bundle Install Fails

bundle update
bundle install

Jekyll Serve Fails

Clear the cache:

bundle exec jekyll clean
bundle exec jekyll serve

Changes Not Showing on GitHub Pages

  • Wait 2-5 minutes for GitHub Pages to rebuild
  • Check the Actions tab in your GitHub repository for build status
  • Ensure _config.yml is valid YAML

πŸ“š Resources

πŸ“„ License

Content is copyrighted. Code structure follows Jekyll's standard MIT license.


Built with ❀️ using Jekyll and hosted on GitHub Pages

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •