Skip to content

akhiluk/website

 
 

Repository files navigation

IndieWebClub Bangalore Website

This repository contains the source code for the IndieWebClub Bangalore website, a static site generated using Python. The website displays upcoming and past events, and a blogroll of recent posts from the community.

Features

  • Event feed and calendar
  • Member blogroll page and feeds
  • Member directory
  • Webring
  • CI/CD

Installation

Prerequisites

  • Python 3.x
  • make

Installation and Setup

  1. Clone the repository:

    git clone https://github.com/IndieWebClubBlr/website.git
    cd website
  2. Set up the environment and install dependencies: The Makefile provides a convenient way to set up a Python virtual environment and install the required dependencies from requirements.txt.

    make setup

    You can run make or make help at any time to see a list of all available commands.

  3. Activate the virtual environment if required:

    source venv/bin/activate

Usage

The following commands are available through the Makefile.

Common Commands

  • make build: Build the website. This will generate the static files in the _site directory. For faster builds during development, you can enable caching by running make build CACHE=true.
  • make serve: Serve the website locally for development. You can view the site at http://localhost:8000.
  • make watch: Automatically rebuild the site when files change.

Other Commands

  • make install: Install or update dependencies if requirements.txt changes.
  • make clean: Remove the generated _site directory.
  • make clean_all: Perform a full cleanup, removing the _site directory, the venv, and the cache.

How it Works

The website is generated by the generator.py script. This script performs the following steps:

  1. Parses blogroll.opml: Reads the list of community blog feeds.
  2. Fetches feeds: Concurrently fetches the content of each feed.
  3. Detects weeknotes: Automatically separates weeknote entries from regular blog posts based on title and tag patterns.
  4. Fetches events: Retrieves event information from the Underline Center Discourse API.
  5. Generates the homepage: Ggenerate the homepage with the aggregated content.
  6. Generated static pages: Converts Markdown files in the pages/ directory to static HTML pages.
  7. Generates feeds and calendar: Creates Atom feeds for the blogroll and events, and an iCalendar file for events.
  8. Generates member directory: Creates a member directory page listing all community members.
  9. Generates webring: Creates webring redirect links that connect to random member websites.

The generated site is then deployed to the gh-pages branch of the repository.

Configuration

The project's behavior can be customized through the config.py file. This file includes settings for request timeouts, content length limits, feed and calendar file names, and more. Some of the key options you might want to modify are:

  • MAX_SHOWN_POSTS_PER_FEED: The number of posts to display per blog on the homepage.
  • MAX_FEED_ENTRY_AGE: The time window in days for fetching recent blog posts.
  • MAX_FEED_ENTRIES: The maximum number of entries to fetch from each feed.

Project Structure

A brief overview of the project's file structure:

/
├── .github/                   # GitHub Actions workflows for CI/CD.
├── _site/                     # Output directory for the generated website.
├── assets/                    # Static assets (CSS, SVG icons, PNG images).
│   ├── favicon.svg
│   ├── indiewebcamp-button.svg
│   ├── preview.png
│   └── style.css
├── pages/                     # Markdown files for static pages.
│   ├── coc.md
│   └── webring.md
├── src/                       # Python source code.
│   ├── __init__.py
│   ├── build.py               # Pull-based build system for parallel task execution.
│   ├── config.py              # Configuration constants for the project.
│   ├── events.py              # Logic for fetching events from the Discourse API.
│   ├── feeds.py               # Logic for fetching and parsing blogroll feeds.
│   ├── generator.py           # Main script to generate the static site.
│   ├── member_dir.py          # Logic for generating the member directory page.
│   └── utils.py               # Shared utilities for templating and HTTP requests.
├── templates/                 # HTML templates.
│   ├── default.html           # Template for wrapping generated content with site layout.
│   ├── index.html             # The pystache template for the homepage.
│   └── webring-redirect.html  # Template for webring redirect pages.
├── CNAME                      # Custom domain configuration for GitHub Pages.
├── LICENSE                    # The license for the project.
├── README.md                  # This file.
├── Makefile                   # Contains all the commands for building, serving, and cleaning the project.
├── blogroll.opml              # The list of feeds for the blogroll.
├── pyrightconfig.json         # Configuration file for the Pyright type checker.
├── requirements.txt           # Python dependencies for the project.
├── shell.nix                  # Nix shell configuration for reproducible development environments.
└── watch.sh                   # A script to watch for file changes and rebuild the site.

Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

IndieWebClub Bangalore Website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 70.0%
  • CSS 14.7%
  • HTML 11.8%
  • Makefile 2.8%
  • Other 0.7%