A static web site generator written in Go that creates HTML pages from long-form Nostr content. This tool downloads events by their naddr and generates static HTML pages that can be hosted anywhere.
- Downloads Nostr events by their naddr1 addresses
- Generates static HTML pages from long-form content
- Choose between dark and light themes
- Lists articles by profiles and tags
- Has RSS and Atom feeds for index, profiles and tags
- Smart content discovery with article recommendations
- One-click deployment to GitHub Pages with automated workflows
- support naddr
- profiles
- comments, zapthreads
- atom, rss feeds
- discoveribility
- dynamic theme option
- Basic understanding of command-line interface (CLI) operations
- Familiarity with navigating directories using
cdcommand - Understanding of basic file operations (copy, move, delete)
- Download Git from git-scm.com
- Run the installer and follow the installation wizard
- Verify installation by opening Command Prompt or PowerShell and running:
git --version
- Install via Homebrew (recommended):
brew install git
- Or download from git-scm.com
- Verify installation:
git --version
sudo apt update
sudo apt install git
git --version- Download Go from golang.org/dl
- Run the installer and follow the installation wizard
- Verify installation by opening Command Prompt or PowerShell:
go version
- Install via Homebrew (recommended):
brew install go
- Or download from golang.org/dl
- Verify installation:
go version
sudo apt update
sudo apt install golang-go
go versionThe tool is configured using a config.yaml file. Here's an example configuration:
layout:
color: dark # Options: light, dark
logo: logo.png # Logo image file name
title: "Nostr Articles" # Site title
faviconDir: favicon
blog_url: https://blog.nostrize.me
relays:
- wss://relay.damus.io
- wss://nostr.wine
- wss://relay.nostr.band
- wss://nos.lol
- wss://relay.primal.net
features:
comments: true
nostr_links: njump.me
tag_discovery: true
settings:
tag_discovery:
fetch_count_per_tag: 100 # fetch this many events per tag
popular_articles_count: 10 # max number of articles to display in tag discovery
weights:
reaction_weight: 1.0 # weight for reaction count
repost_weight: 2.0 # weight for repost count
reply_weight: 1.5 # weight for reply count
report_penalty: 5.0 # penalty for each report
zap_amount_weight: 0.1 # weight for total zap amount
zapper_count_weight: 0.5 # weight for number of unique zappers
zap_avg_weight: 2.0 # weight for average zap amount
zap_total_weight: 3.0 # multiplier for total zap score
max_sats: 10000000.0 # maximum sats for normalization (0.1 BTC)
articles:
- naddr1qvzqqqr4gupzqmnyhq7p7e60kq997xvpds5hkeq5hanlq9vffczd6nr9062pqthgqq25x6r2d90hzaj529f9gur2x9h4yt2gfy69qm05rzu
- naddr1qvzqqqr4gupzqmnyhq7p7e60kq997xvpds5hkeq5hanlq9vffczd6nr9062pqthgqq2j6ezsgu69j7n92cmxxmfsgyeyyvjtxfuk7lwjq6s
- naddr1qvzqqqr4gupzqmnyhq7p7e60kq997xvpds5hkeq5hanlq9vffczd6nr9062pqthgqq24wmjfwp6rv6t8v935ujfhv4yr2wzzdfz5gl5quve
- naddr1qvzqqqr4gupzqwlsccluhy6xxsr6l9a9uhhxf75g85g8a709tprjcn4e42h053vaqqyrzwrxvc6ngvfkxty9t8
profiles:
- nprofile1qqsrhuxx8l9ex335q7he0f09aej04zpazpl0ne2cgukyawd24mayt8gpp4mhxue69uhkummn9ekx7mqprhgw8
- nprofile1qqsxue9c8s0kwnaspf03nqtv99akg99lvlcptz2wqnw5cet7jsgza6qpp4mhxue69uhkummn9ekx7mq8k7c9l- Fork this repository
- Clone it into your local machine or use codespaces
- Modify the
config.yamlfile with your desired configuration - Add Nostr naddr to the
articleslist that you want to serve - Place a
logo.pngfile (or another file name, but don't forget to update logo in theconfig.yamlfile) into the project folder - Replace the files with your own in favicon folder
- Build and run the command:
go build -o nostr-static ./src && ./nostr-static - Commit and push your changes:
git add . git commit -m "Added my events, changed logo, title, and light theme" git push origin main
The tag discovery feature helps users find popular and relevant content by analyzing engagement metrics across different tags. To enable this feature:
-
Set
features.tag_discovery: truein yourconfig.yaml -
Run
./nostr-staticonce to generate the initialtags.txtfile -
Create the content index by running:
./nostr-static index-tag-discovery
This will fetch events from the Nostr network and their engagement statistics from nostr.band API.
-
Calculate popularity scores for articles:
./nostr-static calculate-tag-discovery
The scoring system considers:
- Engagement metrics (reposts, replies, reactions)
- Zap statistics (total amount, unique zappers, average zap size)
- Content quality signals (report penalties)
-
Finally, run
./nostr-staticagain to generate the recommended articles section
You can customize the scoring weights in your config.yaml under settings.tag_discovery.weights. If not specified, the system will use default weights optimized for balanced content discovery. Setting a weight to 0 will disable that particular scoring factor.
Example:
settings:
tag_discovery:
weights:
report_penalty: 0 # disable report penalties
reaction_weight: 2.0 # increase reaction weight
# other weights will use defaults- Go to your repository's Settings
- Navigate to "Pages" in the menu
- Under "Build and deployment" > "Source", select "GitHub Actions"
- Enable Actions by following the GitHub Actions settings guide
- Go to the "Actions" tab in the top menu. If you see the message "Workflows aren't being run on this forked repository", click the "I understand my workflows, go ahead and enable them" button
Since this is a static site generator, content is not dynamic. When an article is updated on Nostr, the changes won't be reflected automatically on your site. To keep your site up-to-date, you can automate the update process using your system's task scheduler or cron jobs. The scripts below will periodically check for updates and deploy them to your site.
- Set up Windows Task Scheduler:
- Open Task Scheduler
- Create a new Basic Task
- Set the trigger (e.g., daily at a specific time)
- Action: Start a program
- Program/script:
powershell.exe - Arguments:
-ExecutionPolicy Bypass -File "path\to\scripts\schedule-deploy.ps1" - Complete the wizard
The script will run nostr-static generate and commit any changes to your repository.
Tip: You can monitor the cron.log file to view job execution logs and track updates.
- Run the setup script:
./scripts/setup-cron.sh
This will set up a daily cron job that runs at midnight. To run hourly instead, edit the script and uncomment the hourly line.
The script will run nostr-static and commit any changes to your repository.
Tips:
- Use
crontab -lto view your scheduled jobs - Use
crontab -rto remove all scheduled jobs - Check
cron.logfor detailed execution logs
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.